Skip to main content

netlink_bindings/nl80211/
mod.rs

1#![doc = "Netlink API for 802\\.11 wireless devices"]
2#![allow(clippy::all)]
3#![allow(unused_imports)]
4#![allow(unused_assignments)]
5#![allow(non_snake_case)]
6#![allow(unused_variables)]
7#![allow(irrefutable_let_patterns)]
8#![allow(unreachable_code)]
9#![allow(unreachable_patterns)]
10use crate::builtin::{BuiltinBitfield32, BuiltinNfgenmsg, Nlmsghdr, PushDummy};
11use crate::{
12    consts,
13    traits::{NetlinkRequest, Protocol},
14    utils::*,
15};
16pub const PROTONAME: &str = "nl80211";
17pub const PROTONAME_CSTR: &CStr = c"nl80211";
18#[doc = "Enum - defines an integer enumeration, with values for each entry incrementing by 1, (e.g. 0, 1, 2, 3)"]
19#[derive(Debug, Clone, Copy)]
20pub enum Commands {
21    Unspec = 0,
22    GetWiphy = 1,
23    SetWiphy = 2,
24    NewWiphy = 3,
25    DelWiphy = 4,
26    GetInterface = 5,
27    SetInterface = 6,
28    NewInterface = 7,
29    DelInterface = 8,
30    GetKey = 9,
31    SetKey = 10,
32    NewKey = 11,
33    DelKey = 12,
34    GetBeacon = 13,
35    SetBeacon = 14,
36    NewBeacon = 15,
37    DelBeacon = 16,
38    GetStation = 17,
39    SetStation = 18,
40    NewStation = 19,
41    DelStation = 20,
42    GetMpath = 21,
43    SetMpath = 22,
44    NewMpath = 23,
45    DelMpath = 24,
46    SetBss = 25,
47    SetReg = 26,
48    ReqSetReg = 27,
49    GetMeshConfig = 28,
50    SetMeshConfig = 29,
51    SetMgmtExtraIe = 30,
52    GetReg = 31,
53    GetScan = 32,
54    TriggerScan = 33,
55    NewScanResults = 34,
56    ScanAborted = 35,
57    RegChange = 36,
58    Authenticate = 37,
59    Associate = 38,
60    Deauthenticate = 39,
61    Disassociate = 40,
62    MichaelMicFailure = 41,
63    RegBeaconHint = 42,
64    JoinIbss = 43,
65    LeaveIbss = 44,
66    Testmode = 45,
67    Connect = 46,
68    Roam = 47,
69    Disconnect = 48,
70    SetWiphyNetns = 49,
71    GetSurvey = 50,
72    NewSurveyResults = 51,
73    SetPmksa = 52,
74    DelPmksa = 53,
75    FlushPmksa = 54,
76    RemainOnChannel = 55,
77    CancelRemainOnChannel = 56,
78    SetTxBitrateMask = 57,
79    RegisterAction = 58,
80    Action = 59,
81    ActionTxStatus = 60,
82    SetPowerSave = 61,
83    GetPowerSave = 62,
84    SetCqm = 63,
85    NotifyCqm = 64,
86    SetChannel = 65,
87    SetWdsPeer = 66,
88    FrameWaitCancel = 67,
89    JoinMesh = 68,
90    LeaveMesh = 69,
91    UnprotDeauthenticate = 70,
92    UnprotDisassociate = 71,
93    NewPeerCandidate = 72,
94    GetWowlan = 73,
95    SetWowlan = 74,
96    StartSchedScan = 75,
97    StopSchedScan = 76,
98    SchedScanResults = 77,
99    SchedScanStopped = 78,
100    SetRekeyOffload = 79,
101    PmksaCandidate = 80,
102    TdlsOper = 81,
103    TdlsMgmt = 82,
104    UnexpectedFrame = 83,
105    ProbeClient = 84,
106    RegisterBeacons = 85,
107    Unexpected4AddrFrame = 86,
108    SetNoackMap = 87,
109    ChSwitchNotify = 88,
110    StartP2pDevice = 89,
111    StopP2pDevice = 90,
112    ConnFailed = 91,
113    SetMcastRate = 92,
114    SetMacAcl = 93,
115    RadarDetect = 94,
116    GetProtocolFeatures = 95,
117    UpdateFtIes = 96,
118    FtEvent = 97,
119    CritProtocolStart = 98,
120    CritProtocolStop = 99,
121    GetCoalesce = 100,
122    SetCoalesce = 101,
123    ChannelSwitch = 102,
124    Vendor = 103,
125    SetQosMap = 104,
126    AddTxTs = 105,
127    DelTxTs = 106,
128    GetMpp = 107,
129    JoinOcb = 108,
130    LeaveOcb = 109,
131    ChSwitchStartedNotify = 110,
132    TdlsChannelSwitch = 111,
133    TdlsCancelChannelSwitch = 112,
134    WiphyRegChange = 113,
135    AbortScan = 114,
136    StartNan = 115,
137    StopNan = 116,
138    AddNanFunction = 117,
139    DelNanFunction = 118,
140    ChangeNanConfig = 119,
141    NanMatch = 120,
142    SetMulticastToUnicast = 121,
143    UpdateConnectParams = 122,
144    SetPmk = 123,
145    DelPmk = 124,
146    PortAuthorized = 125,
147    ReloadRegdb = 126,
148    ExternalAuth = 127,
149    StaOpmodeChanged = 128,
150    ControlPortFrame = 129,
151    GetFtmResponderStats = 130,
152    PeerMeasurementStart = 131,
153    PeerMeasurementResult = 132,
154    PeerMeasurementComplete = 133,
155    NotifyRadar = 134,
156    UpdateOweInfo = 135,
157    ProbeMeshLink = 136,
158    SetTidConfig = 137,
159    UnprotBeacon = 138,
160    ControlPortFrameTxStatus = 139,
161    SetSarSpecs = 140,
162    ObssColorCollision = 141,
163    ColorChangeRequest = 142,
164    ColorChangeStarted = 143,
165    ColorChangeAborted = 144,
166    ColorChangeCompleted = 145,
167    SetFilsAad = 146,
168    AssocComeback = 147,
169    AddLink = 148,
170    RemoveLink = 149,
171    AddLinkSta = 150,
172    ModifyLinkSta = 151,
173    RemoveLinkSta = 152,
174    SetHwTimestamp = 153,
175    LinksRemoved = 154,
176    SetTidToLinkMapping = 155,
177}
178impl Commands {
179    pub fn from_value(value: u64) -> Option<Self> {
180        Some(match value {
181            0 => Self::Unspec,
182            1 => Self::GetWiphy,
183            2 => Self::SetWiphy,
184            3 => Self::NewWiphy,
185            4 => Self::DelWiphy,
186            5 => Self::GetInterface,
187            6 => Self::SetInterface,
188            7 => Self::NewInterface,
189            8 => Self::DelInterface,
190            9 => Self::GetKey,
191            10 => Self::SetKey,
192            11 => Self::NewKey,
193            12 => Self::DelKey,
194            13 => Self::GetBeacon,
195            14 => Self::SetBeacon,
196            15 => Self::NewBeacon,
197            16 => Self::DelBeacon,
198            17 => Self::GetStation,
199            18 => Self::SetStation,
200            19 => Self::NewStation,
201            20 => Self::DelStation,
202            21 => Self::GetMpath,
203            22 => Self::SetMpath,
204            23 => Self::NewMpath,
205            24 => Self::DelMpath,
206            25 => Self::SetBss,
207            26 => Self::SetReg,
208            27 => Self::ReqSetReg,
209            28 => Self::GetMeshConfig,
210            29 => Self::SetMeshConfig,
211            30 => Self::SetMgmtExtraIe,
212            31 => Self::GetReg,
213            32 => Self::GetScan,
214            33 => Self::TriggerScan,
215            34 => Self::NewScanResults,
216            35 => Self::ScanAborted,
217            36 => Self::RegChange,
218            37 => Self::Authenticate,
219            38 => Self::Associate,
220            39 => Self::Deauthenticate,
221            40 => Self::Disassociate,
222            41 => Self::MichaelMicFailure,
223            42 => Self::RegBeaconHint,
224            43 => Self::JoinIbss,
225            44 => Self::LeaveIbss,
226            45 => Self::Testmode,
227            46 => Self::Connect,
228            47 => Self::Roam,
229            48 => Self::Disconnect,
230            49 => Self::SetWiphyNetns,
231            50 => Self::GetSurvey,
232            51 => Self::NewSurveyResults,
233            52 => Self::SetPmksa,
234            53 => Self::DelPmksa,
235            54 => Self::FlushPmksa,
236            55 => Self::RemainOnChannel,
237            56 => Self::CancelRemainOnChannel,
238            57 => Self::SetTxBitrateMask,
239            58 => Self::RegisterAction,
240            59 => Self::Action,
241            60 => Self::ActionTxStatus,
242            61 => Self::SetPowerSave,
243            62 => Self::GetPowerSave,
244            63 => Self::SetCqm,
245            64 => Self::NotifyCqm,
246            65 => Self::SetChannel,
247            66 => Self::SetWdsPeer,
248            67 => Self::FrameWaitCancel,
249            68 => Self::JoinMesh,
250            69 => Self::LeaveMesh,
251            70 => Self::UnprotDeauthenticate,
252            71 => Self::UnprotDisassociate,
253            72 => Self::NewPeerCandidate,
254            73 => Self::GetWowlan,
255            74 => Self::SetWowlan,
256            75 => Self::StartSchedScan,
257            76 => Self::StopSchedScan,
258            77 => Self::SchedScanResults,
259            78 => Self::SchedScanStopped,
260            79 => Self::SetRekeyOffload,
261            80 => Self::PmksaCandidate,
262            81 => Self::TdlsOper,
263            82 => Self::TdlsMgmt,
264            83 => Self::UnexpectedFrame,
265            84 => Self::ProbeClient,
266            85 => Self::RegisterBeacons,
267            86 => Self::Unexpected4AddrFrame,
268            87 => Self::SetNoackMap,
269            88 => Self::ChSwitchNotify,
270            89 => Self::StartP2pDevice,
271            90 => Self::StopP2pDevice,
272            91 => Self::ConnFailed,
273            92 => Self::SetMcastRate,
274            93 => Self::SetMacAcl,
275            94 => Self::RadarDetect,
276            95 => Self::GetProtocolFeatures,
277            96 => Self::UpdateFtIes,
278            97 => Self::FtEvent,
279            98 => Self::CritProtocolStart,
280            99 => Self::CritProtocolStop,
281            100 => Self::GetCoalesce,
282            101 => Self::SetCoalesce,
283            102 => Self::ChannelSwitch,
284            103 => Self::Vendor,
285            104 => Self::SetQosMap,
286            105 => Self::AddTxTs,
287            106 => Self::DelTxTs,
288            107 => Self::GetMpp,
289            108 => Self::JoinOcb,
290            109 => Self::LeaveOcb,
291            110 => Self::ChSwitchStartedNotify,
292            111 => Self::TdlsChannelSwitch,
293            112 => Self::TdlsCancelChannelSwitch,
294            113 => Self::WiphyRegChange,
295            114 => Self::AbortScan,
296            115 => Self::StartNan,
297            116 => Self::StopNan,
298            117 => Self::AddNanFunction,
299            118 => Self::DelNanFunction,
300            119 => Self::ChangeNanConfig,
301            120 => Self::NanMatch,
302            121 => Self::SetMulticastToUnicast,
303            122 => Self::UpdateConnectParams,
304            123 => Self::SetPmk,
305            124 => Self::DelPmk,
306            125 => Self::PortAuthorized,
307            126 => Self::ReloadRegdb,
308            127 => Self::ExternalAuth,
309            128 => Self::StaOpmodeChanged,
310            129 => Self::ControlPortFrame,
311            130 => Self::GetFtmResponderStats,
312            131 => Self::PeerMeasurementStart,
313            132 => Self::PeerMeasurementResult,
314            133 => Self::PeerMeasurementComplete,
315            134 => Self::NotifyRadar,
316            135 => Self::UpdateOweInfo,
317            136 => Self::ProbeMeshLink,
318            137 => Self::SetTidConfig,
319            138 => Self::UnprotBeacon,
320            139 => Self::ControlPortFrameTxStatus,
321            140 => Self::SetSarSpecs,
322            141 => Self::ObssColorCollision,
323            142 => Self::ColorChangeRequest,
324            143 => Self::ColorChangeStarted,
325            144 => Self::ColorChangeAborted,
326            145 => Self::ColorChangeCompleted,
327            146 => Self::SetFilsAad,
328            147 => Self::AssocComeback,
329            148 => Self::AddLink,
330            149 => Self::RemoveLink,
331            150 => Self::AddLinkSta,
332            151 => Self::ModifyLinkSta,
333            152 => Self::RemoveLinkSta,
334            153 => Self::SetHwTimestamp,
335            154 => Self::LinksRemoved,
336            155 => Self::SetTidToLinkMapping,
337            _ => return None,
338        })
339    }
340}
341#[doc = "Flags - defines an integer enumeration, with values for each entry occupying a bit, starting from bit 0, (e.g. 1, 2, 4, 8)"]
342#[derive(Debug, Clone, Copy)]
343pub enum FeatureFlags {
344    SkTxStatus = 1 << 0,
345    HtIbss = 1 << 1,
346    InactivityTimer = 1 << 2,
347    CellBaseRegHints = 1 << 3,
348    P2pDeviceNeedsChannel = 1 << 4,
349    Sae = 1 << 5,
350    LowPriorityScan = 1 << 6,
351    ScanFlush = 1 << 7,
352    ApScan = 1 << 8,
353    VifTxpower = 1 << 9,
354    NeedObssScan = 1 << 10,
355    P2pGoCtwin = 1 << 11,
356    P2pGoOppps = 1 << 12,
357    Reserved = 1 << 13,
358    AdvertiseChanLimits = 1 << 14,
359    FullApClientState = 1 << 15,
360    UserspaceMpm = 1 << 16,
361    ActiveMonitor = 1 << 17,
362    ApModeChanWidthChange = 1 << 18,
363    DsParamSetIeInProbes = 1 << 19,
364    WfaTpcIeInProbes = 1 << 20,
365    Quiet = 1 << 21,
366    TxPowerInsertion = 1 << 22,
367    AcktoEstimation = 1 << 23,
368    StaticSmps = 1 << 24,
369    DynamicSmps = 1 << 25,
370    SupportsWmmAdmission = 1 << 26,
371    MacOnCreate = 1 << 27,
372    TdlsChannelSwitch = 1 << 28,
373    ScanRandomMacAddr = 1 << 29,
374    SchedScanRandomMacAddr = 1 << 30,
375    NoRandomMacAddr = 1 << 31,
376}
377impl FeatureFlags {
378    pub fn from_value(value: u64) -> Option<Self> {
379        Some(match value {
380            n if n == 1 << 0 => Self::SkTxStatus,
381            n if n == 1 << 1 => Self::HtIbss,
382            n if n == 1 << 2 => Self::InactivityTimer,
383            n if n == 1 << 3 => Self::CellBaseRegHints,
384            n if n == 1 << 4 => Self::P2pDeviceNeedsChannel,
385            n if n == 1 << 5 => Self::Sae,
386            n if n == 1 << 6 => Self::LowPriorityScan,
387            n if n == 1 << 7 => Self::ScanFlush,
388            n if n == 1 << 8 => Self::ApScan,
389            n if n == 1 << 9 => Self::VifTxpower,
390            n if n == 1 << 10 => Self::NeedObssScan,
391            n if n == 1 << 11 => Self::P2pGoCtwin,
392            n if n == 1 << 12 => Self::P2pGoOppps,
393            n if n == 1 << 13 => Self::Reserved,
394            n if n == 1 << 14 => Self::AdvertiseChanLimits,
395            n if n == 1 << 15 => Self::FullApClientState,
396            n if n == 1 << 16 => Self::UserspaceMpm,
397            n if n == 1 << 17 => Self::ActiveMonitor,
398            n if n == 1 << 18 => Self::ApModeChanWidthChange,
399            n if n == 1 << 19 => Self::DsParamSetIeInProbes,
400            n if n == 1 << 20 => Self::WfaTpcIeInProbes,
401            n if n == 1 << 21 => Self::Quiet,
402            n if n == 1 << 22 => Self::TxPowerInsertion,
403            n if n == 1 << 23 => Self::AcktoEstimation,
404            n if n == 1 << 24 => Self::StaticSmps,
405            n if n == 1 << 25 => Self::DynamicSmps,
406            n if n == 1 << 26 => Self::SupportsWmmAdmission,
407            n if n == 1 << 27 => Self::MacOnCreate,
408            n if n == 1 << 28 => Self::TdlsChannelSwitch,
409            n if n == 1 << 29 => Self::ScanRandomMacAddr,
410            n if n == 1 << 30 => Self::SchedScanRandomMacAddr,
411            n if n == 1 << 31 => Self::NoRandomMacAddr,
412            _ => return None,
413        })
414    }
415}
416#[doc = "Enum - defines an integer enumeration, with values for each entry incrementing by 1, (e.g. 0, 1, 2, 3)"]
417#[derive(Debug, Clone, Copy)]
418pub enum ChannelType {
419    NoHt = 0,
420    Ht20 = 1,
421    Ht40minus = 2,
422    Ht40plus = 3,
423}
424impl ChannelType {
425    pub fn from_value(value: u64) -> Option<Self> {
426        Some(match value {
427            0 => Self::NoHt,
428            1 => Self::Ht20,
429            2 => Self::Ht40minus,
430            3 => Self::Ht40plus,
431            _ => return None,
432        })
433    }
434}
435#[doc = "Flags - defines an integer enumeration, with values for each entry occupying a bit, starting from bit 0, (e.g. 1, 2, 4, 8)"]
436#[derive(Debug, Clone, Copy)]
437pub enum ProtocolFeatures {
438    SplitWiphyDump = 1 << 0,
439}
440impl ProtocolFeatures {
441    pub fn from_value(value: u64) -> Option<Self> {
442        Some(match value {
443            n if n == 1 << 0 => Self::SplitWiphyDump,
444            _ => return None,
445        })
446    }
447}
448#[derive(Debug)]
449#[repr(C, packed(4))]
450pub struct StaFlagUpdate {
451    pub mask: u32,
452    pub set: u32,
453}
454impl Clone for StaFlagUpdate {
455    fn clone(&self) -> Self {
456        Self::new_from_array(*self.as_array())
457    }
458}
459#[doc = "Create zero-initialized struct"]
460impl Default for StaFlagUpdate {
461    fn default() -> Self {
462        Self::new()
463    }
464}
465impl StaFlagUpdate {
466    #[doc = "Create zero-initialized struct"]
467    pub fn new() -> Self {
468        Self::new_from_array([0u8; Self::len()])
469    }
470    #[doc = "Copy from contents from slice"]
471    pub fn new_from_slice(other: &[u8]) -> Option<Self> {
472        if other.len() != Self::len() {
473            return None;
474        }
475        let mut buf = [0u8; Self::len()];
476        buf.clone_from_slice(other);
477        Some(Self::new_from_array(buf))
478    }
479    #[doc = "Copy from contents from another slice, padding with zeros or truncating when needed"]
480    pub fn new_from_zeroed(other: &[u8]) -> Self {
481        let mut buf = [0u8; Self::len()];
482        let len = buf.len().min(other.len());
483        buf[..len].clone_from_slice(&other[..len]);
484        Self::new_from_array(buf)
485    }
486    pub fn new_from_array(buf: [u8; 8usize]) -> Self {
487        unsafe { std::mem::transmute(buf) }
488    }
489    pub fn as_slice(&self) -> &[u8] {
490        unsafe {
491            let ptr: *const u8 = std::mem::transmute(self as *const Self);
492            std::slice::from_raw_parts(ptr, Self::len())
493        }
494    }
495    pub fn from_slice(buf: &[u8]) -> &Self {
496        assert!(buf.len() >= Self::len());
497        assert!(buf.as_ptr() as usize % std::mem::align_of::<Self>() == 0);
498        unsafe { std::mem::transmute(buf.as_ptr()) }
499    }
500    pub fn as_array(&self) -> &[u8; 8usize] {
501        unsafe { std::mem::transmute(self) }
502    }
503    pub fn from_array(buf: &[u8; 8usize]) -> &Self {
504        assert!(buf.as_ptr() as usize % std::mem::align_of::<Self>() == 0);
505        unsafe { std::mem::transmute(buf) }
506    }
507    pub fn into_array(self) -> [u8; 8usize] {
508        unsafe { std::mem::transmute(self) }
509    }
510    pub const fn len() -> usize {
511        const _: () = assert!(std::mem::size_of::<StaFlagUpdate>() == 8usize);
512        8usize
513    }
514}
515#[derive(Clone)]
516pub enum Nl80211Attrs<'a> {
517    Wiphy(u32),
518    WiphyName(&'a CStr),
519    Ifindex(u32),
520    Ifname(&'a CStr),
521    Iftype(u32),
522    Mac(&'a [u8]),
523    KeyData(&'a [u8]),
524    KeyIdx(u8),
525    KeyCipher(u32),
526    KeySeq(&'a [u8]),
527    KeyDefault(()),
528    BeaconInterval(u32),
529    DtimPeriod(u32),
530    BeaconHead(&'a [u8]),
531    BeaconTail(&'a [u8]),
532    StaAid(u16),
533    StaFlags(&'a [u8]),
534    StaListenInterval(u16),
535    StaSupportedRates(&'a [u8]),
536    StaVlan(u32),
537    StaInfo(&'a [u8]),
538    WiphyBands(IterableWiphyBands<'a>),
539    MntrFlags(&'a [u8]),
540    MeshId(&'a [u8]),
541    StaPlinkAction(u8),
542    MpathNextHop(&'a [u8]),
543    MpathInfo(&'a [u8]),
544    BssCtsProt(u8),
545    BssShortPreamble(u8),
546    BssShortSlotTime(u8),
547    HtCapability(&'a [u8]),
548    SupportedIftypes(IterableSupportedIftypes<'a>),
549    RegAlpha2(&'a [u8]),
550    RegRules(&'a [u8]),
551    MeshConfig(&'a [u8]),
552    BssBasicRates(&'a [u8]),
553    WiphyTxqParams(&'a [u8]),
554    WiphyFreq(u32),
555    #[doc = "Associated type: [`ChannelType`] (enum)"]
556    WiphyChannelType(u32),
557    KeyDefaultMgmt(()),
558    MgmtSubtype(u8),
559    Ie(&'a [u8]),
560    MaxNumScanSsids(u8),
561    ScanFrequencies(&'a [u8]),
562    ScanSsids(&'a [u8]),
563    Generation(u32),
564    Bss(&'a [u8]),
565    RegInitiator(u8),
566    RegType(u8),
567    #[doc = "Associated type: [`Commands`] (enum)"]
568    SupportedCommands(IterableArrayU32<'a>),
569    Frame(&'a [u8]),
570    Ssid(&'a [u8]),
571    AuthType(u32),
572    ReasonCode(u16),
573    KeyType(u32),
574    MaxScanIeLen(u16),
575    CipherSuites(&'a [u8]),
576    FreqBefore(&'a [u8]),
577    FreqAfter(&'a [u8]),
578    FreqFixed(()),
579    WiphyRetryShort(u8),
580    WiphyRetryLong(u8),
581    WiphyFragThreshold(u32),
582    WiphyRtsThreshold(u32),
583    TimedOut(()),
584    UseMfp(u32),
585    StaFlags2(StaFlagUpdate),
586    ControlPort(()),
587    Testdata(&'a [u8]),
588    Privacy(()),
589    DisconnectedByAp(()),
590    StatusCode(u16),
591    CipherSuitesPairwise(&'a [u8]),
592    CipherSuiteGroup(u32),
593    WpaVersions(u32),
594    AkmSuites(&'a [u8]),
595    ReqIe(&'a [u8]),
596    RespIe(&'a [u8]),
597    PrevBssid(&'a [u8]),
598    Key(&'a [u8]),
599    Keys(&'a [u8]),
600    Pid(u32),
601    _4addr(u8),
602    SurveyInfo(&'a [u8]),
603    Pmkid(&'a [u8]),
604    MaxNumPmkids(u8),
605    Duration(u32),
606    Cookie(u64),
607    WiphyCoverageClass(u8),
608    TxRates(&'a [u8]),
609    FrameMatch(&'a [u8]),
610    Ack(()),
611    PsState(u32),
612    Cqm(&'a [u8]),
613    LocalStateChange(()),
614    ApIsolate(u8),
615    WiphyTxPowerSetting(u32),
616    WiphyTxPowerLevel(u32),
617    TxFrameTypes(IterableIftypeAttrs<'a>),
618    RxFrameTypes(IterableIftypeAttrs<'a>),
619    FrameType(u16),
620    ControlPortEthertype(()),
621    ControlPortNoEncrypt(()),
622    SupportIbssRsn(()),
623    WiphyAntennaTx(u32),
624    WiphyAntennaRx(u32),
625    McastRate(u32),
626    OffchannelTxOk(()),
627    BssHtOpmode(u16),
628    KeyDefaultTypes(&'a [u8]),
629    MaxRemainOnChannelDuration(u32),
630    MeshSetup(&'a [u8]),
631    WiphyAntennaAvailTx(u32),
632    WiphyAntennaAvailRx(u32),
633    SupportMeshAuth(()),
634    StaPlinkState(u8),
635    WowlanTriggers(&'a [u8]),
636    WowlanTriggersSupported(IterableWowlanTriggersAttrs<'a>),
637    SchedScanInterval(u32),
638    InterfaceCombinations(IterableArrayIfCombinationAttributes<'a>),
639    SoftwareIftypes(IterableSupportedIftypes<'a>),
640    RekeyData(&'a [u8]),
641    MaxNumSchedScanSsids(u8),
642    MaxSchedScanIeLen(u16),
643    ScanSuppRates(&'a [u8]),
644    HiddenSsid(u32),
645    IeProbeResp(&'a [u8]),
646    IeAssocResp(&'a [u8]),
647    StaWme(&'a [u8]),
648    SupportApUapsd(()),
649    RoamSupport(()),
650    SchedScanMatch(&'a [u8]),
651    MaxMatchSets(u8),
652    PmksaCandidate(&'a [u8]),
653    TxNoCckRate(()),
654    TdlsAction(u8),
655    TdlsDialogToken(u8),
656    TdlsOperation(u8),
657    TdlsSupport(()),
658    TdlsExternalSetup(()),
659    DeviceApSme(u32),
660    DontWaitForAck(()),
661    #[doc = "Associated type: [`FeatureFlags`] (1 bit per enumeration)"]
662    FeatureFlags(u32),
663    ProbeRespOffload(u32),
664    ProbeResp(&'a [u8]),
665    DfsRegion(u8),
666    DisableHt(()),
667    HtCapabilityMask(&'a [u8]),
668    NoackMap(u16),
669    InactivityTimeout(u16),
670    RxSignalDbm(u32),
671    BgScanPeriod(u16),
672    Wdev(u64),
673    UserRegHintType(u32),
674    ConnFailedReason(u32),
675    AuthData(&'a [u8]),
676    VhtCapability(&'a [u8]),
677    ScanFlags(u32),
678    ChannelWidth(u32),
679    CenterFreq1(u32),
680    CenterFreq2(u32),
681    P2pCtwindow(u8),
682    P2pOppps(u8),
683    LocalMeshPowerMode(u32),
684    AclPolicy(u32),
685    MacAddrs(&'a [u8]),
686    MacAclMax(u32),
687    RadarEvent(u32),
688    ExtCapa(&'a [u8]),
689    ExtCapaMask(&'a [u8]),
690    StaCapability(u16),
691    StaExtCapability(&'a [u8]),
692    #[doc = "Associated type: [`ProtocolFeatures`] (enum)"]
693    ProtocolFeatures(u32),
694    SplitWiphyDump(()),
695    DisableVht(()),
696    VhtCapabilityMask(&'a [u8]),
697    Mdid(u16),
698    IeRic(&'a [u8]),
699    CritProtId(u16),
700    MaxCritProtDuration(u16),
701    PeerAid(u16),
702    CoalesceRule(&'a [u8]),
703    ChSwitchCount(u32),
704    ChSwitchBlockTx(()),
705    CsaIes(&'a [u8]),
706    CntdwnOffsBeacon(&'a [u8]),
707    CntdwnOffsPresp(&'a [u8]),
708    RxmgmtFlags(&'a [u8]),
709    StaSupportedChannels(&'a [u8]),
710    StaSupportedOperClasses(&'a [u8]),
711    HandleDfs(()),
712    Support5Mhz(()),
713    Support10Mhz(()),
714    OpmodeNotif(u8),
715    VendorId(u32),
716    VendorSubcmd(u32),
717    VendorData(&'a [u8]),
718    VendorEvents(&'a [u8]),
719    QosMap(&'a [u8]),
720    MacHint(&'a [u8]),
721    WiphyFreqHint(u32),
722    MaxApAssocSta(u32),
723    TdlsPeerCapability(u32),
724    SocketOwner(()),
725    CsaCOffsetsTx(&'a [u8]),
726    MaxCsaCounters(u8),
727    TdlsInitiator(()),
728    UseRrm(()),
729    WiphyDynAck(()),
730    Tsid(u8),
731    UserPrio(u8),
732    AdmittedTime(u16),
733    SmpsMode(u8),
734    OperClass(u8),
735    MacMask(&'a [u8]),
736    WiphySelfManagedReg(()),
737    ExtFeatures(&'a [u8]),
738    SurveyRadioStats(&'a [u8]),
739    NetnsFd(u32),
740    SchedScanDelay(u32),
741    RegIndoor(()),
742    MaxNumSchedScanPlans(u32),
743    MaxScanPlanInterval(u32),
744    MaxScanPlanIterations(u32),
745    SchedScanPlans(&'a [u8]),
746    Pbss(()),
747    BssSelect(&'a [u8]),
748    StaSupportP2pPs(u8),
749    Pad(&'a [u8]),
750    IftypeExtCapa(&'a [u8]),
751    MuMimoGroupData(&'a [u8]),
752    MuMimoFollowMacAddr(&'a [u8]),
753    ScanStartTimeTsf(u64),
754    ScanStartTimeTsfBssid(&'a [u8]),
755    MeasurementDuration(u16),
756    MeasurementDurationMandatory(()),
757    MeshPeerAid(u16),
758    NanMasterPref(u8),
759    Bands(u32),
760    NanFunc(&'a [u8]),
761    NanMatch(&'a [u8]),
762    FilsKek(&'a [u8]),
763    FilsNonces(&'a [u8]),
764    MulticastToUnicastEnabled(()),
765    Bssid(&'a [u8]),
766    SchedScanRelativeRssi(i8),
767    SchedScanRssiAdjust(&'a [u8]),
768    TimeoutReason(u32),
769    FilsErpUsername(&'a [u8]),
770    FilsErpRealm(&'a [u8]),
771    FilsErpNextSeqNum(u16),
772    FilsErpRrk(&'a [u8]),
773    FilsCacheId(&'a [u8]),
774    Pmk(&'a [u8]),
775    SchedScanMulti(()),
776    SchedScanMaxReqs(u32),
777    Want1x4wayHs(()),
778    Pmkr0Name(&'a [u8]),
779    PortAuthorized(&'a [u8]),
780    ExternalAuthAction(u32),
781    ExternalAuthSupport(()),
782    Nss(u8),
783    AckSignal(i32),
784    ControlPortOverNl80211(()),
785    TxqStats(IterableTxqStatsAttrs<'a>),
786    TxqLimit(u32),
787    TxqMemoryLimit(u32),
788    TxqQuantum(u32),
789    HeCapability(&'a [u8]),
790    FtmResponder(&'a [u8]),
791    FtmResponderStats(&'a [u8]),
792    Timeout(u32),
793    PeerMeasurements(&'a [u8]),
794    AirtimeWeight(u16),
795    StaTxPowerSetting(u8),
796    StaTxPower(i16),
797    SaePassword(&'a [u8]),
798    TwtResponder(()),
799    HeObssPd(&'a [u8]),
800    WiphyEdmgChannels(u8),
801    WiphyEdmgBwConfig(u8),
802    VlanId(u16),
803    HeBssColor(&'a [u8]),
804    IftypeAkmSuites(&'a [u8]),
805    TidConfig(&'a [u8]),
806    ControlPortNoPreauth(()),
807    PmkLifetime(u32),
808    PmkReauthThreshold(u8),
809    ReceiveMulticast(()),
810    WiphyFreqOffset(u32),
811    CenterFreq1Offset(u32),
812    ScanFreqKhz(&'a [u8]),
813    He6ghzCapability(&'a [u8]),
814    FilsDiscovery(&'a [u8]),
815    UnsolBcastProbeResp(&'a [u8]),
816    S1gCapability(&'a [u8]),
817    S1gCapabilityMask(&'a [u8]),
818    SaePwe(u8),
819    ReconnectRequested(&'a [u8]),
820    SarSpec(IterableSarAttributes<'a>),
821    DisableHe(()),
822    ObssColorBitmap(u64),
823    ColorChangeCount(u8),
824    ColorChangeColor(u8),
825    ColorChangeElems(&'a [u8]),
826    MbssidConfig(&'a [u8]),
827    MbssidElems(&'a [u8]),
828    RadarBackground(()),
829    ApSettingsFlags(u32),
830    EhtCapability(&'a [u8]),
831    DisableEht(()),
832    MloLinks(&'a [u8]),
833    MloLinkId(u8),
834    MldAddr(&'a [u8]),
835    MloSupport(()),
836    MaxNumAkmSuites(&'a [u8]),
837    EmlCapability(u16),
838    MldCapaAndOps(u16),
839    TxHwTimestamp(u64),
840    RxHwTimestamp(u64),
841    TdBitmap(&'a [u8]),
842    PunctBitmap(u32),
843    MaxHwTimestampPeers(u16),
844    HwTimestampEnabled(()),
845    EmaRnrElems(&'a [u8]),
846    MloLinkDisabled(()),
847    BssDumpIncludeUseData(()),
848    MloTtlmDlink(u16),
849    MloTtlmUlink(u16),
850    AssocSppAmsdu(()),
851    WiphyRadios(&'a [u8]),
852    WiphyInterfaceCombinations(&'a [u8]),
853    VifRadioMask(u32),
854}
855impl<'a> IterableNl80211Attrs<'a> {
856    pub fn get_wiphy(&self) -> Result<u32, ErrorContext> {
857        let mut iter = self.clone();
858        iter.pos = 0;
859        for attr in iter {
860            if let Nl80211Attrs::Wiphy(val) = attr? {
861                return Ok(val);
862            }
863        }
864        Err(ErrorContext::new_missing(
865            "Nl80211Attrs",
866            "Wiphy",
867            self.orig_loc,
868            self.buf.as_ptr() as usize,
869        ))
870    }
871    pub fn get_wiphy_name(&self) -> Result<&'a CStr, ErrorContext> {
872        let mut iter = self.clone();
873        iter.pos = 0;
874        for attr in iter {
875            if let Nl80211Attrs::WiphyName(val) = attr? {
876                return Ok(val);
877            }
878        }
879        Err(ErrorContext::new_missing(
880            "Nl80211Attrs",
881            "WiphyName",
882            self.orig_loc,
883            self.buf.as_ptr() as usize,
884        ))
885    }
886    pub fn get_ifindex(&self) -> Result<u32, ErrorContext> {
887        let mut iter = self.clone();
888        iter.pos = 0;
889        for attr in iter {
890            if let Nl80211Attrs::Ifindex(val) = attr? {
891                return Ok(val);
892            }
893        }
894        Err(ErrorContext::new_missing(
895            "Nl80211Attrs",
896            "Ifindex",
897            self.orig_loc,
898            self.buf.as_ptr() as usize,
899        ))
900    }
901    pub fn get_ifname(&self) -> Result<&'a CStr, ErrorContext> {
902        let mut iter = self.clone();
903        iter.pos = 0;
904        for attr in iter {
905            if let Nl80211Attrs::Ifname(val) = attr? {
906                return Ok(val);
907            }
908        }
909        Err(ErrorContext::new_missing(
910            "Nl80211Attrs",
911            "Ifname",
912            self.orig_loc,
913            self.buf.as_ptr() as usize,
914        ))
915    }
916    pub fn get_iftype(&self) -> Result<u32, ErrorContext> {
917        let mut iter = self.clone();
918        iter.pos = 0;
919        for attr in iter {
920            if let Nl80211Attrs::Iftype(val) = attr? {
921                return Ok(val);
922            }
923        }
924        Err(ErrorContext::new_missing(
925            "Nl80211Attrs",
926            "Iftype",
927            self.orig_loc,
928            self.buf.as_ptr() as usize,
929        ))
930    }
931    pub fn get_mac(&self) -> Result<&'a [u8], ErrorContext> {
932        let mut iter = self.clone();
933        iter.pos = 0;
934        for attr in iter {
935            if let Nl80211Attrs::Mac(val) = attr? {
936                return Ok(val);
937            }
938        }
939        Err(ErrorContext::new_missing(
940            "Nl80211Attrs",
941            "Mac",
942            self.orig_loc,
943            self.buf.as_ptr() as usize,
944        ))
945    }
946    pub fn get_key_data(&self) -> Result<&'a [u8], ErrorContext> {
947        let mut iter = self.clone();
948        iter.pos = 0;
949        for attr in iter {
950            if let Nl80211Attrs::KeyData(val) = attr? {
951                return Ok(val);
952            }
953        }
954        Err(ErrorContext::new_missing(
955            "Nl80211Attrs",
956            "KeyData",
957            self.orig_loc,
958            self.buf.as_ptr() as usize,
959        ))
960    }
961    pub fn get_key_idx(&self) -> Result<u8, ErrorContext> {
962        let mut iter = self.clone();
963        iter.pos = 0;
964        for attr in iter {
965            if let Nl80211Attrs::KeyIdx(val) = attr? {
966                return Ok(val);
967            }
968        }
969        Err(ErrorContext::new_missing(
970            "Nl80211Attrs",
971            "KeyIdx",
972            self.orig_loc,
973            self.buf.as_ptr() as usize,
974        ))
975    }
976    pub fn get_key_cipher(&self) -> Result<u32, ErrorContext> {
977        let mut iter = self.clone();
978        iter.pos = 0;
979        for attr in iter {
980            if let Nl80211Attrs::KeyCipher(val) = attr? {
981                return Ok(val);
982            }
983        }
984        Err(ErrorContext::new_missing(
985            "Nl80211Attrs",
986            "KeyCipher",
987            self.orig_loc,
988            self.buf.as_ptr() as usize,
989        ))
990    }
991    pub fn get_key_seq(&self) -> Result<&'a [u8], ErrorContext> {
992        let mut iter = self.clone();
993        iter.pos = 0;
994        for attr in iter {
995            if let Nl80211Attrs::KeySeq(val) = attr? {
996                return Ok(val);
997            }
998        }
999        Err(ErrorContext::new_missing(
1000            "Nl80211Attrs",
1001            "KeySeq",
1002            self.orig_loc,
1003            self.buf.as_ptr() as usize,
1004        ))
1005    }
1006    pub fn get_key_default(&self) -> Result<(), ErrorContext> {
1007        let mut iter = self.clone();
1008        iter.pos = 0;
1009        for attr in iter {
1010            if let Nl80211Attrs::KeyDefault(val) = attr? {
1011                return Ok(val);
1012            }
1013        }
1014        Err(ErrorContext::new_missing(
1015            "Nl80211Attrs",
1016            "KeyDefault",
1017            self.orig_loc,
1018            self.buf.as_ptr() as usize,
1019        ))
1020    }
1021    pub fn get_beacon_interval(&self) -> Result<u32, ErrorContext> {
1022        let mut iter = self.clone();
1023        iter.pos = 0;
1024        for attr in iter {
1025            if let Nl80211Attrs::BeaconInterval(val) = attr? {
1026                return Ok(val);
1027            }
1028        }
1029        Err(ErrorContext::new_missing(
1030            "Nl80211Attrs",
1031            "BeaconInterval",
1032            self.orig_loc,
1033            self.buf.as_ptr() as usize,
1034        ))
1035    }
1036    pub fn get_dtim_period(&self) -> Result<u32, ErrorContext> {
1037        let mut iter = self.clone();
1038        iter.pos = 0;
1039        for attr in iter {
1040            if let Nl80211Attrs::DtimPeriod(val) = attr? {
1041                return Ok(val);
1042            }
1043        }
1044        Err(ErrorContext::new_missing(
1045            "Nl80211Attrs",
1046            "DtimPeriod",
1047            self.orig_loc,
1048            self.buf.as_ptr() as usize,
1049        ))
1050    }
1051    pub fn get_beacon_head(&self) -> Result<&'a [u8], ErrorContext> {
1052        let mut iter = self.clone();
1053        iter.pos = 0;
1054        for attr in iter {
1055            if let Nl80211Attrs::BeaconHead(val) = attr? {
1056                return Ok(val);
1057            }
1058        }
1059        Err(ErrorContext::new_missing(
1060            "Nl80211Attrs",
1061            "BeaconHead",
1062            self.orig_loc,
1063            self.buf.as_ptr() as usize,
1064        ))
1065    }
1066    pub fn get_beacon_tail(&self) -> Result<&'a [u8], ErrorContext> {
1067        let mut iter = self.clone();
1068        iter.pos = 0;
1069        for attr in iter {
1070            if let Nl80211Attrs::BeaconTail(val) = attr? {
1071                return Ok(val);
1072            }
1073        }
1074        Err(ErrorContext::new_missing(
1075            "Nl80211Attrs",
1076            "BeaconTail",
1077            self.orig_loc,
1078            self.buf.as_ptr() as usize,
1079        ))
1080    }
1081    pub fn get_sta_aid(&self) -> Result<u16, ErrorContext> {
1082        let mut iter = self.clone();
1083        iter.pos = 0;
1084        for attr in iter {
1085            if let Nl80211Attrs::StaAid(val) = attr? {
1086                return Ok(val);
1087            }
1088        }
1089        Err(ErrorContext::new_missing(
1090            "Nl80211Attrs",
1091            "StaAid",
1092            self.orig_loc,
1093            self.buf.as_ptr() as usize,
1094        ))
1095    }
1096    pub fn get_sta_flags(&self) -> Result<&'a [u8], ErrorContext> {
1097        let mut iter = self.clone();
1098        iter.pos = 0;
1099        for attr in iter {
1100            if let Nl80211Attrs::StaFlags(val) = attr? {
1101                return Ok(val);
1102            }
1103        }
1104        Err(ErrorContext::new_missing(
1105            "Nl80211Attrs",
1106            "StaFlags",
1107            self.orig_loc,
1108            self.buf.as_ptr() as usize,
1109        ))
1110    }
1111    pub fn get_sta_listen_interval(&self) -> Result<u16, ErrorContext> {
1112        let mut iter = self.clone();
1113        iter.pos = 0;
1114        for attr in iter {
1115            if let Nl80211Attrs::StaListenInterval(val) = attr? {
1116                return Ok(val);
1117            }
1118        }
1119        Err(ErrorContext::new_missing(
1120            "Nl80211Attrs",
1121            "StaListenInterval",
1122            self.orig_loc,
1123            self.buf.as_ptr() as usize,
1124        ))
1125    }
1126    pub fn get_sta_supported_rates(&self) -> Result<&'a [u8], ErrorContext> {
1127        let mut iter = self.clone();
1128        iter.pos = 0;
1129        for attr in iter {
1130            if let Nl80211Attrs::StaSupportedRates(val) = attr? {
1131                return Ok(val);
1132            }
1133        }
1134        Err(ErrorContext::new_missing(
1135            "Nl80211Attrs",
1136            "StaSupportedRates",
1137            self.orig_loc,
1138            self.buf.as_ptr() as usize,
1139        ))
1140    }
1141    pub fn get_sta_vlan(&self) -> Result<u32, ErrorContext> {
1142        let mut iter = self.clone();
1143        iter.pos = 0;
1144        for attr in iter {
1145            if let Nl80211Attrs::StaVlan(val) = attr? {
1146                return Ok(val);
1147            }
1148        }
1149        Err(ErrorContext::new_missing(
1150            "Nl80211Attrs",
1151            "StaVlan",
1152            self.orig_loc,
1153            self.buf.as_ptr() as usize,
1154        ))
1155    }
1156    pub fn get_sta_info(&self) -> Result<&'a [u8], ErrorContext> {
1157        let mut iter = self.clone();
1158        iter.pos = 0;
1159        for attr in iter {
1160            if let Nl80211Attrs::StaInfo(val) = attr? {
1161                return Ok(val);
1162            }
1163        }
1164        Err(ErrorContext::new_missing(
1165            "Nl80211Attrs",
1166            "StaInfo",
1167            self.orig_loc,
1168            self.buf.as_ptr() as usize,
1169        ))
1170    }
1171    pub fn get_wiphy_bands(&self) -> Result<IterableWiphyBands<'a>, ErrorContext> {
1172        let mut iter = self.clone();
1173        iter.pos = 0;
1174        for attr in iter {
1175            if let Nl80211Attrs::WiphyBands(val) = attr? {
1176                return Ok(val);
1177            }
1178        }
1179        Err(ErrorContext::new_missing(
1180            "Nl80211Attrs",
1181            "WiphyBands",
1182            self.orig_loc,
1183            self.buf.as_ptr() as usize,
1184        ))
1185    }
1186    pub fn get_mntr_flags(&self) -> Result<&'a [u8], ErrorContext> {
1187        let mut iter = self.clone();
1188        iter.pos = 0;
1189        for attr in iter {
1190            if let Nl80211Attrs::MntrFlags(val) = attr? {
1191                return Ok(val);
1192            }
1193        }
1194        Err(ErrorContext::new_missing(
1195            "Nl80211Attrs",
1196            "MntrFlags",
1197            self.orig_loc,
1198            self.buf.as_ptr() as usize,
1199        ))
1200    }
1201    pub fn get_mesh_id(&self) -> Result<&'a [u8], ErrorContext> {
1202        let mut iter = self.clone();
1203        iter.pos = 0;
1204        for attr in iter {
1205            if let Nl80211Attrs::MeshId(val) = attr? {
1206                return Ok(val);
1207            }
1208        }
1209        Err(ErrorContext::new_missing(
1210            "Nl80211Attrs",
1211            "MeshId",
1212            self.orig_loc,
1213            self.buf.as_ptr() as usize,
1214        ))
1215    }
1216    pub fn get_sta_plink_action(&self) -> Result<u8, ErrorContext> {
1217        let mut iter = self.clone();
1218        iter.pos = 0;
1219        for attr in iter {
1220            if let Nl80211Attrs::StaPlinkAction(val) = attr? {
1221                return Ok(val);
1222            }
1223        }
1224        Err(ErrorContext::new_missing(
1225            "Nl80211Attrs",
1226            "StaPlinkAction",
1227            self.orig_loc,
1228            self.buf.as_ptr() as usize,
1229        ))
1230    }
1231    pub fn get_mpath_next_hop(&self) -> Result<&'a [u8], ErrorContext> {
1232        let mut iter = self.clone();
1233        iter.pos = 0;
1234        for attr in iter {
1235            if let Nl80211Attrs::MpathNextHop(val) = attr? {
1236                return Ok(val);
1237            }
1238        }
1239        Err(ErrorContext::new_missing(
1240            "Nl80211Attrs",
1241            "MpathNextHop",
1242            self.orig_loc,
1243            self.buf.as_ptr() as usize,
1244        ))
1245    }
1246    pub fn get_mpath_info(&self) -> Result<&'a [u8], ErrorContext> {
1247        let mut iter = self.clone();
1248        iter.pos = 0;
1249        for attr in iter {
1250            if let Nl80211Attrs::MpathInfo(val) = attr? {
1251                return Ok(val);
1252            }
1253        }
1254        Err(ErrorContext::new_missing(
1255            "Nl80211Attrs",
1256            "MpathInfo",
1257            self.orig_loc,
1258            self.buf.as_ptr() as usize,
1259        ))
1260    }
1261    pub fn get_bss_cts_prot(&self) -> Result<u8, ErrorContext> {
1262        let mut iter = self.clone();
1263        iter.pos = 0;
1264        for attr in iter {
1265            if let Nl80211Attrs::BssCtsProt(val) = attr? {
1266                return Ok(val);
1267            }
1268        }
1269        Err(ErrorContext::new_missing(
1270            "Nl80211Attrs",
1271            "BssCtsProt",
1272            self.orig_loc,
1273            self.buf.as_ptr() as usize,
1274        ))
1275    }
1276    pub fn get_bss_short_preamble(&self) -> Result<u8, ErrorContext> {
1277        let mut iter = self.clone();
1278        iter.pos = 0;
1279        for attr in iter {
1280            if let Nl80211Attrs::BssShortPreamble(val) = attr? {
1281                return Ok(val);
1282            }
1283        }
1284        Err(ErrorContext::new_missing(
1285            "Nl80211Attrs",
1286            "BssShortPreamble",
1287            self.orig_loc,
1288            self.buf.as_ptr() as usize,
1289        ))
1290    }
1291    pub fn get_bss_short_slot_time(&self) -> Result<u8, ErrorContext> {
1292        let mut iter = self.clone();
1293        iter.pos = 0;
1294        for attr in iter {
1295            if let Nl80211Attrs::BssShortSlotTime(val) = attr? {
1296                return Ok(val);
1297            }
1298        }
1299        Err(ErrorContext::new_missing(
1300            "Nl80211Attrs",
1301            "BssShortSlotTime",
1302            self.orig_loc,
1303            self.buf.as_ptr() as usize,
1304        ))
1305    }
1306    pub fn get_ht_capability(&self) -> Result<&'a [u8], ErrorContext> {
1307        let mut iter = self.clone();
1308        iter.pos = 0;
1309        for attr in iter {
1310            if let Nl80211Attrs::HtCapability(val) = attr? {
1311                return Ok(val);
1312            }
1313        }
1314        Err(ErrorContext::new_missing(
1315            "Nl80211Attrs",
1316            "HtCapability",
1317            self.orig_loc,
1318            self.buf.as_ptr() as usize,
1319        ))
1320    }
1321    pub fn get_supported_iftypes(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
1322        let mut iter = self.clone();
1323        iter.pos = 0;
1324        for attr in iter {
1325            if let Nl80211Attrs::SupportedIftypes(val) = attr? {
1326                return Ok(val);
1327            }
1328        }
1329        Err(ErrorContext::new_missing(
1330            "Nl80211Attrs",
1331            "SupportedIftypes",
1332            self.orig_loc,
1333            self.buf.as_ptr() as usize,
1334        ))
1335    }
1336    pub fn get_reg_alpha2(&self) -> Result<&'a [u8], ErrorContext> {
1337        let mut iter = self.clone();
1338        iter.pos = 0;
1339        for attr in iter {
1340            if let Nl80211Attrs::RegAlpha2(val) = attr? {
1341                return Ok(val);
1342            }
1343        }
1344        Err(ErrorContext::new_missing(
1345            "Nl80211Attrs",
1346            "RegAlpha2",
1347            self.orig_loc,
1348            self.buf.as_ptr() as usize,
1349        ))
1350    }
1351    pub fn get_reg_rules(&self) -> Result<&'a [u8], ErrorContext> {
1352        let mut iter = self.clone();
1353        iter.pos = 0;
1354        for attr in iter {
1355            if let Nl80211Attrs::RegRules(val) = attr? {
1356                return Ok(val);
1357            }
1358        }
1359        Err(ErrorContext::new_missing(
1360            "Nl80211Attrs",
1361            "RegRules",
1362            self.orig_loc,
1363            self.buf.as_ptr() as usize,
1364        ))
1365    }
1366    pub fn get_mesh_config(&self) -> Result<&'a [u8], ErrorContext> {
1367        let mut iter = self.clone();
1368        iter.pos = 0;
1369        for attr in iter {
1370            if let Nl80211Attrs::MeshConfig(val) = attr? {
1371                return Ok(val);
1372            }
1373        }
1374        Err(ErrorContext::new_missing(
1375            "Nl80211Attrs",
1376            "MeshConfig",
1377            self.orig_loc,
1378            self.buf.as_ptr() as usize,
1379        ))
1380    }
1381    pub fn get_bss_basic_rates(&self) -> Result<&'a [u8], ErrorContext> {
1382        let mut iter = self.clone();
1383        iter.pos = 0;
1384        for attr in iter {
1385            if let Nl80211Attrs::BssBasicRates(val) = attr? {
1386                return Ok(val);
1387            }
1388        }
1389        Err(ErrorContext::new_missing(
1390            "Nl80211Attrs",
1391            "BssBasicRates",
1392            self.orig_loc,
1393            self.buf.as_ptr() as usize,
1394        ))
1395    }
1396    pub fn get_wiphy_txq_params(&self) -> Result<&'a [u8], ErrorContext> {
1397        let mut iter = self.clone();
1398        iter.pos = 0;
1399        for attr in iter {
1400            if let Nl80211Attrs::WiphyTxqParams(val) = attr? {
1401                return Ok(val);
1402            }
1403        }
1404        Err(ErrorContext::new_missing(
1405            "Nl80211Attrs",
1406            "WiphyTxqParams",
1407            self.orig_loc,
1408            self.buf.as_ptr() as usize,
1409        ))
1410    }
1411    pub fn get_wiphy_freq(&self) -> Result<u32, ErrorContext> {
1412        let mut iter = self.clone();
1413        iter.pos = 0;
1414        for attr in iter {
1415            if let Nl80211Attrs::WiphyFreq(val) = attr? {
1416                return Ok(val);
1417            }
1418        }
1419        Err(ErrorContext::new_missing(
1420            "Nl80211Attrs",
1421            "WiphyFreq",
1422            self.orig_loc,
1423            self.buf.as_ptr() as usize,
1424        ))
1425    }
1426    #[doc = "Associated type: [`ChannelType`] (enum)"]
1427    pub fn get_wiphy_channel_type(&self) -> Result<u32, ErrorContext> {
1428        let mut iter = self.clone();
1429        iter.pos = 0;
1430        for attr in iter {
1431            if let Nl80211Attrs::WiphyChannelType(val) = attr? {
1432                return Ok(val);
1433            }
1434        }
1435        Err(ErrorContext::new_missing(
1436            "Nl80211Attrs",
1437            "WiphyChannelType",
1438            self.orig_loc,
1439            self.buf.as_ptr() as usize,
1440        ))
1441    }
1442    pub fn get_key_default_mgmt(&self) -> Result<(), ErrorContext> {
1443        let mut iter = self.clone();
1444        iter.pos = 0;
1445        for attr in iter {
1446            if let Nl80211Attrs::KeyDefaultMgmt(val) = attr? {
1447                return Ok(val);
1448            }
1449        }
1450        Err(ErrorContext::new_missing(
1451            "Nl80211Attrs",
1452            "KeyDefaultMgmt",
1453            self.orig_loc,
1454            self.buf.as_ptr() as usize,
1455        ))
1456    }
1457    pub fn get_mgmt_subtype(&self) -> Result<u8, ErrorContext> {
1458        let mut iter = self.clone();
1459        iter.pos = 0;
1460        for attr in iter {
1461            if let Nl80211Attrs::MgmtSubtype(val) = attr? {
1462                return Ok(val);
1463            }
1464        }
1465        Err(ErrorContext::new_missing(
1466            "Nl80211Attrs",
1467            "MgmtSubtype",
1468            self.orig_loc,
1469            self.buf.as_ptr() as usize,
1470        ))
1471    }
1472    pub fn get_ie(&self) -> Result<&'a [u8], ErrorContext> {
1473        let mut iter = self.clone();
1474        iter.pos = 0;
1475        for attr in iter {
1476            if let Nl80211Attrs::Ie(val) = attr? {
1477                return Ok(val);
1478            }
1479        }
1480        Err(ErrorContext::new_missing(
1481            "Nl80211Attrs",
1482            "Ie",
1483            self.orig_loc,
1484            self.buf.as_ptr() as usize,
1485        ))
1486    }
1487    pub fn get_max_num_scan_ssids(&self) -> Result<u8, ErrorContext> {
1488        let mut iter = self.clone();
1489        iter.pos = 0;
1490        for attr in iter {
1491            if let Nl80211Attrs::MaxNumScanSsids(val) = attr? {
1492                return Ok(val);
1493            }
1494        }
1495        Err(ErrorContext::new_missing(
1496            "Nl80211Attrs",
1497            "MaxNumScanSsids",
1498            self.orig_loc,
1499            self.buf.as_ptr() as usize,
1500        ))
1501    }
1502    pub fn get_scan_frequencies(&self) -> Result<&'a [u8], ErrorContext> {
1503        let mut iter = self.clone();
1504        iter.pos = 0;
1505        for attr in iter {
1506            if let Nl80211Attrs::ScanFrequencies(val) = attr? {
1507                return Ok(val);
1508            }
1509        }
1510        Err(ErrorContext::new_missing(
1511            "Nl80211Attrs",
1512            "ScanFrequencies",
1513            self.orig_loc,
1514            self.buf.as_ptr() as usize,
1515        ))
1516    }
1517    pub fn get_scan_ssids(&self) -> Result<&'a [u8], ErrorContext> {
1518        let mut iter = self.clone();
1519        iter.pos = 0;
1520        for attr in iter {
1521            if let Nl80211Attrs::ScanSsids(val) = attr? {
1522                return Ok(val);
1523            }
1524        }
1525        Err(ErrorContext::new_missing(
1526            "Nl80211Attrs",
1527            "ScanSsids",
1528            self.orig_loc,
1529            self.buf.as_ptr() as usize,
1530        ))
1531    }
1532    pub fn get_generation(&self) -> Result<u32, ErrorContext> {
1533        let mut iter = self.clone();
1534        iter.pos = 0;
1535        for attr in iter {
1536            if let Nl80211Attrs::Generation(val) = attr? {
1537                return Ok(val);
1538            }
1539        }
1540        Err(ErrorContext::new_missing(
1541            "Nl80211Attrs",
1542            "Generation",
1543            self.orig_loc,
1544            self.buf.as_ptr() as usize,
1545        ))
1546    }
1547    pub fn get_bss(&self) -> Result<&'a [u8], ErrorContext> {
1548        let mut iter = self.clone();
1549        iter.pos = 0;
1550        for attr in iter {
1551            if let Nl80211Attrs::Bss(val) = attr? {
1552                return Ok(val);
1553            }
1554        }
1555        Err(ErrorContext::new_missing(
1556            "Nl80211Attrs",
1557            "Bss",
1558            self.orig_loc,
1559            self.buf.as_ptr() as usize,
1560        ))
1561    }
1562    pub fn get_reg_initiator(&self) -> Result<u8, ErrorContext> {
1563        let mut iter = self.clone();
1564        iter.pos = 0;
1565        for attr in iter {
1566            if let Nl80211Attrs::RegInitiator(val) = attr? {
1567                return Ok(val);
1568            }
1569        }
1570        Err(ErrorContext::new_missing(
1571            "Nl80211Attrs",
1572            "RegInitiator",
1573            self.orig_loc,
1574            self.buf.as_ptr() as usize,
1575        ))
1576    }
1577    pub fn get_reg_type(&self) -> Result<u8, ErrorContext> {
1578        let mut iter = self.clone();
1579        iter.pos = 0;
1580        for attr in iter {
1581            if let Nl80211Attrs::RegType(val) = attr? {
1582                return Ok(val);
1583            }
1584        }
1585        Err(ErrorContext::new_missing(
1586            "Nl80211Attrs",
1587            "RegType",
1588            self.orig_loc,
1589            self.buf.as_ptr() as usize,
1590        ))
1591    }
1592    #[doc = "Associated type: [`Commands`] (enum)"]
1593    pub fn get_supported_commands(
1594        &self,
1595    ) -> Result<ArrayIterable<IterableArrayU32<'a>, u32>, ErrorContext> {
1596        for attr in self.clone() {
1597            if let Nl80211Attrs::SupportedCommands(val) = attr? {
1598                return Ok(ArrayIterable::new(val));
1599            }
1600        }
1601        Err(ErrorContext::new_missing(
1602            "Nl80211Attrs",
1603            "SupportedCommands",
1604            self.orig_loc,
1605            self.buf.as_ptr() as usize,
1606        ))
1607    }
1608    pub fn get_frame(&self) -> Result<&'a [u8], ErrorContext> {
1609        let mut iter = self.clone();
1610        iter.pos = 0;
1611        for attr in iter {
1612            if let Nl80211Attrs::Frame(val) = attr? {
1613                return Ok(val);
1614            }
1615        }
1616        Err(ErrorContext::new_missing(
1617            "Nl80211Attrs",
1618            "Frame",
1619            self.orig_loc,
1620            self.buf.as_ptr() as usize,
1621        ))
1622    }
1623    pub fn get_ssid(&self) -> Result<&'a [u8], ErrorContext> {
1624        let mut iter = self.clone();
1625        iter.pos = 0;
1626        for attr in iter {
1627            if let Nl80211Attrs::Ssid(val) = attr? {
1628                return Ok(val);
1629            }
1630        }
1631        Err(ErrorContext::new_missing(
1632            "Nl80211Attrs",
1633            "Ssid",
1634            self.orig_loc,
1635            self.buf.as_ptr() as usize,
1636        ))
1637    }
1638    pub fn get_auth_type(&self) -> Result<u32, ErrorContext> {
1639        let mut iter = self.clone();
1640        iter.pos = 0;
1641        for attr in iter {
1642            if let Nl80211Attrs::AuthType(val) = attr? {
1643                return Ok(val);
1644            }
1645        }
1646        Err(ErrorContext::new_missing(
1647            "Nl80211Attrs",
1648            "AuthType",
1649            self.orig_loc,
1650            self.buf.as_ptr() as usize,
1651        ))
1652    }
1653    pub fn get_reason_code(&self) -> Result<u16, ErrorContext> {
1654        let mut iter = self.clone();
1655        iter.pos = 0;
1656        for attr in iter {
1657            if let Nl80211Attrs::ReasonCode(val) = attr? {
1658                return Ok(val);
1659            }
1660        }
1661        Err(ErrorContext::new_missing(
1662            "Nl80211Attrs",
1663            "ReasonCode",
1664            self.orig_loc,
1665            self.buf.as_ptr() as usize,
1666        ))
1667    }
1668    pub fn get_key_type(&self) -> Result<u32, ErrorContext> {
1669        let mut iter = self.clone();
1670        iter.pos = 0;
1671        for attr in iter {
1672            if let Nl80211Attrs::KeyType(val) = attr? {
1673                return Ok(val);
1674            }
1675        }
1676        Err(ErrorContext::new_missing(
1677            "Nl80211Attrs",
1678            "KeyType",
1679            self.orig_loc,
1680            self.buf.as_ptr() as usize,
1681        ))
1682    }
1683    pub fn get_max_scan_ie_len(&self) -> Result<u16, ErrorContext> {
1684        let mut iter = self.clone();
1685        iter.pos = 0;
1686        for attr in iter {
1687            if let Nl80211Attrs::MaxScanIeLen(val) = attr? {
1688                return Ok(val);
1689            }
1690        }
1691        Err(ErrorContext::new_missing(
1692            "Nl80211Attrs",
1693            "MaxScanIeLen",
1694            self.orig_loc,
1695            self.buf.as_ptr() as usize,
1696        ))
1697    }
1698    pub fn get_cipher_suites(&self) -> Result<&'a [u8], ErrorContext> {
1699        let mut iter = self.clone();
1700        iter.pos = 0;
1701        for attr in iter {
1702            if let Nl80211Attrs::CipherSuites(val) = attr? {
1703                return Ok(val);
1704            }
1705        }
1706        Err(ErrorContext::new_missing(
1707            "Nl80211Attrs",
1708            "CipherSuites",
1709            self.orig_loc,
1710            self.buf.as_ptr() as usize,
1711        ))
1712    }
1713    pub fn get_freq_before(&self) -> Result<&'a [u8], ErrorContext> {
1714        let mut iter = self.clone();
1715        iter.pos = 0;
1716        for attr in iter {
1717            if let Nl80211Attrs::FreqBefore(val) = attr? {
1718                return Ok(val);
1719            }
1720        }
1721        Err(ErrorContext::new_missing(
1722            "Nl80211Attrs",
1723            "FreqBefore",
1724            self.orig_loc,
1725            self.buf.as_ptr() as usize,
1726        ))
1727    }
1728    pub fn get_freq_after(&self) -> Result<&'a [u8], ErrorContext> {
1729        let mut iter = self.clone();
1730        iter.pos = 0;
1731        for attr in iter {
1732            if let Nl80211Attrs::FreqAfter(val) = attr? {
1733                return Ok(val);
1734            }
1735        }
1736        Err(ErrorContext::new_missing(
1737            "Nl80211Attrs",
1738            "FreqAfter",
1739            self.orig_loc,
1740            self.buf.as_ptr() as usize,
1741        ))
1742    }
1743    pub fn get_freq_fixed(&self) -> Result<(), ErrorContext> {
1744        let mut iter = self.clone();
1745        iter.pos = 0;
1746        for attr in iter {
1747            if let Nl80211Attrs::FreqFixed(val) = attr? {
1748                return Ok(val);
1749            }
1750        }
1751        Err(ErrorContext::new_missing(
1752            "Nl80211Attrs",
1753            "FreqFixed",
1754            self.orig_loc,
1755            self.buf.as_ptr() as usize,
1756        ))
1757    }
1758    pub fn get_wiphy_retry_short(&self) -> Result<u8, ErrorContext> {
1759        let mut iter = self.clone();
1760        iter.pos = 0;
1761        for attr in iter {
1762            if let Nl80211Attrs::WiphyRetryShort(val) = attr? {
1763                return Ok(val);
1764            }
1765        }
1766        Err(ErrorContext::new_missing(
1767            "Nl80211Attrs",
1768            "WiphyRetryShort",
1769            self.orig_loc,
1770            self.buf.as_ptr() as usize,
1771        ))
1772    }
1773    pub fn get_wiphy_retry_long(&self) -> Result<u8, ErrorContext> {
1774        let mut iter = self.clone();
1775        iter.pos = 0;
1776        for attr in iter {
1777            if let Nl80211Attrs::WiphyRetryLong(val) = attr? {
1778                return Ok(val);
1779            }
1780        }
1781        Err(ErrorContext::new_missing(
1782            "Nl80211Attrs",
1783            "WiphyRetryLong",
1784            self.orig_loc,
1785            self.buf.as_ptr() as usize,
1786        ))
1787    }
1788    pub fn get_wiphy_frag_threshold(&self) -> Result<u32, ErrorContext> {
1789        let mut iter = self.clone();
1790        iter.pos = 0;
1791        for attr in iter {
1792            if let Nl80211Attrs::WiphyFragThreshold(val) = attr? {
1793                return Ok(val);
1794            }
1795        }
1796        Err(ErrorContext::new_missing(
1797            "Nl80211Attrs",
1798            "WiphyFragThreshold",
1799            self.orig_loc,
1800            self.buf.as_ptr() as usize,
1801        ))
1802    }
1803    pub fn get_wiphy_rts_threshold(&self) -> Result<u32, ErrorContext> {
1804        let mut iter = self.clone();
1805        iter.pos = 0;
1806        for attr in iter {
1807            if let Nl80211Attrs::WiphyRtsThreshold(val) = attr? {
1808                return Ok(val);
1809            }
1810        }
1811        Err(ErrorContext::new_missing(
1812            "Nl80211Attrs",
1813            "WiphyRtsThreshold",
1814            self.orig_loc,
1815            self.buf.as_ptr() as usize,
1816        ))
1817    }
1818    pub fn get_timed_out(&self) -> Result<(), ErrorContext> {
1819        let mut iter = self.clone();
1820        iter.pos = 0;
1821        for attr in iter {
1822            if let Nl80211Attrs::TimedOut(val) = attr? {
1823                return Ok(val);
1824            }
1825        }
1826        Err(ErrorContext::new_missing(
1827            "Nl80211Attrs",
1828            "TimedOut",
1829            self.orig_loc,
1830            self.buf.as_ptr() as usize,
1831        ))
1832    }
1833    pub fn get_use_mfp(&self) -> Result<u32, ErrorContext> {
1834        let mut iter = self.clone();
1835        iter.pos = 0;
1836        for attr in iter {
1837            if let Nl80211Attrs::UseMfp(val) = attr? {
1838                return Ok(val);
1839            }
1840        }
1841        Err(ErrorContext::new_missing(
1842            "Nl80211Attrs",
1843            "UseMfp",
1844            self.orig_loc,
1845            self.buf.as_ptr() as usize,
1846        ))
1847    }
1848    pub fn get_sta_flags2(&self) -> Result<StaFlagUpdate, ErrorContext> {
1849        let mut iter = self.clone();
1850        iter.pos = 0;
1851        for attr in iter {
1852            if let Nl80211Attrs::StaFlags2(val) = attr? {
1853                return Ok(val);
1854            }
1855        }
1856        Err(ErrorContext::new_missing(
1857            "Nl80211Attrs",
1858            "StaFlags2",
1859            self.orig_loc,
1860            self.buf.as_ptr() as usize,
1861        ))
1862    }
1863    pub fn get_control_port(&self) -> Result<(), ErrorContext> {
1864        let mut iter = self.clone();
1865        iter.pos = 0;
1866        for attr in iter {
1867            if let Nl80211Attrs::ControlPort(val) = attr? {
1868                return Ok(val);
1869            }
1870        }
1871        Err(ErrorContext::new_missing(
1872            "Nl80211Attrs",
1873            "ControlPort",
1874            self.orig_loc,
1875            self.buf.as_ptr() as usize,
1876        ))
1877    }
1878    pub fn get_testdata(&self) -> Result<&'a [u8], ErrorContext> {
1879        let mut iter = self.clone();
1880        iter.pos = 0;
1881        for attr in iter {
1882            if let Nl80211Attrs::Testdata(val) = attr? {
1883                return Ok(val);
1884            }
1885        }
1886        Err(ErrorContext::new_missing(
1887            "Nl80211Attrs",
1888            "Testdata",
1889            self.orig_loc,
1890            self.buf.as_ptr() as usize,
1891        ))
1892    }
1893    pub fn get_privacy(&self) -> Result<(), ErrorContext> {
1894        let mut iter = self.clone();
1895        iter.pos = 0;
1896        for attr in iter {
1897            if let Nl80211Attrs::Privacy(val) = attr? {
1898                return Ok(val);
1899            }
1900        }
1901        Err(ErrorContext::new_missing(
1902            "Nl80211Attrs",
1903            "Privacy",
1904            self.orig_loc,
1905            self.buf.as_ptr() as usize,
1906        ))
1907    }
1908    pub fn get_disconnected_by_ap(&self) -> Result<(), ErrorContext> {
1909        let mut iter = self.clone();
1910        iter.pos = 0;
1911        for attr in iter {
1912            if let Nl80211Attrs::DisconnectedByAp(val) = attr? {
1913                return Ok(val);
1914            }
1915        }
1916        Err(ErrorContext::new_missing(
1917            "Nl80211Attrs",
1918            "DisconnectedByAp",
1919            self.orig_loc,
1920            self.buf.as_ptr() as usize,
1921        ))
1922    }
1923    pub fn get_status_code(&self) -> Result<u16, ErrorContext> {
1924        let mut iter = self.clone();
1925        iter.pos = 0;
1926        for attr in iter {
1927            if let Nl80211Attrs::StatusCode(val) = attr? {
1928                return Ok(val);
1929            }
1930        }
1931        Err(ErrorContext::new_missing(
1932            "Nl80211Attrs",
1933            "StatusCode",
1934            self.orig_loc,
1935            self.buf.as_ptr() as usize,
1936        ))
1937    }
1938    pub fn get_cipher_suites_pairwise(&self) -> Result<&'a [u8], ErrorContext> {
1939        let mut iter = self.clone();
1940        iter.pos = 0;
1941        for attr in iter {
1942            if let Nl80211Attrs::CipherSuitesPairwise(val) = attr? {
1943                return Ok(val);
1944            }
1945        }
1946        Err(ErrorContext::new_missing(
1947            "Nl80211Attrs",
1948            "CipherSuitesPairwise",
1949            self.orig_loc,
1950            self.buf.as_ptr() as usize,
1951        ))
1952    }
1953    pub fn get_cipher_suite_group(&self) -> Result<u32, ErrorContext> {
1954        let mut iter = self.clone();
1955        iter.pos = 0;
1956        for attr in iter {
1957            if let Nl80211Attrs::CipherSuiteGroup(val) = attr? {
1958                return Ok(val);
1959            }
1960        }
1961        Err(ErrorContext::new_missing(
1962            "Nl80211Attrs",
1963            "CipherSuiteGroup",
1964            self.orig_loc,
1965            self.buf.as_ptr() as usize,
1966        ))
1967    }
1968    pub fn get_wpa_versions(&self) -> Result<u32, ErrorContext> {
1969        let mut iter = self.clone();
1970        iter.pos = 0;
1971        for attr in iter {
1972            if let Nl80211Attrs::WpaVersions(val) = attr? {
1973                return Ok(val);
1974            }
1975        }
1976        Err(ErrorContext::new_missing(
1977            "Nl80211Attrs",
1978            "WpaVersions",
1979            self.orig_loc,
1980            self.buf.as_ptr() as usize,
1981        ))
1982    }
1983    pub fn get_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
1984        let mut iter = self.clone();
1985        iter.pos = 0;
1986        for attr in iter {
1987            if let Nl80211Attrs::AkmSuites(val) = attr? {
1988                return Ok(val);
1989            }
1990        }
1991        Err(ErrorContext::new_missing(
1992            "Nl80211Attrs",
1993            "AkmSuites",
1994            self.orig_loc,
1995            self.buf.as_ptr() as usize,
1996        ))
1997    }
1998    pub fn get_req_ie(&self) -> Result<&'a [u8], ErrorContext> {
1999        let mut iter = self.clone();
2000        iter.pos = 0;
2001        for attr in iter {
2002            if let Nl80211Attrs::ReqIe(val) = attr? {
2003                return Ok(val);
2004            }
2005        }
2006        Err(ErrorContext::new_missing(
2007            "Nl80211Attrs",
2008            "ReqIe",
2009            self.orig_loc,
2010            self.buf.as_ptr() as usize,
2011        ))
2012    }
2013    pub fn get_resp_ie(&self) -> Result<&'a [u8], ErrorContext> {
2014        let mut iter = self.clone();
2015        iter.pos = 0;
2016        for attr in iter {
2017            if let Nl80211Attrs::RespIe(val) = attr? {
2018                return Ok(val);
2019            }
2020        }
2021        Err(ErrorContext::new_missing(
2022            "Nl80211Attrs",
2023            "RespIe",
2024            self.orig_loc,
2025            self.buf.as_ptr() as usize,
2026        ))
2027    }
2028    pub fn get_prev_bssid(&self) -> Result<&'a [u8], ErrorContext> {
2029        let mut iter = self.clone();
2030        iter.pos = 0;
2031        for attr in iter {
2032            if let Nl80211Attrs::PrevBssid(val) = attr? {
2033                return Ok(val);
2034            }
2035        }
2036        Err(ErrorContext::new_missing(
2037            "Nl80211Attrs",
2038            "PrevBssid",
2039            self.orig_loc,
2040            self.buf.as_ptr() as usize,
2041        ))
2042    }
2043    pub fn get_key(&self) -> Result<&'a [u8], ErrorContext> {
2044        let mut iter = self.clone();
2045        iter.pos = 0;
2046        for attr in iter {
2047            if let Nl80211Attrs::Key(val) = attr? {
2048                return Ok(val);
2049            }
2050        }
2051        Err(ErrorContext::new_missing(
2052            "Nl80211Attrs",
2053            "Key",
2054            self.orig_loc,
2055            self.buf.as_ptr() as usize,
2056        ))
2057    }
2058    pub fn get_keys(&self) -> Result<&'a [u8], ErrorContext> {
2059        let mut iter = self.clone();
2060        iter.pos = 0;
2061        for attr in iter {
2062            if let Nl80211Attrs::Keys(val) = attr? {
2063                return Ok(val);
2064            }
2065        }
2066        Err(ErrorContext::new_missing(
2067            "Nl80211Attrs",
2068            "Keys",
2069            self.orig_loc,
2070            self.buf.as_ptr() as usize,
2071        ))
2072    }
2073    pub fn get_pid(&self) -> Result<u32, ErrorContext> {
2074        let mut iter = self.clone();
2075        iter.pos = 0;
2076        for attr in iter {
2077            if let Nl80211Attrs::Pid(val) = attr? {
2078                return Ok(val);
2079            }
2080        }
2081        Err(ErrorContext::new_missing(
2082            "Nl80211Attrs",
2083            "Pid",
2084            self.orig_loc,
2085            self.buf.as_ptr() as usize,
2086        ))
2087    }
2088    pub fn get_4addr(&self) -> Result<u8, ErrorContext> {
2089        let mut iter = self.clone();
2090        iter.pos = 0;
2091        for attr in iter {
2092            if let Nl80211Attrs::_4addr(val) = attr? {
2093                return Ok(val);
2094            }
2095        }
2096        Err(ErrorContext::new_missing(
2097            "Nl80211Attrs",
2098            "4addr",
2099            self.orig_loc,
2100            self.buf.as_ptr() as usize,
2101        ))
2102    }
2103    pub fn get_survey_info(&self) -> Result<&'a [u8], ErrorContext> {
2104        let mut iter = self.clone();
2105        iter.pos = 0;
2106        for attr in iter {
2107            if let Nl80211Attrs::SurveyInfo(val) = attr? {
2108                return Ok(val);
2109            }
2110        }
2111        Err(ErrorContext::new_missing(
2112            "Nl80211Attrs",
2113            "SurveyInfo",
2114            self.orig_loc,
2115            self.buf.as_ptr() as usize,
2116        ))
2117    }
2118    pub fn get_pmkid(&self) -> Result<&'a [u8], ErrorContext> {
2119        let mut iter = self.clone();
2120        iter.pos = 0;
2121        for attr in iter {
2122            if let Nl80211Attrs::Pmkid(val) = attr? {
2123                return Ok(val);
2124            }
2125        }
2126        Err(ErrorContext::new_missing(
2127            "Nl80211Attrs",
2128            "Pmkid",
2129            self.orig_loc,
2130            self.buf.as_ptr() as usize,
2131        ))
2132    }
2133    pub fn get_max_num_pmkids(&self) -> Result<u8, ErrorContext> {
2134        let mut iter = self.clone();
2135        iter.pos = 0;
2136        for attr in iter {
2137            if let Nl80211Attrs::MaxNumPmkids(val) = attr? {
2138                return Ok(val);
2139            }
2140        }
2141        Err(ErrorContext::new_missing(
2142            "Nl80211Attrs",
2143            "MaxNumPmkids",
2144            self.orig_loc,
2145            self.buf.as_ptr() as usize,
2146        ))
2147    }
2148    pub fn get_duration(&self) -> Result<u32, ErrorContext> {
2149        let mut iter = self.clone();
2150        iter.pos = 0;
2151        for attr in iter {
2152            if let Nl80211Attrs::Duration(val) = attr? {
2153                return Ok(val);
2154            }
2155        }
2156        Err(ErrorContext::new_missing(
2157            "Nl80211Attrs",
2158            "Duration",
2159            self.orig_loc,
2160            self.buf.as_ptr() as usize,
2161        ))
2162    }
2163    pub fn get_cookie(&self) -> Result<u64, ErrorContext> {
2164        let mut iter = self.clone();
2165        iter.pos = 0;
2166        for attr in iter {
2167            if let Nl80211Attrs::Cookie(val) = attr? {
2168                return Ok(val);
2169            }
2170        }
2171        Err(ErrorContext::new_missing(
2172            "Nl80211Attrs",
2173            "Cookie",
2174            self.orig_loc,
2175            self.buf.as_ptr() as usize,
2176        ))
2177    }
2178    pub fn get_wiphy_coverage_class(&self) -> Result<u8, ErrorContext> {
2179        let mut iter = self.clone();
2180        iter.pos = 0;
2181        for attr in iter {
2182            if let Nl80211Attrs::WiphyCoverageClass(val) = attr? {
2183                return Ok(val);
2184            }
2185        }
2186        Err(ErrorContext::new_missing(
2187            "Nl80211Attrs",
2188            "WiphyCoverageClass",
2189            self.orig_loc,
2190            self.buf.as_ptr() as usize,
2191        ))
2192    }
2193    pub fn get_tx_rates(&self) -> Result<&'a [u8], ErrorContext> {
2194        let mut iter = self.clone();
2195        iter.pos = 0;
2196        for attr in iter {
2197            if let Nl80211Attrs::TxRates(val) = attr? {
2198                return Ok(val);
2199            }
2200        }
2201        Err(ErrorContext::new_missing(
2202            "Nl80211Attrs",
2203            "TxRates",
2204            self.orig_loc,
2205            self.buf.as_ptr() as usize,
2206        ))
2207    }
2208    pub fn get_frame_match(&self) -> Result<&'a [u8], ErrorContext> {
2209        let mut iter = self.clone();
2210        iter.pos = 0;
2211        for attr in iter {
2212            if let Nl80211Attrs::FrameMatch(val) = attr? {
2213                return Ok(val);
2214            }
2215        }
2216        Err(ErrorContext::new_missing(
2217            "Nl80211Attrs",
2218            "FrameMatch",
2219            self.orig_loc,
2220            self.buf.as_ptr() as usize,
2221        ))
2222    }
2223    pub fn get_ack(&self) -> Result<(), ErrorContext> {
2224        let mut iter = self.clone();
2225        iter.pos = 0;
2226        for attr in iter {
2227            if let Nl80211Attrs::Ack(val) = attr? {
2228                return Ok(val);
2229            }
2230        }
2231        Err(ErrorContext::new_missing(
2232            "Nl80211Attrs",
2233            "Ack",
2234            self.orig_loc,
2235            self.buf.as_ptr() as usize,
2236        ))
2237    }
2238    pub fn get_ps_state(&self) -> Result<u32, ErrorContext> {
2239        let mut iter = self.clone();
2240        iter.pos = 0;
2241        for attr in iter {
2242            if let Nl80211Attrs::PsState(val) = attr? {
2243                return Ok(val);
2244            }
2245        }
2246        Err(ErrorContext::new_missing(
2247            "Nl80211Attrs",
2248            "PsState",
2249            self.orig_loc,
2250            self.buf.as_ptr() as usize,
2251        ))
2252    }
2253    pub fn get_cqm(&self) -> Result<&'a [u8], ErrorContext> {
2254        let mut iter = self.clone();
2255        iter.pos = 0;
2256        for attr in iter {
2257            if let Nl80211Attrs::Cqm(val) = attr? {
2258                return Ok(val);
2259            }
2260        }
2261        Err(ErrorContext::new_missing(
2262            "Nl80211Attrs",
2263            "Cqm",
2264            self.orig_loc,
2265            self.buf.as_ptr() as usize,
2266        ))
2267    }
2268    pub fn get_local_state_change(&self) -> Result<(), ErrorContext> {
2269        let mut iter = self.clone();
2270        iter.pos = 0;
2271        for attr in iter {
2272            if let Nl80211Attrs::LocalStateChange(val) = attr? {
2273                return Ok(val);
2274            }
2275        }
2276        Err(ErrorContext::new_missing(
2277            "Nl80211Attrs",
2278            "LocalStateChange",
2279            self.orig_loc,
2280            self.buf.as_ptr() as usize,
2281        ))
2282    }
2283    pub fn get_ap_isolate(&self) -> Result<u8, ErrorContext> {
2284        let mut iter = self.clone();
2285        iter.pos = 0;
2286        for attr in iter {
2287            if let Nl80211Attrs::ApIsolate(val) = attr? {
2288                return Ok(val);
2289            }
2290        }
2291        Err(ErrorContext::new_missing(
2292            "Nl80211Attrs",
2293            "ApIsolate",
2294            self.orig_loc,
2295            self.buf.as_ptr() as usize,
2296        ))
2297    }
2298    pub fn get_wiphy_tx_power_setting(&self) -> Result<u32, ErrorContext> {
2299        let mut iter = self.clone();
2300        iter.pos = 0;
2301        for attr in iter {
2302            if let Nl80211Attrs::WiphyTxPowerSetting(val) = attr? {
2303                return Ok(val);
2304            }
2305        }
2306        Err(ErrorContext::new_missing(
2307            "Nl80211Attrs",
2308            "WiphyTxPowerSetting",
2309            self.orig_loc,
2310            self.buf.as_ptr() as usize,
2311        ))
2312    }
2313    pub fn get_wiphy_tx_power_level(&self) -> Result<u32, ErrorContext> {
2314        let mut iter = self.clone();
2315        iter.pos = 0;
2316        for attr in iter {
2317            if let Nl80211Attrs::WiphyTxPowerLevel(val) = attr? {
2318                return Ok(val);
2319            }
2320        }
2321        Err(ErrorContext::new_missing(
2322            "Nl80211Attrs",
2323            "WiphyTxPowerLevel",
2324            self.orig_loc,
2325            self.buf.as_ptr() as usize,
2326        ))
2327    }
2328    pub fn get_tx_frame_types(&self) -> Result<IterableIftypeAttrs<'a>, ErrorContext> {
2329        let mut iter = self.clone();
2330        iter.pos = 0;
2331        for attr in iter {
2332            if let Nl80211Attrs::TxFrameTypes(val) = attr? {
2333                return Ok(val);
2334            }
2335        }
2336        Err(ErrorContext::new_missing(
2337            "Nl80211Attrs",
2338            "TxFrameTypes",
2339            self.orig_loc,
2340            self.buf.as_ptr() as usize,
2341        ))
2342    }
2343    pub fn get_rx_frame_types(&self) -> Result<IterableIftypeAttrs<'a>, ErrorContext> {
2344        let mut iter = self.clone();
2345        iter.pos = 0;
2346        for attr in iter {
2347            if let Nl80211Attrs::RxFrameTypes(val) = attr? {
2348                return Ok(val);
2349            }
2350        }
2351        Err(ErrorContext::new_missing(
2352            "Nl80211Attrs",
2353            "RxFrameTypes",
2354            self.orig_loc,
2355            self.buf.as_ptr() as usize,
2356        ))
2357    }
2358    pub fn get_frame_type(&self) -> Result<u16, ErrorContext> {
2359        let mut iter = self.clone();
2360        iter.pos = 0;
2361        for attr in iter {
2362            if let Nl80211Attrs::FrameType(val) = attr? {
2363                return Ok(val);
2364            }
2365        }
2366        Err(ErrorContext::new_missing(
2367            "Nl80211Attrs",
2368            "FrameType",
2369            self.orig_loc,
2370            self.buf.as_ptr() as usize,
2371        ))
2372    }
2373    pub fn get_control_port_ethertype(&self) -> Result<(), ErrorContext> {
2374        let mut iter = self.clone();
2375        iter.pos = 0;
2376        for attr in iter {
2377            if let Nl80211Attrs::ControlPortEthertype(val) = attr? {
2378                return Ok(val);
2379            }
2380        }
2381        Err(ErrorContext::new_missing(
2382            "Nl80211Attrs",
2383            "ControlPortEthertype",
2384            self.orig_loc,
2385            self.buf.as_ptr() as usize,
2386        ))
2387    }
2388    pub fn get_control_port_no_encrypt(&self) -> Result<(), ErrorContext> {
2389        let mut iter = self.clone();
2390        iter.pos = 0;
2391        for attr in iter {
2392            if let Nl80211Attrs::ControlPortNoEncrypt(val) = attr? {
2393                return Ok(val);
2394            }
2395        }
2396        Err(ErrorContext::new_missing(
2397            "Nl80211Attrs",
2398            "ControlPortNoEncrypt",
2399            self.orig_loc,
2400            self.buf.as_ptr() as usize,
2401        ))
2402    }
2403    pub fn get_support_ibss_rsn(&self) -> Result<(), ErrorContext> {
2404        let mut iter = self.clone();
2405        iter.pos = 0;
2406        for attr in iter {
2407            if let Nl80211Attrs::SupportIbssRsn(val) = attr? {
2408                return Ok(val);
2409            }
2410        }
2411        Err(ErrorContext::new_missing(
2412            "Nl80211Attrs",
2413            "SupportIbssRsn",
2414            self.orig_loc,
2415            self.buf.as_ptr() as usize,
2416        ))
2417    }
2418    pub fn get_wiphy_antenna_tx(&self) -> Result<u32, ErrorContext> {
2419        let mut iter = self.clone();
2420        iter.pos = 0;
2421        for attr in iter {
2422            if let Nl80211Attrs::WiphyAntennaTx(val) = attr? {
2423                return Ok(val);
2424            }
2425        }
2426        Err(ErrorContext::new_missing(
2427            "Nl80211Attrs",
2428            "WiphyAntennaTx",
2429            self.orig_loc,
2430            self.buf.as_ptr() as usize,
2431        ))
2432    }
2433    pub fn get_wiphy_antenna_rx(&self) -> Result<u32, ErrorContext> {
2434        let mut iter = self.clone();
2435        iter.pos = 0;
2436        for attr in iter {
2437            if let Nl80211Attrs::WiphyAntennaRx(val) = attr? {
2438                return Ok(val);
2439            }
2440        }
2441        Err(ErrorContext::new_missing(
2442            "Nl80211Attrs",
2443            "WiphyAntennaRx",
2444            self.orig_loc,
2445            self.buf.as_ptr() as usize,
2446        ))
2447    }
2448    pub fn get_mcast_rate(&self) -> Result<u32, ErrorContext> {
2449        let mut iter = self.clone();
2450        iter.pos = 0;
2451        for attr in iter {
2452            if let Nl80211Attrs::McastRate(val) = attr? {
2453                return Ok(val);
2454            }
2455        }
2456        Err(ErrorContext::new_missing(
2457            "Nl80211Attrs",
2458            "McastRate",
2459            self.orig_loc,
2460            self.buf.as_ptr() as usize,
2461        ))
2462    }
2463    pub fn get_offchannel_tx_ok(&self) -> Result<(), ErrorContext> {
2464        let mut iter = self.clone();
2465        iter.pos = 0;
2466        for attr in iter {
2467            if let Nl80211Attrs::OffchannelTxOk(val) = attr? {
2468                return Ok(val);
2469            }
2470        }
2471        Err(ErrorContext::new_missing(
2472            "Nl80211Attrs",
2473            "OffchannelTxOk",
2474            self.orig_loc,
2475            self.buf.as_ptr() as usize,
2476        ))
2477    }
2478    pub fn get_bss_ht_opmode(&self) -> Result<u16, ErrorContext> {
2479        let mut iter = self.clone();
2480        iter.pos = 0;
2481        for attr in iter {
2482            if let Nl80211Attrs::BssHtOpmode(val) = attr? {
2483                return Ok(val);
2484            }
2485        }
2486        Err(ErrorContext::new_missing(
2487            "Nl80211Attrs",
2488            "BssHtOpmode",
2489            self.orig_loc,
2490            self.buf.as_ptr() as usize,
2491        ))
2492    }
2493    pub fn get_key_default_types(&self) -> Result<&'a [u8], ErrorContext> {
2494        let mut iter = self.clone();
2495        iter.pos = 0;
2496        for attr in iter {
2497            if let Nl80211Attrs::KeyDefaultTypes(val) = attr? {
2498                return Ok(val);
2499            }
2500        }
2501        Err(ErrorContext::new_missing(
2502            "Nl80211Attrs",
2503            "KeyDefaultTypes",
2504            self.orig_loc,
2505            self.buf.as_ptr() as usize,
2506        ))
2507    }
2508    pub fn get_max_remain_on_channel_duration(&self) -> Result<u32, ErrorContext> {
2509        let mut iter = self.clone();
2510        iter.pos = 0;
2511        for attr in iter {
2512            if let Nl80211Attrs::MaxRemainOnChannelDuration(val) = attr? {
2513                return Ok(val);
2514            }
2515        }
2516        Err(ErrorContext::new_missing(
2517            "Nl80211Attrs",
2518            "MaxRemainOnChannelDuration",
2519            self.orig_loc,
2520            self.buf.as_ptr() as usize,
2521        ))
2522    }
2523    pub fn get_mesh_setup(&self) -> Result<&'a [u8], ErrorContext> {
2524        let mut iter = self.clone();
2525        iter.pos = 0;
2526        for attr in iter {
2527            if let Nl80211Attrs::MeshSetup(val) = attr? {
2528                return Ok(val);
2529            }
2530        }
2531        Err(ErrorContext::new_missing(
2532            "Nl80211Attrs",
2533            "MeshSetup",
2534            self.orig_loc,
2535            self.buf.as_ptr() as usize,
2536        ))
2537    }
2538    pub fn get_wiphy_antenna_avail_tx(&self) -> Result<u32, ErrorContext> {
2539        let mut iter = self.clone();
2540        iter.pos = 0;
2541        for attr in iter {
2542            if let Nl80211Attrs::WiphyAntennaAvailTx(val) = attr? {
2543                return Ok(val);
2544            }
2545        }
2546        Err(ErrorContext::new_missing(
2547            "Nl80211Attrs",
2548            "WiphyAntennaAvailTx",
2549            self.orig_loc,
2550            self.buf.as_ptr() as usize,
2551        ))
2552    }
2553    pub fn get_wiphy_antenna_avail_rx(&self) -> Result<u32, ErrorContext> {
2554        let mut iter = self.clone();
2555        iter.pos = 0;
2556        for attr in iter {
2557            if let Nl80211Attrs::WiphyAntennaAvailRx(val) = attr? {
2558                return Ok(val);
2559            }
2560        }
2561        Err(ErrorContext::new_missing(
2562            "Nl80211Attrs",
2563            "WiphyAntennaAvailRx",
2564            self.orig_loc,
2565            self.buf.as_ptr() as usize,
2566        ))
2567    }
2568    pub fn get_support_mesh_auth(&self) -> Result<(), ErrorContext> {
2569        let mut iter = self.clone();
2570        iter.pos = 0;
2571        for attr in iter {
2572            if let Nl80211Attrs::SupportMeshAuth(val) = attr? {
2573                return Ok(val);
2574            }
2575        }
2576        Err(ErrorContext::new_missing(
2577            "Nl80211Attrs",
2578            "SupportMeshAuth",
2579            self.orig_loc,
2580            self.buf.as_ptr() as usize,
2581        ))
2582    }
2583    pub fn get_sta_plink_state(&self) -> Result<u8, ErrorContext> {
2584        let mut iter = self.clone();
2585        iter.pos = 0;
2586        for attr in iter {
2587            if let Nl80211Attrs::StaPlinkState(val) = attr? {
2588                return Ok(val);
2589            }
2590        }
2591        Err(ErrorContext::new_missing(
2592            "Nl80211Attrs",
2593            "StaPlinkState",
2594            self.orig_loc,
2595            self.buf.as_ptr() as usize,
2596        ))
2597    }
2598    pub fn get_wowlan_triggers(&self) -> Result<&'a [u8], ErrorContext> {
2599        let mut iter = self.clone();
2600        iter.pos = 0;
2601        for attr in iter {
2602            if let Nl80211Attrs::WowlanTriggers(val) = attr? {
2603                return Ok(val);
2604            }
2605        }
2606        Err(ErrorContext::new_missing(
2607            "Nl80211Attrs",
2608            "WowlanTriggers",
2609            self.orig_loc,
2610            self.buf.as_ptr() as usize,
2611        ))
2612    }
2613    pub fn get_wowlan_triggers_supported(
2614        &self,
2615    ) -> Result<IterableWowlanTriggersAttrs<'a>, ErrorContext> {
2616        let mut iter = self.clone();
2617        iter.pos = 0;
2618        for attr in iter {
2619            if let Nl80211Attrs::WowlanTriggersSupported(val) = attr? {
2620                return Ok(val);
2621            }
2622        }
2623        Err(ErrorContext::new_missing(
2624            "Nl80211Attrs",
2625            "WowlanTriggersSupported",
2626            self.orig_loc,
2627            self.buf.as_ptr() as usize,
2628        ))
2629    }
2630    pub fn get_sched_scan_interval(&self) -> Result<u32, ErrorContext> {
2631        let mut iter = self.clone();
2632        iter.pos = 0;
2633        for attr in iter {
2634            if let Nl80211Attrs::SchedScanInterval(val) = attr? {
2635                return Ok(val);
2636            }
2637        }
2638        Err(ErrorContext::new_missing(
2639            "Nl80211Attrs",
2640            "SchedScanInterval",
2641            self.orig_loc,
2642            self.buf.as_ptr() as usize,
2643        ))
2644    }
2645    pub fn get_interface_combinations(
2646        &self,
2647    ) -> Result<
2648        ArrayIterable<
2649            IterableArrayIfCombinationAttributes<'a>,
2650            IterableIfCombinationAttributes<'a>,
2651        >,
2652        ErrorContext,
2653    > {
2654        for attr in self.clone() {
2655            if let Nl80211Attrs::InterfaceCombinations(val) = attr? {
2656                return Ok(ArrayIterable::new(val));
2657            }
2658        }
2659        Err(ErrorContext::new_missing(
2660            "Nl80211Attrs",
2661            "InterfaceCombinations",
2662            self.orig_loc,
2663            self.buf.as_ptr() as usize,
2664        ))
2665    }
2666    pub fn get_software_iftypes(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
2667        let mut iter = self.clone();
2668        iter.pos = 0;
2669        for attr in iter {
2670            if let Nl80211Attrs::SoftwareIftypes(val) = attr? {
2671                return Ok(val);
2672            }
2673        }
2674        Err(ErrorContext::new_missing(
2675            "Nl80211Attrs",
2676            "SoftwareIftypes",
2677            self.orig_loc,
2678            self.buf.as_ptr() as usize,
2679        ))
2680    }
2681    pub fn get_rekey_data(&self) -> Result<&'a [u8], ErrorContext> {
2682        let mut iter = self.clone();
2683        iter.pos = 0;
2684        for attr in iter {
2685            if let Nl80211Attrs::RekeyData(val) = attr? {
2686                return Ok(val);
2687            }
2688        }
2689        Err(ErrorContext::new_missing(
2690            "Nl80211Attrs",
2691            "RekeyData",
2692            self.orig_loc,
2693            self.buf.as_ptr() as usize,
2694        ))
2695    }
2696    pub fn get_max_num_sched_scan_ssids(&self) -> Result<u8, ErrorContext> {
2697        let mut iter = self.clone();
2698        iter.pos = 0;
2699        for attr in iter {
2700            if let Nl80211Attrs::MaxNumSchedScanSsids(val) = attr? {
2701                return Ok(val);
2702            }
2703        }
2704        Err(ErrorContext::new_missing(
2705            "Nl80211Attrs",
2706            "MaxNumSchedScanSsids",
2707            self.orig_loc,
2708            self.buf.as_ptr() as usize,
2709        ))
2710    }
2711    pub fn get_max_sched_scan_ie_len(&self) -> Result<u16, ErrorContext> {
2712        let mut iter = self.clone();
2713        iter.pos = 0;
2714        for attr in iter {
2715            if let Nl80211Attrs::MaxSchedScanIeLen(val) = attr? {
2716                return Ok(val);
2717            }
2718        }
2719        Err(ErrorContext::new_missing(
2720            "Nl80211Attrs",
2721            "MaxSchedScanIeLen",
2722            self.orig_loc,
2723            self.buf.as_ptr() as usize,
2724        ))
2725    }
2726    pub fn get_scan_supp_rates(&self) -> Result<&'a [u8], ErrorContext> {
2727        let mut iter = self.clone();
2728        iter.pos = 0;
2729        for attr in iter {
2730            if let Nl80211Attrs::ScanSuppRates(val) = attr? {
2731                return Ok(val);
2732            }
2733        }
2734        Err(ErrorContext::new_missing(
2735            "Nl80211Attrs",
2736            "ScanSuppRates",
2737            self.orig_loc,
2738            self.buf.as_ptr() as usize,
2739        ))
2740    }
2741    pub fn get_hidden_ssid(&self) -> Result<u32, ErrorContext> {
2742        let mut iter = self.clone();
2743        iter.pos = 0;
2744        for attr in iter {
2745            if let Nl80211Attrs::HiddenSsid(val) = attr? {
2746                return Ok(val);
2747            }
2748        }
2749        Err(ErrorContext::new_missing(
2750            "Nl80211Attrs",
2751            "HiddenSsid",
2752            self.orig_loc,
2753            self.buf.as_ptr() as usize,
2754        ))
2755    }
2756    pub fn get_ie_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
2757        let mut iter = self.clone();
2758        iter.pos = 0;
2759        for attr in iter {
2760            if let Nl80211Attrs::IeProbeResp(val) = attr? {
2761                return Ok(val);
2762            }
2763        }
2764        Err(ErrorContext::new_missing(
2765            "Nl80211Attrs",
2766            "IeProbeResp",
2767            self.orig_loc,
2768            self.buf.as_ptr() as usize,
2769        ))
2770    }
2771    pub fn get_ie_assoc_resp(&self) -> Result<&'a [u8], ErrorContext> {
2772        let mut iter = self.clone();
2773        iter.pos = 0;
2774        for attr in iter {
2775            if let Nl80211Attrs::IeAssocResp(val) = attr? {
2776                return Ok(val);
2777            }
2778        }
2779        Err(ErrorContext::new_missing(
2780            "Nl80211Attrs",
2781            "IeAssocResp",
2782            self.orig_loc,
2783            self.buf.as_ptr() as usize,
2784        ))
2785    }
2786    pub fn get_sta_wme(&self) -> Result<&'a [u8], ErrorContext> {
2787        let mut iter = self.clone();
2788        iter.pos = 0;
2789        for attr in iter {
2790            if let Nl80211Attrs::StaWme(val) = attr? {
2791                return Ok(val);
2792            }
2793        }
2794        Err(ErrorContext::new_missing(
2795            "Nl80211Attrs",
2796            "StaWme",
2797            self.orig_loc,
2798            self.buf.as_ptr() as usize,
2799        ))
2800    }
2801    pub fn get_support_ap_uapsd(&self) -> Result<(), ErrorContext> {
2802        let mut iter = self.clone();
2803        iter.pos = 0;
2804        for attr in iter {
2805            if let Nl80211Attrs::SupportApUapsd(val) = attr? {
2806                return Ok(val);
2807            }
2808        }
2809        Err(ErrorContext::new_missing(
2810            "Nl80211Attrs",
2811            "SupportApUapsd",
2812            self.orig_loc,
2813            self.buf.as_ptr() as usize,
2814        ))
2815    }
2816    pub fn get_roam_support(&self) -> Result<(), ErrorContext> {
2817        let mut iter = self.clone();
2818        iter.pos = 0;
2819        for attr in iter {
2820            if let Nl80211Attrs::RoamSupport(val) = attr? {
2821                return Ok(val);
2822            }
2823        }
2824        Err(ErrorContext::new_missing(
2825            "Nl80211Attrs",
2826            "RoamSupport",
2827            self.orig_loc,
2828            self.buf.as_ptr() as usize,
2829        ))
2830    }
2831    pub fn get_sched_scan_match(&self) -> Result<&'a [u8], ErrorContext> {
2832        let mut iter = self.clone();
2833        iter.pos = 0;
2834        for attr in iter {
2835            if let Nl80211Attrs::SchedScanMatch(val) = attr? {
2836                return Ok(val);
2837            }
2838        }
2839        Err(ErrorContext::new_missing(
2840            "Nl80211Attrs",
2841            "SchedScanMatch",
2842            self.orig_loc,
2843            self.buf.as_ptr() as usize,
2844        ))
2845    }
2846    pub fn get_max_match_sets(&self) -> Result<u8, ErrorContext> {
2847        let mut iter = self.clone();
2848        iter.pos = 0;
2849        for attr in iter {
2850            if let Nl80211Attrs::MaxMatchSets(val) = attr? {
2851                return Ok(val);
2852            }
2853        }
2854        Err(ErrorContext::new_missing(
2855            "Nl80211Attrs",
2856            "MaxMatchSets",
2857            self.orig_loc,
2858            self.buf.as_ptr() as usize,
2859        ))
2860    }
2861    pub fn get_pmksa_candidate(&self) -> Result<&'a [u8], ErrorContext> {
2862        let mut iter = self.clone();
2863        iter.pos = 0;
2864        for attr in iter {
2865            if let Nl80211Attrs::PmksaCandidate(val) = attr? {
2866                return Ok(val);
2867            }
2868        }
2869        Err(ErrorContext::new_missing(
2870            "Nl80211Attrs",
2871            "PmksaCandidate",
2872            self.orig_loc,
2873            self.buf.as_ptr() as usize,
2874        ))
2875    }
2876    pub fn get_tx_no_cck_rate(&self) -> Result<(), ErrorContext> {
2877        let mut iter = self.clone();
2878        iter.pos = 0;
2879        for attr in iter {
2880            if let Nl80211Attrs::TxNoCckRate(val) = attr? {
2881                return Ok(val);
2882            }
2883        }
2884        Err(ErrorContext::new_missing(
2885            "Nl80211Attrs",
2886            "TxNoCckRate",
2887            self.orig_loc,
2888            self.buf.as_ptr() as usize,
2889        ))
2890    }
2891    pub fn get_tdls_action(&self) -> Result<u8, ErrorContext> {
2892        let mut iter = self.clone();
2893        iter.pos = 0;
2894        for attr in iter {
2895            if let Nl80211Attrs::TdlsAction(val) = attr? {
2896                return Ok(val);
2897            }
2898        }
2899        Err(ErrorContext::new_missing(
2900            "Nl80211Attrs",
2901            "TdlsAction",
2902            self.orig_loc,
2903            self.buf.as_ptr() as usize,
2904        ))
2905    }
2906    pub fn get_tdls_dialog_token(&self) -> Result<u8, ErrorContext> {
2907        let mut iter = self.clone();
2908        iter.pos = 0;
2909        for attr in iter {
2910            if let Nl80211Attrs::TdlsDialogToken(val) = attr? {
2911                return Ok(val);
2912            }
2913        }
2914        Err(ErrorContext::new_missing(
2915            "Nl80211Attrs",
2916            "TdlsDialogToken",
2917            self.orig_loc,
2918            self.buf.as_ptr() as usize,
2919        ))
2920    }
2921    pub fn get_tdls_operation(&self) -> Result<u8, ErrorContext> {
2922        let mut iter = self.clone();
2923        iter.pos = 0;
2924        for attr in iter {
2925            if let Nl80211Attrs::TdlsOperation(val) = attr? {
2926                return Ok(val);
2927            }
2928        }
2929        Err(ErrorContext::new_missing(
2930            "Nl80211Attrs",
2931            "TdlsOperation",
2932            self.orig_loc,
2933            self.buf.as_ptr() as usize,
2934        ))
2935    }
2936    pub fn get_tdls_support(&self) -> Result<(), ErrorContext> {
2937        let mut iter = self.clone();
2938        iter.pos = 0;
2939        for attr in iter {
2940            if let Nl80211Attrs::TdlsSupport(val) = attr? {
2941                return Ok(val);
2942            }
2943        }
2944        Err(ErrorContext::new_missing(
2945            "Nl80211Attrs",
2946            "TdlsSupport",
2947            self.orig_loc,
2948            self.buf.as_ptr() as usize,
2949        ))
2950    }
2951    pub fn get_tdls_external_setup(&self) -> Result<(), ErrorContext> {
2952        let mut iter = self.clone();
2953        iter.pos = 0;
2954        for attr in iter {
2955            if let Nl80211Attrs::TdlsExternalSetup(val) = attr? {
2956                return Ok(val);
2957            }
2958        }
2959        Err(ErrorContext::new_missing(
2960            "Nl80211Attrs",
2961            "TdlsExternalSetup",
2962            self.orig_loc,
2963            self.buf.as_ptr() as usize,
2964        ))
2965    }
2966    pub fn get_device_ap_sme(&self) -> Result<u32, ErrorContext> {
2967        let mut iter = self.clone();
2968        iter.pos = 0;
2969        for attr in iter {
2970            if let Nl80211Attrs::DeviceApSme(val) = attr? {
2971                return Ok(val);
2972            }
2973        }
2974        Err(ErrorContext::new_missing(
2975            "Nl80211Attrs",
2976            "DeviceApSme",
2977            self.orig_loc,
2978            self.buf.as_ptr() as usize,
2979        ))
2980    }
2981    pub fn get_dont_wait_for_ack(&self) -> Result<(), ErrorContext> {
2982        let mut iter = self.clone();
2983        iter.pos = 0;
2984        for attr in iter {
2985            if let Nl80211Attrs::DontWaitForAck(val) = attr? {
2986                return Ok(val);
2987            }
2988        }
2989        Err(ErrorContext::new_missing(
2990            "Nl80211Attrs",
2991            "DontWaitForAck",
2992            self.orig_loc,
2993            self.buf.as_ptr() as usize,
2994        ))
2995    }
2996    #[doc = "Associated type: [`FeatureFlags`] (1 bit per enumeration)"]
2997    pub fn get_feature_flags(&self) -> Result<u32, ErrorContext> {
2998        let mut iter = self.clone();
2999        iter.pos = 0;
3000        for attr in iter {
3001            if let Nl80211Attrs::FeatureFlags(val) = attr? {
3002                return Ok(val);
3003            }
3004        }
3005        Err(ErrorContext::new_missing(
3006            "Nl80211Attrs",
3007            "FeatureFlags",
3008            self.orig_loc,
3009            self.buf.as_ptr() as usize,
3010        ))
3011    }
3012    pub fn get_probe_resp_offload(&self) -> Result<u32, ErrorContext> {
3013        let mut iter = self.clone();
3014        iter.pos = 0;
3015        for attr in iter {
3016            if let Nl80211Attrs::ProbeRespOffload(val) = attr? {
3017                return Ok(val);
3018            }
3019        }
3020        Err(ErrorContext::new_missing(
3021            "Nl80211Attrs",
3022            "ProbeRespOffload",
3023            self.orig_loc,
3024            self.buf.as_ptr() as usize,
3025        ))
3026    }
3027    pub fn get_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
3028        let mut iter = self.clone();
3029        iter.pos = 0;
3030        for attr in iter {
3031            if let Nl80211Attrs::ProbeResp(val) = attr? {
3032                return Ok(val);
3033            }
3034        }
3035        Err(ErrorContext::new_missing(
3036            "Nl80211Attrs",
3037            "ProbeResp",
3038            self.orig_loc,
3039            self.buf.as_ptr() as usize,
3040        ))
3041    }
3042    pub fn get_dfs_region(&self) -> Result<u8, ErrorContext> {
3043        let mut iter = self.clone();
3044        iter.pos = 0;
3045        for attr in iter {
3046            if let Nl80211Attrs::DfsRegion(val) = attr? {
3047                return Ok(val);
3048            }
3049        }
3050        Err(ErrorContext::new_missing(
3051            "Nl80211Attrs",
3052            "DfsRegion",
3053            self.orig_loc,
3054            self.buf.as_ptr() as usize,
3055        ))
3056    }
3057    pub fn get_disable_ht(&self) -> Result<(), ErrorContext> {
3058        let mut iter = self.clone();
3059        iter.pos = 0;
3060        for attr in iter {
3061            if let Nl80211Attrs::DisableHt(val) = attr? {
3062                return Ok(val);
3063            }
3064        }
3065        Err(ErrorContext::new_missing(
3066            "Nl80211Attrs",
3067            "DisableHt",
3068            self.orig_loc,
3069            self.buf.as_ptr() as usize,
3070        ))
3071    }
3072    pub fn get_ht_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
3073        let mut iter = self.clone();
3074        iter.pos = 0;
3075        for attr in iter {
3076            if let Nl80211Attrs::HtCapabilityMask(val) = attr? {
3077                return Ok(val);
3078            }
3079        }
3080        Err(ErrorContext::new_missing(
3081            "Nl80211Attrs",
3082            "HtCapabilityMask",
3083            self.orig_loc,
3084            self.buf.as_ptr() as usize,
3085        ))
3086    }
3087    pub fn get_noack_map(&self) -> Result<u16, ErrorContext> {
3088        let mut iter = self.clone();
3089        iter.pos = 0;
3090        for attr in iter {
3091            if let Nl80211Attrs::NoackMap(val) = attr? {
3092                return Ok(val);
3093            }
3094        }
3095        Err(ErrorContext::new_missing(
3096            "Nl80211Attrs",
3097            "NoackMap",
3098            self.orig_loc,
3099            self.buf.as_ptr() as usize,
3100        ))
3101    }
3102    pub fn get_inactivity_timeout(&self) -> Result<u16, ErrorContext> {
3103        let mut iter = self.clone();
3104        iter.pos = 0;
3105        for attr in iter {
3106            if let Nl80211Attrs::InactivityTimeout(val) = attr? {
3107                return Ok(val);
3108            }
3109        }
3110        Err(ErrorContext::new_missing(
3111            "Nl80211Attrs",
3112            "InactivityTimeout",
3113            self.orig_loc,
3114            self.buf.as_ptr() as usize,
3115        ))
3116    }
3117    pub fn get_rx_signal_dbm(&self) -> Result<u32, ErrorContext> {
3118        let mut iter = self.clone();
3119        iter.pos = 0;
3120        for attr in iter {
3121            if let Nl80211Attrs::RxSignalDbm(val) = attr? {
3122                return Ok(val);
3123            }
3124        }
3125        Err(ErrorContext::new_missing(
3126            "Nl80211Attrs",
3127            "RxSignalDbm",
3128            self.orig_loc,
3129            self.buf.as_ptr() as usize,
3130        ))
3131    }
3132    pub fn get_bg_scan_period(&self) -> Result<u16, ErrorContext> {
3133        let mut iter = self.clone();
3134        iter.pos = 0;
3135        for attr in iter {
3136            if let Nl80211Attrs::BgScanPeriod(val) = attr? {
3137                return Ok(val);
3138            }
3139        }
3140        Err(ErrorContext::new_missing(
3141            "Nl80211Attrs",
3142            "BgScanPeriod",
3143            self.orig_loc,
3144            self.buf.as_ptr() as usize,
3145        ))
3146    }
3147    pub fn get_wdev(&self) -> Result<u64, ErrorContext> {
3148        let mut iter = self.clone();
3149        iter.pos = 0;
3150        for attr in iter {
3151            if let Nl80211Attrs::Wdev(val) = attr? {
3152                return Ok(val);
3153            }
3154        }
3155        Err(ErrorContext::new_missing(
3156            "Nl80211Attrs",
3157            "Wdev",
3158            self.orig_loc,
3159            self.buf.as_ptr() as usize,
3160        ))
3161    }
3162    pub fn get_user_reg_hint_type(&self) -> Result<u32, ErrorContext> {
3163        let mut iter = self.clone();
3164        iter.pos = 0;
3165        for attr in iter {
3166            if let Nl80211Attrs::UserRegHintType(val) = attr? {
3167                return Ok(val);
3168            }
3169        }
3170        Err(ErrorContext::new_missing(
3171            "Nl80211Attrs",
3172            "UserRegHintType",
3173            self.orig_loc,
3174            self.buf.as_ptr() as usize,
3175        ))
3176    }
3177    pub fn get_conn_failed_reason(&self) -> Result<u32, ErrorContext> {
3178        let mut iter = self.clone();
3179        iter.pos = 0;
3180        for attr in iter {
3181            if let Nl80211Attrs::ConnFailedReason(val) = attr? {
3182                return Ok(val);
3183            }
3184        }
3185        Err(ErrorContext::new_missing(
3186            "Nl80211Attrs",
3187            "ConnFailedReason",
3188            self.orig_loc,
3189            self.buf.as_ptr() as usize,
3190        ))
3191    }
3192    pub fn get_auth_data(&self) -> Result<&'a [u8], ErrorContext> {
3193        let mut iter = self.clone();
3194        iter.pos = 0;
3195        for attr in iter {
3196            if let Nl80211Attrs::AuthData(val) = attr? {
3197                return Ok(val);
3198            }
3199        }
3200        Err(ErrorContext::new_missing(
3201            "Nl80211Attrs",
3202            "AuthData",
3203            self.orig_loc,
3204            self.buf.as_ptr() as usize,
3205        ))
3206    }
3207    pub fn get_vht_capability(&self) -> Result<&'a [u8], ErrorContext> {
3208        let mut iter = self.clone();
3209        iter.pos = 0;
3210        for attr in iter {
3211            if let Nl80211Attrs::VhtCapability(val) = attr? {
3212                return Ok(val);
3213            }
3214        }
3215        Err(ErrorContext::new_missing(
3216            "Nl80211Attrs",
3217            "VhtCapability",
3218            self.orig_loc,
3219            self.buf.as_ptr() as usize,
3220        ))
3221    }
3222    pub fn get_scan_flags(&self) -> Result<u32, ErrorContext> {
3223        let mut iter = self.clone();
3224        iter.pos = 0;
3225        for attr in iter {
3226            if let Nl80211Attrs::ScanFlags(val) = attr? {
3227                return Ok(val);
3228            }
3229        }
3230        Err(ErrorContext::new_missing(
3231            "Nl80211Attrs",
3232            "ScanFlags",
3233            self.orig_loc,
3234            self.buf.as_ptr() as usize,
3235        ))
3236    }
3237    pub fn get_channel_width(&self) -> Result<u32, ErrorContext> {
3238        let mut iter = self.clone();
3239        iter.pos = 0;
3240        for attr in iter {
3241            if let Nl80211Attrs::ChannelWidth(val) = attr? {
3242                return Ok(val);
3243            }
3244        }
3245        Err(ErrorContext::new_missing(
3246            "Nl80211Attrs",
3247            "ChannelWidth",
3248            self.orig_loc,
3249            self.buf.as_ptr() as usize,
3250        ))
3251    }
3252    pub fn get_center_freq1(&self) -> Result<u32, ErrorContext> {
3253        let mut iter = self.clone();
3254        iter.pos = 0;
3255        for attr in iter {
3256            if let Nl80211Attrs::CenterFreq1(val) = attr? {
3257                return Ok(val);
3258            }
3259        }
3260        Err(ErrorContext::new_missing(
3261            "Nl80211Attrs",
3262            "CenterFreq1",
3263            self.orig_loc,
3264            self.buf.as_ptr() as usize,
3265        ))
3266    }
3267    pub fn get_center_freq2(&self) -> Result<u32, ErrorContext> {
3268        let mut iter = self.clone();
3269        iter.pos = 0;
3270        for attr in iter {
3271            if let Nl80211Attrs::CenterFreq2(val) = attr? {
3272                return Ok(val);
3273            }
3274        }
3275        Err(ErrorContext::new_missing(
3276            "Nl80211Attrs",
3277            "CenterFreq2",
3278            self.orig_loc,
3279            self.buf.as_ptr() as usize,
3280        ))
3281    }
3282    pub fn get_p2p_ctwindow(&self) -> Result<u8, ErrorContext> {
3283        let mut iter = self.clone();
3284        iter.pos = 0;
3285        for attr in iter {
3286            if let Nl80211Attrs::P2pCtwindow(val) = attr? {
3287                return Ok(val);
3288            }
3289        }
3290        Err(ErrorContext::new_missing(
3291            "Nl80211Attrs",
3292            "P2pCtwindow",
3293            self.orig_loc,
3294            self.buf.as_ptr() as usize,
3295        ))
3296    }
3297    pub fn get_p2p_oppps(&self) -> Result<u8, ErrorContext> {
3298        let mut iter = self.clone();
3299        iter.pos = 0;
3300        for attr in iter {
3301            if let Nl80211Attrs::P2pOppps(val) = attr? {
3302                return Ok(val);
3303            }
3304        }
3305        Err(ErrorContext::new_missing(
3306            "Nl80211Attrs",
3307            "P2pOppps",
3308            self.orig_loc,
3309            self.buf.as_ptr() as usize,
3310        ))
3311    }
3312    pub fn get_local_mesh_power_mode(&self) -> Result<u32, ErrorContext> {
3313        let mut iter = self.clone();
3314        iter.pos = 0;
3315        for attr in iter {
3316            if let Nl80211Attrs::LocalMeshPowerMode(val) = attr? {
3317                return Ok(val);
3318            }
3319        }
3320        Err(ErrorContext::new_missing(
3321            "Nl80211Attrs",
3322            "LocalMeshPowerMode",
3323            self.orig_loc,
3324            self.buf.as_ptr() as usize,
3325        ))
3326    }
3327    pub fn get_acl_policy(&self) -> Result<u32, ErrorContext> {
3328        let mut iter = self.clone();
3329        iter.pos = 0;
3330        for attr in iter {
3331            if let Nl80211Attrs::AclPolicy(val) = attr? {
3332                return Ok(val);
3333            }
3334        }
3335        Err(ErrorContext::new_missing(
3336            "Nl80211Attrs",
3337            "AclPolicy",
3338            self.orig_loc,
3339            self.buf.as_ptr() as usize,
3340        ))
3341    }
3342    pub fn get_mac_addrs(&self) -> Result<&'a [u8], ErrorContext> {
3343        let mut iter = self.clone();
3344        iter.pos = 0;
3345        for attr in iter {
3346            if let Nl80211Attrs::MacAddrs(val) = attr? {
3347                return Ok(val);
3348            }
3349        }
3350        Err(ErrorContext::new_missing(
3351            "Nl80211Attrs",
3352            "MacAddrs",
3353            self.orig_loc,
3354            self.buf.as_ptr() as usize,
3355        ))
3356    }
3357    pub fn get_mac_acl_max(&self) -> Result<u32, ErrorContext> {
3358        let mut iter = self.clone();
3359        iter.pos = 0;
3360        for attr in iter {
3361            if let Nl80211Attrs::MacAclMax(val) = attr? {
3362                return Ok(val);
3363            }
3364        }
3365        Err(ErrorContext::new_missing(
3366            "Nl80211Attrs",
3367            "MacAclMax",
3368            self.orig_loc,
3369            self.buf.as_ptr() as usize,
3370        ))
3371    }
3372    pub fn get_radar_event(&self) -> Result<u32, ErrorContext> {
3373        let mut iter = self.clone();
3374        iter.pos = 0;
3375        for attr in iter {
3376            if let Nl80211Attrs::RadarEvent(val) = attr? {
3377                return Ok(val);
3378            }
3379        }
3380        Err(ErrorContext::new_missing(
3381            "Nl80211Attrs",
3382            "RadarEvent",
3383            self.orig_loc,
3384            self.buf.as_ptr() as usize,
3385        ))
3386    }
3387    pub fn get_ext_capa(&self) -> Result<&'a [u8], ErrorContext> {
3388        let mut iter = self.clone();
3389        iter.pos = 0;
3390        for attr in iter {
3391            if let Nl80211Attrs::ExtCapa(val) = attr? {
3392                return Ok(val);
3393            }
3394        }
3395        Err(ErrorContext::new_missing(
3396            "Nl80211Attrs",
3397            "ExtCapa",
3398            self.orig_loc,
3399            self.buf.as_ptr() as usize,
3400        ))
3401    }
3402    pub fn get_ext_capa_mask(&self) -> Result<&'a [u8], ErrorContext> {
3403        let mut iter = self.clone();
3404        iter.pos = 0;
3405        for attr in iter {
3406            if let Nl80211Attrs::ExtCapaMask(val) = attr? {
3407                return Ok(val);
3408            }
3409        }
3410        Err(ErrorContext::new_missing(
3411            "Nl80211Attrs",
3412            "ExtCapaMask",
3413            self.orig_loc,
3414            self.buf.as_ptr() as usize,
3415        ))
3416    }
3417    pub fn get_sta_capability(&self) -> Result<u16, ErrorContext> {
3418        let mut iter = self.clone();
3419        iter.pos = 0;
3420        for attr in iter {
3421            if let Nl80211Attrs::StaCapability(val) = attr? {
3422                return Ok(val);
3423            }
3424        }
3425        Err(ErrorContext::new_missing(
3426            "Nl80211Attrs",
3427            "StaCapability",
3428            self.orig_loc,
3429            self.buf.as_ptr() as usize,
3430        ))
3431    }
3432    pub fn get_sta_ext_capability(&self) -> Result<&'a [u8], ErrorContext> {
3433        let mut iter = self.clone();
3434        iter.pos = 0;
3435        for attr in iter {
3436            if let Nl80211Attrs::StaExtCapability(val) = attr? {
3437                return Ok(val);
3438            }
3439        }
3440        Err(ErrorContext::new_missing(
3441            "Nl80211Attrs",
3442            "StaExtCapability",
3443            self.orig_loc,
3444            self.buf.as_ptr() as usize,
3445        ))
3446    }
3447    #[doc = "Associated type: [`ProtocolFeatures`] (enum)"]
3448    pub fn get_protocol_features(&self) -> Result<u32, ErrorContext> {
3449        let mut iter = self.clone();
3450        iter.pos = 0;
3451        for attr in iter {
3452            if let Nl80211Attrs::ProtocolFeatures(val) = attr? {
3453                return Ok(val);
3454            }
3455        }
3456        Err(ErrorContext::new_missing(
3457            "Nl80211Attrs",
3458            "ProtocolFeatures",
3459            self.orig_loc,
3460            self.buf.as_ptr() as usize,
3461        ))
3462    }
3463    pub fn get_split_wiphy_dump(&self) -> Result<(), ErrorContext> {
3464        let mut iter = self.clone();
3465        iter.pos = 0;
3466        for attr in iter {
3467            if let Nl80211Attrs::SplitWiphyDump(val) = attr? {
3468                return Ok(val);
3469            }
3470        }
3471        Err(ErrorContext::new_missing(
3472            "Nl80211Attrs",
3473            "SplitWiphyDump",
3474            self.orig_loc,
3475            self.buf.as_ptr() as usize,
3476        ))
3477    }
3478    pub fn get_disable_vht(&self) -> Result<(), ErrorContext> {
3479        let mut iter = self.clone();
3480        iter.pos = 0;
3481        for attr in iter {
3482            if let Nl80211Attrs::DisableVht(val) = attr? {
3483                return Ok(val);
3484            }
3485        }
3486        Err(ErrorContext::new_missing(
3487            "Nl80211Attrs",
3488            "DisableVht",
3489            self.orig_loc,
3490            self.buf.as_ptr() as usize,
3491        ))
3492    }
3493    pub fn get_vht_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
3494        let mut iter = self.clone();
3495        iter.pos = 0;
3496        for attr in iter {
3497            if let Nl80211Attrs::VhtCapabilityMask(val) = attr? {
3498                return Ok(val);
3499            }
3500        }
3501        Err(ErrorContext::new_missing(
3502            "Nl80211Attrs",
3503            "VhtCapabilityMask",
3504            self.orig_loc,
3505            self.buf.as_ptr() as usize,
3506        ))
3507    }
3508    pub fn get_mdid(&self) -> Result<u16, ErrorContext> {
3509        let mut iter = self.clone();
3510        iter.pos = 0;
3511        for attr in iter {
3512            if let Nl80211Attrs::Mdid(val) = attr? {
3513                return Ok(val);
3514            }
3515        }
3516        Err(ErrorContext::new_missing(
3517            "Nl80211Attrs",
3518            "Mdid",
3519            self.orig_loc,
3520            self.buf.as_ptr() as usize,
3521        ))
3522    }
3523    pub fn get_ie_ric(&self) -> Result<&'a [u8], ErrorContext> {
3524        let mut iter = self.clone();
3525        iter.pos = 0;
3526        for attr in iter {
3527            if let Nl80211Attrs::IeRic(val) = attr? {
3528                return Ok(val);
3529            }
3530        }
3531        Err(ErrorContext::new_missing(
3532            "Nl80211Attrs",
3533            "IeRic",
3534            self.orig_loc,
3535            self.buf.as_ptr() as usize,
3536        ))
3537    }
3538    pub fn get_crit_prot_id(&self) -> Result<u16, ErrorContext> {
3539        let mut iter = self.clone();
3540        iter.pos = 0;
3541        for attr in iter {
3542            if let Nl80211Attrs::CritProtId(val) = attr? {
3543                return Ok(val);
3544            }
3545        }
3546        Err(ErrorContext::new_missing(
3547            "Nl80211Attrs",
3548            "CritProtId",
3549            self.orig_loc,
3550            self.buf.as_ptr() as usize,
3551        ))
3552    }
3553    pub fn get_max_crit_prot_duration(&self) -> Result<u16, ErrorContext> {
3554        let mut iter = self.clone();
3555        iter.pos = 0;
3556        for attr in iter {
3557            if let Nl80211Attrs::MaxCritProtDuration(val) = attr? {
3558                return Ok(val);
3559            }
3560        }
3561        Err(ErrorContext::new_missing(
3562            "Nl80211Attrs",
3563            "MaxCritProtDuration",
3564            self.orig_loc,
3565            self.buf.as_ptr() as usize,
3566        ))
3567    }
3568    pub fn get_peer_aid(&self) -> Result<u16, ErrorContext> {
3569        let mut iter = self.clone();
3570        iter.pos = 0;
3571        for attr in iter {
3572            if let Nl80211Attrs::PeerAid(val) = attr? {
3573                return Ok(val);
3574            }
3575        }
3576        Err(ErrorContext::new_missing(
3577            "Nl80211Attrs",
3578            "PeerAid",
3579            self.orig_loc,
3580            self.buf.as_ptr() as usize,
3581        ))
3582    }
3583    pub fn get_coalesce_rule(&self) -> Result<&'a [u8], ErrorContext> {
3584        let mut iter = self.clone();
3585        iter.pos = 0;
3586        for attr in iter {
3587            if let Nl80211Attrs::CoalesceRule(val) = attr? {
3588                return Ok(val);
3589            }
3590        }
3591        Err(ErrorContext::new_missing(
3592            "Nl80211Attrs",
3593            "CoalesceRule",
3594            self.orig_loc,
3595            self.buf.as_ptr() as usize,
3596        ))
3597    }
3598    pub fn get_ch_switch_count(&self) -> Result<u32, ErrorContext> {
3599        let mut iter = self.clone();
3600        iter.pos = 0;
3601        for attr in iter {
3602            if let Nl80211Attrs::ChSwitchCount(val) = attr? {
3603                return Ok(val);
3604            }
3605        }
3606        Err(ErrorContext::new_missing(
3607            "Nl80211Attrs",
3608            "ChSwitchCount",
3609            self.orig_loc,
3610            self.buf.as_ptr() as usize,
3611        ))
3612    }
3613    pub fn get_ch_switch_block_tx(&self) -> Result<(), ErrorContext> {
3614        let mut iter = self.clone();
3615        iter.pos = 0;
3616        for attr in iter {
3617            if let Nl80211Attrs::ChSwitchBlockTx(val) = attr? {
3618                return Ok(val);
3619            }
3620        }
3621        Err(ErrorContext::new_missing(
3622            "Nl80211Attrs",
3623            "ChSwitchBlockTx",
3624            self.orig_loc,
3625            self.buf.as_ptr() as usize,
3626        ))
3627    }
3628    pub fn get_csa_ies(&self) -> Result<&'a [u8], ErrorContext> {
3629        let mut iter = self.clone();
3630        iter.pos = 0;
3631        for attr in iter {
3632            if let Nl80211Attrs::CsaIes(val) = attr? {
3633                return Ok(val);
3634            }
3635        }
3636        Err(ErrorContext::new_missing(
3637            "Nl80211Attrs",
3638            "CsaIes",
3639            self.orig_loc,
3640            self.buf.as_ptr() as usize,
3641        ))
3642    }
3643    pub fn get_cntdwn_offs_beacon(&self) -> Result<&'a [u8], ErrorContext> {
3644        let mut iter = self.clone();
3645        iter.pos = 0;
3646        for attr in iter {
3647            if let Nl80211Attrs::CntdwnOffsBeacon(val) = attr? {
3648                return Ok(val);
3649            }
3650        }
3651        Err(ErrorContext::new_missing(
3652            "Nl80211Attrs",
3653            "CntdwnOffsBeacon",
3654            self.orig_loc,
3655            self.buf.as_ptr() as usize,
3656        ))
3657    }
3658    pub fn get_cntdwn_offs_presp(&self) -> Result<&'a [u8], ErrorContext> {
3659        let mut iter = self.clone();
3660        iter.pos = 0;
3661        for attr in iter {
3662            if let Nl80211Attrs::CntdwnOffsPresp(val) = attr? {
3663                return Ok(val);
3664            }
3665        }
3666        Err(ErrorContext::new_missing(
3667            "Nl80211Attrs",
3668            "CntdwnOffsPresp",
3669            self.orig_loc,
3670            self.buf.as_ptr() as usize,
3671        ))
3672    }
3673    pub fn get_rxmgmt_flags(&self) -> Result<&'a [u8], ErrorContext> {
3674        let mut iter = self.clone();
3675        iter.pos = 0;
3676        for attr in iter {
3677            if let Nl80211Attrs::RxmgmtFlags(val) = attr? {
3678                return Ok(val);
3679            }
3680        }
3681        Err(ErrorContext::new_missing(
3682            "Nl80211Attrs",
3683            "RxmgmtFlags",
3684            self.orig_loc,
3685            self.buf.as_ptr() as usize,
3686        ))
3687    }
3688    pub fn get_sta_supported_channels(&self) -> Result<&'a [u8], ErrorContext> {
3689        let mut iter = self.clone();
3690        iter.pos = 0;
3691        for attr in iter {
3692            if let Nl80211Attrs::StaSupportedChannels(val) = attr? {
3693                return Ok(val);
3694            }
3695        }
3696        Err(ErrorContext::new_missing(
3697            "Nl80211Attrs",
3698            "StaSupportedChannels",
3699            self.orig_loc,
3700            self.buf.as_ptr() as usize,
3701        ))
3702    }
3703    pub fn get_sta_supported_oper_classes(&self) -> Result<&'a [u8], ErrorContext> {
3704        let mut iter = self.clone();
3705        iter.pos = 0;
3706        for attr in iter {
3707            if let Nl80211Attrs::StaSupportedOperClasses(val) = attr? {
3708                return Ok(val);
3709            }
3710        }
3711        Err(ErrorContext::new_missing(
3712            "Nl80211Attrs",
3713            "StaSupportedOperClasses",
3714            self.orig_loc,
3715            self.buf.as_ptr() as usize,
3716        ))
3717    }
3718    pub fn get_handle_dfs(&self) -> Result<(), ErrorContext> {
3719        let mut iter = self.clone();
3720        iter.pos = 0;
3721        for attr in iter {
3722            if let Nl80211Attrs::HandleDfs(val) = attr? {
3723                return Ok(val);
3724            }
3725        }
3726        Err(ErrorContext::new_missing(
3727            "Nl80211Attrs",
3728            "HandleDfs",
3729            self.orig_loc,
3730            self.buf.as_ptr() as usize,
3731        ))
3732    }
3733    pub fn get_support_5_mhz(&self) -> Result<(), ErrorContext> {
3734        let mut iter = self.clone();
3735        iter.pos = 0;
3736        for attr in iter {
3737            if let Nl80211Attrs::Support5Mhz(val) = attr? {
3738                return Ok(val);
3739            }
3740        }
3741        Err(ErrorContext::new_missing(
3742            "Nl80211Attrs",
3743            "Support5Mhz",
3744            self.orig_loc,
3745            self.buf.as_ptr() as usize,
3746        ))
3747    }
3748    pub fn get_support_10_mhz(&self) -> Result<(), ErrorContext> {
3749        let mut iter = self.clone();
3750        iter.pos = 0;
3751        for attr in iter {
3752            if let Nl80211Attrs::Support10Mhz(val) = attr? {
3753                return Ok(val);
3754            }
3755        }
3756        Err(ErrorContext::new_missing(
3757            "Nl80211Attrs",
3758            "Support10Mhz",
3759            self.orig_loc,
3760            self.buf.as_ptr() as usize,
3761        ))
3762    }
3763    pub fn get_opmode_notif(&self) -> Result<u8, ErrorContext> {
3764        let mut iter = self.clone();
3765        iter.pos = 0;
3766        for attr in iter {
3767            if let Nl80211Attrs::OpmodeNotif(val) = attr? {
3768                return Ok(val);
3769            }
3770        }
3771        Err(ErrorContext::new_missing(
3772            "Nl80211Attrs",
3773            "OpmodeNotif",
3774            self.orig_loc,
3775            self.buf.as_ptr() as usize,
3776        ))
3777    }
3778    pub fn get_vendor_id(&self) -> Result<u32, ErrorContext> {
3779        let mut iter = self.clone();
3780        iter.pos = 0;
3781        for attr in iter {
3782            if let Nl80211Attrs::VendorId(val) = attr? {
3783                return Ok(val);
3784            }
3785        }
3786        Err(ErrorContext::new_missing(
3787            "Nl80211Attrs",
3788            "VendorId",
3789            self.orig_loc,
3790            self.buf.as_ptr() as usize,
3791        ))
3792    }
3793    pub fn get_vendor_subcmd(&self) -> Result<u32, ErrorContext> {
3794        let mut iter = self.clone();
3795        iter.pos = 0;
3796        for attr in iter {
3797            if let Nl80211Attrs::VendorSubcmd(val) = attr? {
3798                return Ok(val);
3799            }
3800        }
3801        Err(ErrorContext::new_missing(
3802            "Nl80211Attrs",
3803            "VendorSubcmd",
3804            self.orig_loc,
3805            self.buf.as_ptr() as usize,
3806        ))
3807    }
3808    pub fn get_vendor_data(&self) -> Result<&'a [u8], ErrorContext> {
3809        let mut iter = self.clone();
3810        iter.pos = 0;
3811        for attr in iter {
3812            if let Nl80211Attrs::VendorData(val) = attr? {
3813                return Ok(val);
3814            }
3815        }
3816        Err(ErrorContext::new_missing(
3817            "Nl80211Attrs",
3818            "VendorData",
3819            self.orig_loc,
3820            self.buf.as_ptr() as usize,
3821        ))
3822    }
3823    pub fn get_vendor_events(&self) -> Result<&'a [u8], ErrorContext> {
3824        let mut iter = self.clone();
3825        iter.pos = 0;
3826        for attr in iter {
3827            if let Nl80211Attrs::VendorEvents(val) = attr? {
3828                return Ok(val);
3829            }
3830        }
3831        Err(ErrorContext::new_missing(
3832            "Nl80211Attrs",
3833            "VendorEvents",
3834            self.orig_loc,
3835            self.buf.as_ptr() as usize,
3836        ))
3837    }
3838    pub fn get_qos_map(&self) -> Result<&'a [u8], ErrorContext> {
3839        let mut iter = self.clone();
3840        iter.pos = 0;
3841        for attr in iter {
3842            if let Nl80211Attrs::QosMap(val) = attr? {
3843                return Ok(val);
3844            }
3845        }
3846        Err(ErrorContext::new_missing(
3847            "Nl80211Attrs",
3848            "QosMap",
3849            self.orig_loc,
3850            self.buf.as_ptr() as usize,
3851        ))
3852    }
3853    pub fn get_mac_hint(&self) -> Result<&'a [u8], ErrorContext> {
3854        let mut iter = self.clone();
3855        iter.pos = 0;
3856        for attr in iter {
3857            if let Nl80211Attrs::MacHint(val) = attr? {
3858                return Ok(val);
3859            }
3860        }
3861        Err(ErrorContext::new_missing(
3862            "Nl80211Attrs",
3863            "MacHint",
3864            self.orig_loc,
3865            self.buf.as_ptr() as usize,
3866        ))
3867    }
3868    pub fn get_wiphy_freq_hint(&self) -> Result<u32, ErrorContext> {
3869        let mut iter = self.clone();
3870        iter.pos = 0;
3871        for attr in iter {
3872            if let Nl80211Attrs::WiphyFreqHint(val) = attr? {
3873                return Ok(val);
3874            }
3875        }
3876        Err(ErrorContext::new_missing(
3877            "Nl80211Attrs",
3878            "WiphyFreqHint",
3879            self.orig_loc,
3880            self.buf.as_ptr() as usize,
3881        ))
3882    }
3883    pub fn get_max_ap_assoc_sta(&self) -> Result<u32, ErrorContext> {
3884        let mut iter = self.clone();
3885        iter.pos = 0;
3886        for attr in iter {
3887            if let Nl80211Attrs::MaxApAssocSta(val) = attr? {
3888                return Ok(val);
3889            }
3890        }
3891        Err(ErrorContext::new_missing(
3892            "Nl80211Attrs",
3893            "MaxApAssocSta",
3894            self.orig_loc,
3895            self.buf.as_ptr() as usize,
3896        ))
3897    }
3898    pub fn get_tdls_peer_capability(&self) -> Result<u32, ErrorContext> {
3899        let mut iter = self.clone();
3900        iter.pos = 0;
3901        for attr in iter {
3902            if let Nl80211Attrs::TdlsPeerCapability(val) = attr? {
3903                return Ok(val);
3904            }
3905        }
3906        Err(ErrorContext::new_missing(
3907            "Nl80211Attrs",
3908            "TdlsPeerCapability",
3909            self.orig_loc,
3910            self.buf.as_ptr() as usize,
3911        ))
3912    }
3913    pub fn get_socket_owner(&self) -> Result<(), ErrorContext> {
3914        let mut iter = self.clone();
3915        iter.pos = 0;
3916        for attr in iter {
3917            if let Nl80211Attrs::SocketOwner(val) = attr? {
3918                return Ok(val);
3919            }
3920        }
3921        Err(ErrorContext::new_missing(
3922            "Nl80211Attrs",
3923            "SocketOwner",
3924            self.orig_loc,
3925            self.buf.as_ptr() as usize,
3926        ))
3927    }
3928    pub fn get_csa_c_offsets_tx(&self) -> Result<&'a [u8], ErrorContext> {
3929        let mut iter = self.clone();
3930        iter.pos = 0;
3931        for attr in iter {
3932            if let Nl80211Attrs::CsaCOffsetsTx(val) = attr? {
3933                return Ok(val);
3934            }
3935        }
3936        Err(ErrorContext::new_missing(
3937            "Nl80211Attrs",
3938            "CsaCOffsetsTx",
3939            self.orig_loc,
3940            self.buf.as_ptr() as usize,
3941        ))
3942    }
3943    pub fn get_max_csa_counters(&self) -> Result<u8, ErrorContext> {
3944        let mut iter = self.clone();
3945        iter.pos = 0;
3946        for attr in iter {
3947            if let Nl80211Attrs::MaxCsaCounters(val) = attr? {
3948                return Ok(val);
3949            }
3950        }
3951        Err(ErrorContext::new_missing(
3952            "Nl80211Attrs",
3953            "MaxCsaCounters",
3954            self.orig_loc,
3955            self.buf.as_ptr() as usize,
3956        ))
3957    }
3958    pub fn get_tdls_initiator(&self) -> Result<(), ErrorContext> {
3959        let mut iter = self.clone();
3960        iter.pos = 0;
3961        for attr in iter {
3962            if let Nl80211Attrs::TdlsInitiator(val) = attr? {
3963                return Ok(val);
3964            }
3965        }
3966        Err(ErrorContext::new_missing(
3967            "Nl80211Attrs",
3968            "TdlsInitiator",
3969            self.orig_loc,
3970            self.buf.as_ptr() as usize,
3971        ))
3972    }
3973    pub fn get_use_rrm(&self) -> Result<(), ErrorContext> {
3974        let mut iter = self.clone();
3975        iter.pos = 0;
3976        for attr in iter {
3977            if let Nl80211Attrs::UseRrm(val) = attr? {
3978                return Ok(val);
3979            }
3980        }
3981        Err(ErrorContext::new_missing(
3982            "Nl80211Attrs",
3983            "UseRrm",
3984            self.orig_loc,
3985            self.buf.as_ptr() as usize,
3986        ))
3987    }
3988    pub fn get_wiphy_dyn_ack(&self) -> Result<(), ErrorContext> {
3989        let mut iter = self.clone();
3990        iter.pos = 0;
3991        for attr in iter {
3992            if let Nl80211Attrs::WiphyDynAck(val) = attr? {
3993                return Ok(val);
3994            }
3995        }
3996        Err(ErrorContext::new_missing(
3997            "Nl80211Attrs",
3998            "WiphyDynAck",
3999            self.orig_loc,
4000            self.buf.as_ptr() as usize,
4001        ))
4002    }
4003    pub fn get_tsid(&self) -> Result<u8, ErrorContext> {
4004        let mut iter = self.clone();
4005        iter.pos = 0;
4006        for attr in iter {
4007            if let Nl80211Attrs::Tsid(val) = attr? {
4008                return Ok(val);
4009            }
4010        }
4011        Err(ErrorContext::new_missing(
4012            "Nl80211Attrs",
4013            "Tsid",
4014            self.orig_loc,
4015            self.buf.as_ptr() as usize,
4016        ))
4017    }
4018    pub fn get_user_prio(&self) -> Result<u8, ErrorContext> {
4019        let mut iter = self.clone();
4020        iter.pos = 0;
4021        for attr in iter {
4022            if let Nl80211Attrs::UserPrio(val) = attr? {
4023                return Ok(val);
4024            }
4025        }
4026        Err(ErrorContext::new_missing(
4027            "Nl80211Attrs",
4028            "UserPrio",
4029            self.orig_loc,
4030            self.buf.as_ptr() as usize,
4031        ))
4032    }
4033    pub fn get_admitted_time(&self) -> Result<u16, ErrorContext> {
4034        let mut iter = self.clone();
4035        iter.pos = 0;
4036        for attr in iter {
4037            if let Nl80211Attrs::AdmittedTime(val) = attr? {
4038                return Ok(val);
4039            }
4040        }
4041        Err(ErrorContext::new_missing(
4042            "Nl80211Attrs",
4043            "AdmittedTime",
4044            self.orig_loc,
4045            self.buf.as_ptr() as usize,
4046        ))
4047    }
4048    pub fn get_smps_mode(&self) -> Result<u8, ErrorContext> {
4049        let mut iter = self.clone();
4050        iter.pos = 0;
4051        for attr in iter {
4052            if let Nl80211Attrs::SmpsMode(val) = attr? {
4053                return Ok(val);
4054            }
4055        }
4056        Err(ErrorContext::new_missing(
4057            "Nl80211Attrs",
4058            "SmpsMode",
4059            self.orig_loc,
4060            self.buf.as_ptr() as usize,
4061        ))
4062    }
4063    pub fn get_oper_class(&self) -> Result<u8, ErrorContext> {
4064        let mut iter = self.clone();
4065        iter.pos = 0;
4066        for attr in iter {
4067            if let Nl80211Attrs::OperClass(val) = attr? {
4068                return Ok(val);
4069            }
4070        }
4071        Err(ErrorContext::new_missing(
4072            "Nl80211Attrs",
4073            "OperClass",
4074            self.orig_loc,
4075            self.buf.as_ptr() as usize,
4076        ))
4077    }
4078    pub fn get_mac_mask(&self) -> Result<&'a [u8], ErrorContext> {
4079        let mut iter = self.clone();
4080        iter.pos = 0;
4081        for attr in iter {
4082            if let Nl80211Attrs::MacMask(val) = attr? {
4083                return Ok(val);
4084            }
4085        }
4086        Err(ErrorContext::new_missing(
4087            "Nl80211Attrs",
4088            "MacMask",
4089            self.orig_loc,
4090            self.buf.as_ptr() as usize,
4091        ))
4092    }
4093    pub fn get_wiphy_self_managed_reg(&self) -> Result<(), ErrorContext> {
4094        let mut iter = self.clone();
4095        iter.pos = 0;
4096        for attr in iter {
4097            if let Nl80211Attrs::WiphySelfManagedReg(val) = attr? {
4098                return Ok(val);
4099            }
4100        }
4101        Err(ErrorContext::new_missing(
4102            "Nl80211Attrs",
4103            "WiphySelfManagedReg",
4104            self.orig_loc,
4105            self.buf.as_ptr() as usize,
4106        ))
4107    }
4108    pub fn get_ext_features(&self) -> Result<&'a [u8], ErrorContext> {
4109        let mut iter = self.clone();
4110        iter.pos = 0;
4111        for attr in iter {
4112            if let Nl80211Attrs::ExtFeatures(val) = attr? {
4113                return Ok(val);
4114            }
4115        }
4116        Err(ErrorContext::new_missing(
4117            "Nl80211Attrs",
4118            "ExtFeatures",
4119            self.orig_loc,
4120            self.buf.as_ptr() as usize,
4121        ))
4122    }
4123    pub fn get_survey_radio_stats(&self) -> Result<&'a [u8], ErrorContext> {
4124        let mut iter = self.clone();
4125        iter.pos = 0;
4126        for attr in iter {
4127            if let Nl80211Attrs::SurveyRadioStats(val) = attr? {
4128                return Ok(val);
4129            }
4130        }
4131        Err(ErrorContext::new_missing(
4132            "Nl80211Attrs",
4133            "SurveyRadioStats",
4134            self.orig_loc,
4135            self.buf.as_ptr() as usize,
4136        ))
4137    }
4138    pub fn get_netns_fd(&self) -> Result<u32, ErrorContext> {
4139        let mut iter = self.clone();
4140        iter.pos = 0;
4141        for attr in iter {
4142            if let Nl80211Attrs::NetnsFd(val) = attr? {
4143                return Ok(val);
4144            }
4145        }
4146        Err(ErrorContext::new_missing(
4147            "Nl80211Attrs",
4148            "NetnsFd",
4149            self.orig_loc,
4150            self.buf.as_ptr() as usize,
4151        ))
4152    }
4153    pub fn get_sched_scan_delay(&self) -> Result<u32, ErrorContext> {
4154        let mut iter = self.clone();
4155        iter.pos = 0;
4156        for attr in iter {
4157            if let Nl80211Attrs::SchedScanDelay(val) = attr? {
4158                return Ok(val);
4159            }
4160        }
4161        Err(ErrorContext::new_missing(
4162            "Nl80211Attrs",
4163            "SchedScanDelay",
4164            self.orig_loc,
4165            self.buf.as_ptr() as usize,
4166        ))
4167    }
4168    pub fn get_reg_indoor(&self) -> Result<(), ErrorContext> {
4169        let mut iter = self.clone();
4170        iter.pos = 0;
4171        for attr in iter {
4172            if let Nl80211Attrs::RegIndoor(val) = attr? {
4173                return Ok(val);
4174            }
4175        }
4176        Err(ErrorContext::new_missing(
4177            "Nl80211Attrs",
4178            "RegIndoor",
4179            self.orig_loc,
4180            self.buf.as_ptr() as usize,
4181        ))
4182    }
4183    pub fn get_max_num_sched_scan_plans(&self) -> Result<u32, ErrorContext> {
4184        let mut iter = self.clone();
4185        iter.pos = 0;
4186        for attr in iter {
4187            if let Nl80211Attrs::MaxNumSchedScanPlans(val) = attr? {
4188                return Ok(val);
4189            }
4190        }
4191        Err(ErrorContext::new_missing(
4192            "Nl80211Attrs",
4193            "MaxNumSchedScanPlans",
4194            self.orig_loc,
4195            self.buf.as_ptr() as usize,
4196        ))
4197    }
4198    pub fn get_max_scan_plan_interval(&self) -> Result<u32, ErrorContext> {
4199        let mut iter = self.clone();
4200        iter.pos = 0;
4201        for attr in iter {
4202            if let Nl80211Attrs::MaxScanPlanInterval(val) = attr? {
4203                return Ok(val);
4204            }
4205        }
4206        Err(ErrorContext::new_missing(
4207            "Nl80211Attrs",
4208            "MaxScanPlanInterval",
4209            self.orig_loc,
4210            self.buf.as_ptr() as usize,
4211        ))
4212    }
4213    pub fn get_max_scan_plan_iterations(&self) -> Result<u32, ErrorContext> {
4214        let mut iter = self.clone();
4215        iter.pos = 0;
4216        for attr in iter {
4217            if let Nl80211Attrs::MaxScanPlanIterations(val) = attr? {
4218                return Ok(val);
4219            }
4220        }
4221        Err(ErrorContext::new_missing(
4222            "Nl80211Attrs",
4223            "MaxScanPlanIterations",
4224            self.orig_loc,
4225            self.buf.as_ptr() as usize,
4226        ))
4227    }
4228    pub fn get_sched_scan_plans(&self) -> Result<&'a [u8], ErrorContext> {
4229        let mut iter = self.clone();
4230        iter.pos = 0;
4231        for attr in iter {
4232            if let Nl80211Attrs::SchedScanPlans(val) = attr? {
4233                return Ok(val);
4234            }
4235        }
4236        Err(ErrorContext::new_missing(
4237            "Nl80211Attrs",
4238            "SchedScanPlans",
4239            self.orig_loc,
4240            self.buf.as_ptr() as usize,
4241        ))
4242    }
4243    pub fn get_pbss(&self) -> Result<(), ErrorContext> {
4244        let mut iter = self.clone();
4245        iter.pos = 0;
4246        for attr in iter {
4247            if let Nl80211Attrs::Pbss(val) = attr? {
4248                return Ok(val);
4249            }
4250        }
4251        Err(ErrorContext::new_missing(
4252            "Nl80211Attrs",
4253            "Pbss",
4254            self.orig_loc,
4255            self.buf.as_ptr() as usize,
4256        ))
4257    }
4258    pub fn get_bss_select(&self) -> Result<&'a [u8], ErrorContext> {
4259        let mut iter = self.clone();
4260        iter.pos = 0;
4261        for attr in iter {
4262            if let Nl80211Attrs::BssSelect(val) = attr? {
4263                return Ok(val);
4264            }
4265        }
4266        Err(ErrorContext::new_missing(
4267            "Nl80211Attrs",
4268            "BssSelect",
4269            self.orig_loc,
4270            self.buf.as_ptr() as usize,
4271        ))
4272    }
4273    pub fn get_sta_support_p2p_ps(&self) -> Result<u8, ErrorContext> {
4274        let mut iter = self.clone();
4275        iter.pos = 0;
4276        for attr in iter {
4277            if let Nl80211Attrs::StaSupportP2pPs(val) = attr? {
4278                return Ok(val);
4279            }
4280        }
4281        Err(ErrorContext::new_missing(
4282            "Nl80211Attrs",
4283            "StaSupportP2pPs",
4284            self.orig_loc,
4285            self.buf.as_ptr() as usize,
4286        ))
4287    }
4288    pub fn get_pad(&self) -> Result<&'a [u8], ErrorContext> {
4289        let mut iter = self.clone();
4290        iter.pos = 0;
4291        for attr in iter {
4292            if let Nl80211Attrs::Pad(val) = attr? {
4293                return Ok(val);
4294            }
4295        }
4296        Err(ErrorContext::new_missing(
4297            "Nl80211Attrs",
4298            "Pad",
4299            self.orig_loc,
4300            self.buf.as_ptr() as usize,
4301        ))
4302    }
4303    pub fn get_iftype_ext_capa(&self) -> Result<&'a [u8], ErrorContext> {
4304        let mut iter = self.clone();
4305        iter.pos = 0;
4306        for attr in iter {
4307            if let Nl80211Attrs::IftypeExtCapa(val) = attr? {
4308                return Ok(val);
4309            }
4310        }
4311        Err(ErrorContext::new_missing(
4312            "Nl80211Attrs",
4313            "IftypeExtCapa",
4314            self.orig_loc,
4315            self.buf.as_ptr() as usize,
4316        ))
4317    }
4318    pub fn get_mu_mimo_group_data(&self) -> Result<&'a [u8], ErrorContext> {
4319        let mut iter = self.clone();
4320        iter.pos = 0;
4321        for attr in iter {
4322            if let Nl80211Attrs::MuMimoGroupData(val) = attr? {
4323                return Ok(val);
4324            }
4325        }
4326        Err(ErrorContext::new_missing(
4327            "Nl80211Attrs",
4328            "MuMimoGroupData",
4329            self.orig_loc,
4330            self.buf.as_ptr() as usize,
4331        ))
4332    }
4333    pub fn get_mu_mimo_follow_mac_addr(&self) -> Result<&'a [u8], ErrorContext> {
4334        let mut iter = self.clone();
4335        iter.pos = 0;
4336        for attr in iter {
4337            if let Nl80211Attrs::MuMimoFollowMacAddr(val) = attr? {
4338                return Ok(val);
4339            }
4340        }
4341        Err(ErrorContext::new_missing(
4342            "Nl80211Attrs",
4343            "MuMimoFollowMacAddr",
4344            self.orig_loc,
4345            self.buf.as_ptr() as usize,
4346        ))
4347    }
4348    pub fn get_scan_start_time_tsf(&self) -> Result<u64, ErrorContext> {
4349        let mut iter = self.clone();
4350        iter.pos = 0;
4351        for attr in iter {
4352            if let Nl80211Attrs::ScanStartTimeTsf(val) = attr? {
4353                return Ok(val);
4354            }
4355        }
4356        Err(ErrorContext::new_missing(
4357            "Nl80211Attrs",
4358            "ScanStartTimeTsf",
4359            self.orig_loc,
4360            self.buf.as_ptr() as usize,
4361        ))
4362    }
4363    pub fn get_scan_start_time_tsf_bssid(&self) -> Result<&'a [u8], ErrorContext> {
4364        let mut iter = self.clone();
4365        iter.pos = 0;
4366        for attr in iter {
4367            if let Nl80211Attrs::ScanStartTimeTsfBssid(val) = attr? {
4368                return Ok(val);
4369            }
4370        }
4371        Err(ErrorContext::new_missing(
4372            "Nl80211Attrs",
4373            "ScanStartTimeTsfBssid",
4374            self.orig_loc,
4375            self.buf.as_ptr() as usize,
4376        ))
4377    }
4378    pub fn get_measurement_duration(&self) -> Result<u16, ErrorContext> {
4379        let mut iter = self.clone();
4380        iter.pos = 0;
4381        for attr in iter {
4382            if let Nl80211Attrs::MeasurementDuration(val) = attr? {
4383                return Ok(val);
4384            }
4385        }
4386        Err(ErrorContext::new_missing(
4387            "Nl80211Attrs",
4388            "MeasurementDuration",
4389            self.orig_loc,
4390            self.buf.as_ptr() as usize,
4391        ))
4392    }
4393    pub fn get_measurement_duration_mandatory(&self) -> Result<(), ErrorContext> {
4394        let mut iter = self.clone();
4395        iter.pos = 0;
4396        for attr in iter {
4397            if let Nl80211Attrs::MeasurementDurationMandatory(val) = attr? {
4398                return Ok(val);
4399            }
4400        }
4401        Err(ErrorContext::new_missing(
4402            "Nl80211Attrs",
4403            "MeasurementDurationMandatory",
4404            self.orig_loc,
4405            self.buf.as_ptr() as usize,
4406        ))
4407    }
4408    pub fn get_mesh_peer_aid(&self) -> Result<u16, ErrorContext> {
4409        let mut iter = self.clone();
4410        iter.pos = 0;
4411        for attr in iter {
4412            if let Nl80211Attrs::MeshPeerAid(val) = attr? {
4413                return Ok(val);
4414            }
4415        }
4416        Err(ErrorContext::new_missing(
4417            "Nl80211Attrs",
4418            "MeshPeerAid",
4419            self.orig_loc,
4420            self.buf.as_ptr() as usize,
4421        ))
4422    }
4423    pub fn get_nan_master_pref(&self) -> Result<u8, ErrorContext> {
4424        let mut iter = self.clone();
4425        iter.pos = 0;
4426        for attr in iter {
4427            if let Nl80211Attrs::NanMasterPref(val) = attr? {
4428                return Ok(val);
4429            }
4430        }
4431        Err(ErrorContext::new_missing(
4432            "Nl80211Attrs",
4433            "NanMasterPref",
4434            self.orig_loc,
4435            self.buf.as_ptr() as usize,
4436        ))
4437    }
4438    pub fn get_bands(&self) -> Result<u32, ErrorContext> {
4439        let mut iter = self.clone();
4440        iter.pos = 0;
4441        for attr in iter {
4442            if let Nl80211Attrs::Bands(val) = attr? {
4443                return Ok(val);
4444            }
4445        }
4446        Err(ErrorContext::new_missing(
4447            "Nl80211Attrs",
4448            "Bands",
4449            self.orig_loc,
4450            self.buf.as_ptr() as usize,
4451        ))
4452    }
4453    pub fn get_nan_func(&self) -> Result<&'a [u8], ErrorContext> {
4454        let mut iter = self.clone();
4455        iter.pos = 0;
4456        for attr in iter {
4457            if let Nl80211Attrs::NanFunc(val) = attr? {
4458                return Ok(val);
4459            }
4460        }
4461        Err(ErrorContext::new_missing(
4462            "Nl80211Attrs",
4463            "NanFunc",
4464            self.orig_loc,
4465            self.buf.as_ptr() as usize,
4466        ))
4467    }
4468    pub fn get_nan_match(&self) -> Result<&'a [u8], ErrorContext> {
4469        let mut iter = self.clone();
4470        iter.pos = 0;
4471        for attr in iter {
4472            if let Nl80211Attrs::NanMatch(val) = attr? {
4473                return Ok(val);
4474            }
4475        }
4476        Err(ErrorContext::new_missing(
4477            "Nl80211Attrs",
4478            "NanMatch",
4479            self.orig_loc,
4480            self.buf.as_ptr() as usize,
4481        ))
4482    }
4483    pub fn get_fils_kek(&self) -> Result<&'a [u8], ErrorContext> {
4484        let mut iter = self.clone();
4485        iter.pos = 0;
4486        for attr in iter {
4487            if let Nl80211Attrs::FilsKek(val) = attr? {
4488                return Ok(val);
4489            }
4490        }
4491        Err(ErrorContext::new_missing(
4492            "Nl80211Attrs",
4493            "FilsKek",
4494            self.orig_loc,
4495            self.buf.as_ptr() as usize,
4496        ))
4497    }
4498    pub fn get_fils_nonces(&self) -> Result<&'a [u8], ErrorContext> {
4499        let mut iter = self.clone();
4500        iter.pos = 0;
4501        for attr in iter {
4502            if let Nl80211Attrs::FilsNonces(val) = attr? {
4503                return Ok(val);
4504            }
4505        }
4506        Err(ErrorContext::new_missing(
4507            "Nl80211Attrs",
4508            "FilsNonces",
4509            self.orig_loc,
4510            self.buf.as_ptr() as usize,
4511        ))
4512    }
4513    pub fn get_multicast_to_unicast_enabled(&self) -> Result<(), ErrorContext> {
4514        let mut iter = self.clone();
4515        iter.pos = 0;
4516        for attr in iter {
4517            if let Nl80211Attrs::MulticastToUnicastEnabled(val) = attr? {
4518                return Ok(val);
4519            }
4520        }
4521        Err(ErrorContext::new_missing(
4522            "Nl80211Attrs",
4523            "MulticastToUnicastEnabled",
4524            self.orig_loc,
4525            self.buf.as_ptr() as usize,
4526        ))
4527    }
4528    pub fn get_bssid(&self) -> Result<&'a [u8], ErrorContext> {
4529        let mut iter = self.clone();
4530        iter.pos = 0;
4531        for attr in iter {
4532            if let Nl80211Attrs::Bssid(val) = attr? {
4533                return Ok(val);
4534            }
4535        }
4536        Err(ErrorContext::new_missing(
4537            "Nl80211Attrs",
4538            "Bssid",
4539            self.orig_loc,
4540            self.buf.as_ptr() as usize,
4541        ))
4542    }
4543    pub fn get_sched_scan_relative_rssi(&self) -> Result<i8, ErrorContext> {
4544        let mut iter = self.clone();
4545        iter.pos = 0;
4546        for attr in iter {
4547            if let Nl80211Attrs::SchedScanRelativeRssi(val) = attr? {
4548                return Ok(val);
4549            }
4550        }
4551        Err(ErrorContext::new_missing(
4552            "Nl80211Attrs",
4553            "SchedScanRelativeRssi",
4554            self.orig_loc,
4555            self.buf.as_ptr() as usize,
4556        ))
4557    }
4558    pub fn get_sched_scan_rssi_adjust(&self) -> Result<&'a [u8], ErrorContext> {
4559        let mut iter = self.clone();
4560        iter.pos = 0;
4561        for attr in iter {
4562            if let Nl80211Attrs::SchedScanRssiAdjust(val) = attr? {
4563                return Ok(val);
4564            }
4565        }
4566        Err(ErrorContext::new_missing(
4567            "Nl80211Attrs",
4568            "SchedScanRssiAdjust",
4569            self.orig_loc,
4570            self.buf.as_ptr() as usize,
4571        ))
4572    }
4573    pub fn get_timeout_reason(&self) -> Result<u32, ErrorContext> {
4574        let mut iter = self.clone();
4575        iter.pos = 0;
4576        for attr in iter {
4577            if let Nl80211Attrs::TimeoutReason(val) = attr? {
4578                return Ok(val);
4579            }
4580        }
4581        Err(ErrorContext::new_missing(
4582            "Nl80211Attrs",
4583            "TimeoutReason",
4584            self.orig_loc,
4585            self.buf.as_ptr() as usize,
4586        ))
4587    }
4588    pub fn get_fils_erp_username(&self) -> Result<&'a [u8], ErrorContext> {
4589        let mut iter = self.clone();
4590        iter.pos = 0;
4591        for attr in iter {
4592            if let Nl80211Attrs::FilsErpUsername(val) = attr? {
4593                return Ok(val);
4594            }
4595        }
4596        Err(ErrorContext::new_missing(
4597            "Nl80211Attrs",
4598            "FilsErpUsername",
4599            self.orig_loc,
4600            self.buf.as_ptr() as usize,
4601        ))
4602    }
4603    pub fn get_fils_erp_realm(&self) -> Result<&'a [u8], ErrorContext> {
4604        let mut iter = self.clone();
4605        iter.pos = 0;
4606        for attr in iter {
4607            if let Nl80211Attrs::FilsErpRealm(val) = attr? {
4608                return Ok(val);
4609            }
4610        }
4611        Err(ErrorContext::new_missing(
4612            "Nl80211Attrs",
4613            "FilsErpRealm",
4614            self.orig_loc,
4615            self.buf.as_ptr() as usize,
4616        ))
4617    }
4618    pub fn get_fils_erp_next_seq_num(&self) -> Result<u16, ErrorContext> {
4619        let mut iter = self.clone();
4620        iter.pos = 0;
4621        for attr in iter {
4622            if let Nl80211Attrs::FilsErpNextSeqNum(val) = attr? {
4623                return Ok(val);
4624            }
4625        }
4626        Err(ErrorContext::new_missing(
4627            "Nl80211Attrs",
4628            "FilsErpNextSeqNum",
4629            self.orig_loc,
4630            self.buf.as_ptr() as usize,
4631        ))
4632    }
4633    pub fn get_fils_erp_rrk(&self) -> Result<&'a [u8], ErrorContext> {
4634        let mut iter = self.clone();
4635        iter.pos = 0;
4636        for attr in iter {
4637            if let Nl80211Attrs::FilsErpRrk(val) = attr? {
4638                return Ok(val);
4639            }
4640        }
4641        Err(ErrorContext::new_missing(
4642            "Nl80211Attrs",
4643            "FilsErpRrk",
4644            self.orig_loc,
4645            self.buf.as_ptr() as usize,
4646        ))
4647    }
4648    pub fn get_fils_cache_id(&self) -> Result<&'a [u8], ErrorContext> {
4649        let mut iter = self.clone();
4650        iter.pos = 0;
4651        for attr in iter {
4652            if let Nl80211Attrs::FilsCacheId(val) = attr? {
4653                return Ok(val);
4654            }
4655        }
4656        Err(ErrorContext::new_missing(
4657            "Nl80211Attrs",
4658            "FilsCacheId",
4659            self.orig_loc,
4660            self.buf.as_ptr() as usize,
4661        ))
4662    }
4663    pub fn get_pmk(&self) -> Result<&'a [u8], ErrorContext> {
4664        let mut iter = self.clone();
4665        iter.pos = 0;
4666        for attr in iter {
4667            if let Nl80211Attrs::Pmk(val) = attr? {
4668                return Ok(val);
4669            }
4670        }
4671        Err(ErrorContext::new_missing(
4672            "Nl80211Attrs",
4673            "Pmk",
4674            self.orig_loc,
4675            self.buf.as_ptr() as usize,
4676        ))
4677    }
4678    pub fn get_sched_scan_multi(&self) -> Result<(), ErrorContext> {
4679        let mut iter = self.clone();
4680        iter.pos = 0;
4681        for attr in iter {
4682            if let Nl80211Attrs::SchedScanMulti(val) = attr? {
4683                return Ok(val);
4684            }
4685        }
4686        Err(ErrorContext::new_missing(
4687            "Nl80211Attrs",
4688            "SchedScanMulti",
4689            self.orig_loc,
4690            self.buf.as_ptr() as usize,
4691        ))
4692    }
4693    pub fn get_sched_scan_max_reqs(&self) -> Result<u32, ErrorContext> {
4694        let mut iter = self.clone();
4695        iter.pos = 0;
4696        for attr in iter {
4697            if let Nl80211Attrs::SchedScanMaxReqs(val) = attr? {
4698                return Ok(val);
4699            }
4700        }
4701        Err(ErrorContext::new_missing(
4702            "Nl80211Attrs",
4703            "SchedScanMaxReqs",
4704            self.orig_loc,
4705            self.buf.as_ptr() as usize,
4706        ))
4707    }
4708    pub fn get_want_1x_4way_hs(&self) -> Result<(), ErrorContext> {
4709        let mut iter = self.clone();
4710        iter.pos = 0;
4711        for attr in iter {
4712            if let Nl80211Attrs::Want1x4wayHs(val) = attr? {
4713                return Ok(val);
4714            }
4715        }
4716        Err(ErrorContext::new_missing(
4717            "Nl80211Attrs",
4718            "Want1x4wayHs",
4719            self.orig_loc,
4720            self.buf.as_ptr() as usize,
4721        ))
4722    }
4723    pub fn get_pmkr0_name(&self) -> Result<&'a [u8], ErrorContext> {
4724        let mut iter = self.clone();
4725        iter.pos = 0;
4726        for attr in iter {
4727            if let Nl80211Attrs::Pmkr0Name(val) = attr? {
4728                return Ok(val);
4729            }
4730        }
4731        Err(ErrorContext::new_missing(
4732            "Nl80211Attrs",
4733            "Pmkr0Name",
4734            self.orig_loc,
4735            self.buf.as_ptr() as usize,
4736        ))
4737    }
4738    pub fn get_port_authorized(&self) -> Result<&'a [u8], ErrorContext> {
4739        let mut iter = self.clone();
4740        iter.pos = 0;
4741        for attr in iter {
4742            if let Nl80211Attrs::PortAuthorized(val) = attr? {
4743                return Ok(val);
4744            }
4745        }
4746        Err(ErrorContext::new_missing(
4747            "Nl80211Attrs",
4748            "PortAuthorized",
4749            self.orig_loc,
4750            self.buf.as_ptr() as usize,
4751        ))
4752    }
4753    pub fn get_external_auth_action(&self) -> Result<u32, ErrorContext> {
4754        let mut iter = self.clone();
4755        iter.pos = 0;
4756        for attr in iter {
4757            if let Nl80211Attrs::ExternalAuthAction(val) = attr? {
4758                return Ok(val);
4759            }
4760        }
4761        Err(ErrorContext::new_missing(
4762            "Nl80211Attrs",
4763            "ExternalAuthAction",
4764            self.orig_loc,
4765            self.buf.as_ptr() as usize,
4766        ))
4767    }
4768    pub fn get_external_auth_support(&self) -> Result<(), ErrorContext> {
4769        let mut iter = self.clone();
4770        iter.pos = 0;
4771        for attr in iter {
4772            if let Nl80211Attrs::ExternalAuthSupport(val) = attr? {
4773                return Ok(val);
4774            }
4775        }
4776        Err(ErrorContext::new_missing(
4777            "Nl80211Attrs",
4778            "ExternalAuthSupport",
4779            self.orig_loc,
4780            self.buf.as_ptr() as usize,
4781        ))
4782    }
4783    pub fn get_nss(&self) -> Result<u8, ErrorContext> {
4784        let mut iter = self.clone();
4785        iter.pos = 0;
4786        for attr in iter {
4787            if let Nl80211Attrs::Nss(val) = attr? {
4788                return Ok(val);
4789            }
4790        }
4791        Err(ErrorContext::new_missing(
4792            "Nl80211Attrs",
4793            "Nss",
4794            self.orig_loc,
4795            self.buf.as_ptr() as usize,
4796        ))
4797    }
4798    pub fn get_ack_signal(&self) -> Result<i32, ErrorContext> {
4799        let mut iter = self.clone();
4800        iter.pos = 0;
4801        for attr in iter {
4802            if let Nl80211Attrs::AckSignal(val) = attr? {
4803                return Ok(val);
4804            }
4805        }
4806        Err(ErrorContext::new_missing(
4807            "Nl80211Attrs",
4808            "AckSignal",
4809            self.orig_loc,
4810            self.buf.as_ptr() as usize,
4811        ))
4812    }
4813    pub fn get_control_port_over_nl80211(&self) -> Result<(), ErrorContext> {
4814        let mut iter = self.clone();
4815        iter.pos = 0;
4816        for attr in iter {
4817            if let Nl80211Attrs::ControlPortOverNl80211(val) = attr? {
4818                return Ok(val);
4819            }
4820        }
4821        Err(ErrorContext::new_missing(
4822            "Nl80211Attrs",
4823            "ControlPortOverNl80211",
4824            self.orig_loc,
4825            self.buf.as_ptr() as usize,
4826        ))
4827    }
4828    pub fn get_txq_stats(&self) -> Result<IterableTxqStatsAttrs<'a>, ErrorContext> {
4829        let mut iter = self.clone();
4830        iter.pos = 0;
4831        for attr in iter {
4832            if let Nl80211Attrs::TxqStats(val) = attr? {
4833                return Ok(val);
4834            }
4835        }
4836        Err(ErrorContext::new_missing(
4837            "Nl80211Attrs",
4838            "TxqStats",
4839            self.orig_loc,
4840            self.buf.as_ptr() as usize,
4841        ))
4842    }
4843    pub fn get_txq_limit(&self) -> Result<u32, ErrorContext> {
4844        let mut iter = self.clone();
4845        iter.pos = 0;
4846        for attr in iter {
4847            if let Nl80211Attrs::TxqLimit(val) = attr? {
4848                return Ok(val);
4849            }
4850        }
4851        Err(ErrorContext::new_missing(
4852            "Nl80211Attrs",
4853            "TxqLimit",
4854            self.orig_loc,
4855            self.buf.as_ptr() as usize,
4856        ))
4857    }
4858    pub fn get_txq_memory_limit(&self) -> Result<u32, ErrorContext> {
4859        let mut iter = self.clone();
4860        iter.pos = 0;
4861        for attr in iter {
4862            if let Nl80211Attrs::TxqMemoryLimit(val) = attr? {
4863                return Ok(val);
4864            }
4865        }
4866        Err(ErrorContext::new_missing(
4867            "Nl80211Attrs",
4868            "TxqMemoryLimit",
4869            self.orig_loc,
4870            self.buf.as_ptr() as usize,
4871        ))
4872    }
4873    pub fn get_txq_quantum(&self) -> Result<u32, ErrorContext> {
4874        let mut iter = self.clone();
4875        iter.pos = 0;
4876        for attr in iter {
4877            if let Nl80211Attrs::TxqQuantum(val) = attr? {
4878                return Ok(val);
4879            }
4880        }
4881        Err(ErrorContext::new_missing(
4882            "Nl80211Attrs",
4883            "TxqQuantum",
4884            self.orig_loc,
4885            self.buf.as_ptr() as usize,
4886        ))
4887    }
4888    pub fn get_he_capability(&self) -> Result<&'a [u8], ErrorContext> {
4889        let mut iter = self.clone();
4890        iter.pos = 0;
4891        for attr in iter {
4892            if let Nl80211Attrs::HeCapability(val) = attr? {
4893                return Ok(val);
4894            }
4895        }
4896        Err(ErrorContext::new_missing(
4897            "Nl80211Attrs",
4898            "HeCapability",
4899            self.orig_loc,
4900            self.buf.as_ptr() as usize,
4901        ))
4902    }
4903    pub fn get_ftm_responder(&self) -> Result<&'a [u8], ErrorContext> {
4904        let mut iter = self.clone();
4905        iter.pos = 0;
4906        for attr in iter {
4907            if let Nl80211Attrs::FtmResponder(val) = attr? {
4908                return Ok(val);
4909            }
4910        }
4911        Err(ErrorContext::new_missing(
4912            "Nl80211Attrs",
4913            "FtmResponder",
4914            self.orig_loc,
4915            self.buf.as_ptr() as usize,
4916        ))
4917    }
4918    pub fn get_ftm_responder_stats(&self) -> Result<&'a [u8], ErrorContext> {
4919        let mut iter = self.clone();
4920        iter.pos = 0;
4921        for attr in iter {
4922            if let Nl80211Attrs::FtmResponderStats(val) = attr? {
4923                return Ok(val);
4924            }
4925        }
4926        Err(ErrorContext::new_missing(
4927            "Nl80211Attrs",
4928            "FtmResponderStats",
4929            self.orig_loc,
4930            self.buf.as_ptr() as usize,
4931        ))
4932    }
4933    pub fn get_timeout(&self) -> Result<u32, ErrorContext> {
4934        let mut iter = self.clone();
4935        iter.pos = 0;
4936        for attr in iter {
4937            if let Nl80211Attrs::Timeout(val) = attr? {
4938                return Ok(val);
4939            }
4940        }
4941        Err(ErrorContext::new_missing(
4942            "Nl80211Attrs",
4943            "Timeout",
4944            self.orig_loc,
4945            self.buf.as_ptr() as usize,
4946        ))
4947    }
4948    pub fn get_peer_measurements(&self) -> Result<&'a [u8], ErrorContext> {
4949        let mut iter = self.clone();
4950        iter.pos = 0;
4951        for attr in iter {
4952            if let Nl80211Attrs::PeerMeasurements(val) = attr? {
4953                return Ok(val);
4954            }
4955        }
4956        Err(ErrorContext::new_missing(
4957            "Nl80211Attrs",
4958            "PeerMeasurements",
4959            self.orig_loc,
4960            self.buf.as_ptr() as usize,
4961        ))
4962    }
4963    pub fn get_airtime_weight(&self) -> Result<u16, ErrorContext> {
4964        let mut iter = self.clone();
4965        iter.pos = 0;
4966        for attr in iter {
4967            if let Nl80211Attrs::AirtimeWeight(val) = attr? {
4968                return Ok(val);
4969            }
4970        }
4971        Err(ErrorContext::new_missing(
4972            "Nl80211Attrs",
4973            "AirtimeWeight",
4974            self.orig_loc,
4975            self.buf.as_ptr() as usize,
4976        ))
4977    }
4978    pub fn get_sta_tx_power_setting(&self) -> Result<u8, ErrorContext> {
4979        let mut iter = self.clone();
4980        iter.pos = 0;
4981        for attr in iter {
4982            if let Nl80211Attrs::StaTxPowerSetting(val) = attr? {
4983                return Ok(val);
4984            }
4985        }
4986        Err(ErrorContext::new_missing(
4987            "Nl80211Attrs",
4988            "StaTxPowerSetting",
4989            self.orig_loc,
4990            self.buf.as_ptr() as usize,
4991        ))
4992    }
4993    pub fn get_sta_tx_power(&self) -> Result<i16, ErrorContext> {
4994        let mut iter = self.clone();
4995        iter.pos = 0;
4996        for attr in iter {
4997            if let Nl80211Attrs::StaTxPower(val) = attr? {
4998                return Ok(val);
4999            }
5000        }
5001        Err(ErrorContext::new_missing(
5002            "Nl80211Attrs",
5003            "StaTxPower",
5004            self.orig_loc,
5005            self.buf.as_ptr() as usize,
5006        ))
5007    }
5008    pub fn get_sae_password(&self) -> Result<&'a [u8], ErrorContext> {
5009        let mut iter = self.clone();
5010        iter.pos = 0;
5011        for attr in iter {
5012            if let Nl80211Attrs::SaePassword(val) = attr? {
5013                return Ok(val);
5014            }
5015        }
5016        Err(ErrorContext::new_missing(
5017            "Nl80211Attrs",
5018            "SaePassword",
5019            self.orig_loc,
5020            self.buf.as_ptr() as usize,
5021        ))
5022    }
5023    pub fn get_twt_responder(&self) -> Result<(), ErrorContext> {
5024        let mut iter = self.clone();
5025        iter.pos = 0;
5026        for attr in iter {
5027            if let Nl80211Attrs::TwtResponder(val) = attr? {
5028                return Ok(val);
5029            }
5030        }
5031        Err(ErrorContext::new_missing(
5032            "Nl80211Attrs",
5033            "TwtResponder",
5034            self.orig_loc,
5035            self.buf.as_ptr() as usize,
5036        ))
5037    }
5038    pub fn get_he_obss_pd(&self) -> Result<&'a [u8], ErrorContext> {
5039        let mut iter = self.clone();
5040        iter.pos = 0;
5041        for attr in iter {
5042            if let Nl80211Attrs::HeObssPd(val) = attr? {
5043                return Ok(val);
5044            }
5045        }
5046        Err(ErrorContext::new_missing(
5047            "Nl80211Attrs",
5048            "HeObssPd",
5049            self.orig_loc,
5050            self.buf.as_ptr() as usize,
5051        ))
5052    }
5053    pub fn get_wiphy_edmg_channels(&self) -> Result<u8, ErrorContext> {
5054        let mut iter = self.clone();
5055        iter.pos = 0;
5056        for attr in iter {
5057            if let Nl80211Attrs::WiphyEdmgChannels(val) = attr? {
5058                return Ok(val);
5059            }
5060        }
5061        Err(ErrorContext::new_missing(
5062            "Nl80211Attrs",
5063            "WiphyEdmgChannels",
5064            self.orig_loc,
5065            self.buf.as_ptr() as usize,
5066        ))
5067    }
5068    pub fn get_wiphy_edmg_bw_config(&self) -> Result<u8, ErrorContext> {
5069        let mut iter = self.clone();
5070        iter.pos = 0;
5071        for attr in iter {
5072            if let Nl80211Attrs::WiphyEdmgBwConfig(val) = attr? {
5073                return Ok(val);
5074            }
5075        }
5076        Err(ErrorContext::new_missing(
5077            "Nl80211Attrs",
5078            "WiphyEdmgBwConfig",
5079            self.orig_loc,
5080            self.buf.as_ptr() as usize,
5081        ))
5082    }
5083    pub fn get_vlan_id(&self) -> Result<u16, ErrorContext> {
5084        let mut iter = self.clone();
5085        iter.pos = 0;
5086        for attr in iter {
5087            if let Nl80211Attrs::VlanId(val) = attr? {
5088                return Ok(val);
5089            }
5090        }
5091        Err(ErrorContext::new_missing(
5092            "Nl80211Attrs",
5093            "VlanId",
5094            self.orig_loc,
5095            self.buf.as_ptr() as usize,
5096        ))
5097    }
5098    pub fn get_he_bss_color(&self) -> Result<&'a [u8], ErrorContext> {
5099        let mut iter = self.clone();
5100        iter.pos = 0;
5101        for attr in iter {
5102            if let Nl80211Attrs::HeBssColor(val) = attr? {
5103                return Ok(val);
5104            }
5105        }
5106        Err(ErrorContext::new_missing(
5107            "Nl80211Attrs",
5108            "HeBssColor",
5109            self.orig_loc,
5110            self.buf.as_ptr() as usize,
5111        ))
5112    }
5113    pub fn get_iftype_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
5114        let mut iter = self.clone();
5115        iter.pos = 0;
5116        for attr in iter {
5117            if let Nl80211Attrs::IftypeAkmSuites(val) = attr? {
5118                return Ok(val);
5119            }
5120        }
5121        Err(ErrorContext::new_missing(
5122            "Nl80211Attrs",
5123            "IftypeAkmSuites",
5124            self.orig_loc,
5125            self.buf.as_ptr() as usize,
5126        ))
5127    }
5128    pub fn get_tid_config(&self) -> Result<&'a [u8], ErrorContext> {
5129        let mut iter = self.clone();
5130        iter.pos = 0;
5131        for attr in iter {
5132            if let Nl80211Attrs::TidConfig(val) = attr? {
5133                return Ok(val);
5134            }
5135        }
5136        Err(ErrorContext::new_missing(
5137            "Nl80211Attrs",
5138            "TidConfig",
5139            self.orig_loc,
5140            self.buf.as_ptr() as usize,
5141        ))
5142    }
5143    pub fn get_control_port_no_preauth(&self) -> Result<(), ErrorContext> {
5144        let mut iter = self.clone();
5145        iter.pos = 0;
5146        for attr in iter {
5147            if let Nl80211Attrs::ControlPortNoPreauth(val) = attr? {
5148                return Ok(val);
5149            }
5150        }
5151        Err(ErrorContext::new_missing(
5152            "Nl80211Attrs",
5153            "ControlPortNoPreauth",
5154            self.orig_loc,
5155            self.buf.as_ptr() as usize,
5156        ))
5157    }
5158    pub fn get_pmk_lifetime(&self) -> Result<u32, ErrorContext> {
5159        let mut iter = self.clone();
5160        iter.pos = 0;
5161        for attr in iter {
5162            if let Nl80211Attrs::PmkLifetime(val) = attr? {
5163                return Ok(val);
5164            }
5165        }
5166        Err(ErrorContext::new_missing(
5167            "Nl80211Attrs",
5168            "PmkLifetime",
5169            self.orig_loc,
5170            self.buf.as_ptr() as usize,
5171        ))
5172    }
5173    pub fn get_pmk_reauth_threshold(&self) -> Result<u8, ErrorContext> {
5174        let mut iter = self.clone();
5175        iter.pos = 0;
5176        for attr in iter {
5177            if let Nl80211Attrs::PmkReauthThreshold(val) = attr? {
5178                return Ok(val);
5179            }
5180        }
5181        Err(ErrorContext::new_missing(
5182            "Nl80211Attrs",
5183            "PmkReauthThreshold",
5184            self.orig_loc,
5185            self.buf.as_ptr() as usize,
5186        ))
5187    }
5188    pub fn get_receive_multicast(&self) -> Result<(), ErrorContext> {
5189        let mut iter = self.clone();
5190        iter.pos = 0;
5191        for attr in iter {
5192            if let Nl80211Attrs::ReceiveMulticast(val) = attr? {
5193                return Ok(val);
5194            }
5195        }
5196        Err(ErrorContext::new_missing(
5197            "Nl80211Attrs",
5198            "ReceiveMulticast",
5199            self.orig_loc,
5200            self.buf.as_ptr() as usize,
5201        ))
5202    }
5203    pub fn get_wiphy_freq_offset(&self) -> Result<u32, ErrorContext> {
5204        let mut iter = self.clone();
5205        iter.pos = 0;
5206        for attr in iter {
5207            if let Nl80211Attrs::WiphyFreqOffset(val) = attr? {
5208                return Ok(val);
5209            }
5210        }
5211        Err(ErrorContext::new_missing(
5212            "Nl80211Attrs",
5213            "WiphyFreqOffset",
5214            self.orig_loc,
5215            self.buf.as_ptr() as usize,
5216        ))
5217    }
5218    pub fn get_center_freq1_offset(&self) -> Result<u32, ErrorContext> {
5219        let mut iter = self.clone();
5220        iter.pos = 0;
5221        for attr in iter {
5222            if let Nl80211Attrs::CenterFreq1Offset(val) = attr? {
5223                return Ok(val);
5224            }
5225        }
5226        Err(ErrorContext::new_missing(
5227            "Nl80211Attrs",
5228            "CenterFreq1Offset",
5229            self.orig_loc,
5230            self.buf.as_ptr() as usize,
5231        ))
5232    }
5233    pub fn get_scan_freq_khz(&self) -> Result<&'a [u8], ErrorContext> {
5234        let mut iter = self.clone();
5235        iter.pos = 0;
5236        for attr in iter {
5237            if let Nl80211Attrs::ScanFreqKhz(val) = attr? {
5238                return Ok(val);
5239            }
5240        }
5241        Err(ErrorContext::new_missing(
5242            "Nl80211Attrs",
5243            "ScanFreqKhz",
5244            self.orig_loc,
5245            self.buf.as_ptr() as usize,
5246        ))
5247    }
5248    pub fn get_he_6ghz_capability(&self) -> Result<&'a [u8], ErrorContext> {
5249        let mut iter = self.clone();
5250        iter.pos = 0;
5251        for attr in iter {
5252            if let Nl80211Attrs::He6ghzCapability(val) = attr? {
5253                return Ok(val);
5254            }
5255        }
5256        Err(ErrorContext::new_missing(
5257            "Nl80211Attrs",
5258            "He6ghzCapability",
5259            self.orig_loc,
5260            self.buf.as_ptr() as usize,
5261        ))
5262    }
5263    pub fn get_fils_discovery(&self) -> Result<&'a [u8], ErrorContext> {
5264        let mut iter = self.clone();
5265        iter.pos = 0;
5266        for attr in iter {
5267            if let Nl80211Attrs::FilsDiscovery(val) = attr? {
5268                return Ok(val);
5269            }
5270        }
5271        Err(ErrorContext::new_missing(
5272            "Nl80211Attrs",
5273            "FilsDiscovery",
5274            self.orig_loc,
5275            self.buf.as_ptr() as usize,
5276        ))
5277    }
5278    pub fn get_unsol_bcast_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
5279        let mut iter = self.clone();
5280        iter.pos = 0;
5281        for attr in iter {
5282            if let Nl80211Attrs::UnsolBcastProbeResp(val) = attr? {
5283                return Ok(val);
5284            }
5285        }
5286        Err(ErrorContext::new_missing(
5287            "Nl80211Attrs",
5288            "UnsolBcastProbeResp",
5289            self.orig_loc,
5290            self.buf.as_ptr() as usize,
5291        ))
5292    }
5293    pub fn get_s1g_capability(&self) -> Result<&'a [u8], ErrorContext> {
5294        let mut iter = self.clone();
5295        iter.pos = 0;
5296        for attr in iter {
5297            if let Nl80211Attrs::S1gCapability(val) = attr? {
5298                return Ok(val);
5299            }
5300        }
5301        Err(ErrorContext::new_missing(
5302            "Nl80211Attrs",
5303            "S1gCapability",
5304            self.orig_loc,
5305            self.buf.as_ptr() as usize,
5306        ))
5307    }
5308    pub fn get_s1g_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
5309        let mut iter = self.clone();
5310        iter.pos = 0;
5311        for attr in iter {
5312            if let Nl80211Attrs::S1gCapabilityMask(val) = attr? {
5313                return Ok(val);
5314            }
5315        }
5316        Err(ErrorContext::new_missing(
5317            "Nl80211Attrs",
5318            "S1gCapabilityMask",
5319            self.orig_loc,
5320            self.buf.as_ptr() as usize,
5321        ))
5322    }
5323    pub fn get_sae_pwe(&self) -> Result<u8, ErrorContext> {
5324        let mut iter = self.clone();
5325        iter.pos = 0;
5326        for attr in iter {
5327            if let Nl80211Attrs::SaePwe(val) = attr? {
5328                return Ok(val);
5329            }
5330        }
5331        Err(ErrorContext::new_missing(
5332            "Nl80211Attrs",
5333            "SaePwe",
5334            self.orig_loc,
5335            self.buf.as_ptr() as usize,
5336        ))
5337    }
5338    pub fn get_reconnect_requested(&self) -> Result<&'a [u8], ErrorContext> {
5339        let mut iter = self.clone();
5340        iter.pos = 0;
5341        for attr in iter {
5342            if let Nl80211Attrs::ReconnectRequested(val) = attr? {
5343                return Ok(val);
5344            }
5345        }
5346        Err(ErrorContext::new_missing(
5347            "Nl80211Attrs",
5348            "ReconnectRequested",
5349            self.orig_loc,
5350            self.buf.as_ptr() as usize,
5351        ))
5352    }
5353    pub fn get_sar_spec(&self) -> Result<IterableSarAttributes<'a>, ErrorContext> {
5354        let mut iter = self.clone();
5355        iter.pos = 0;
5356        for attr in iter {
5357            if let Nl80211Attrs::SarSpec(val) = attr? {
5358                return Ok(val);
5359            }
5360        }
5361        Err(ErrorContext::new_missing(
5362            "Nl80211Attrs",
5363            "SarSpec",
5364            self.orig_loc,
5365            self.buf.as_ptr() as usize,
5366        ))
5367    }
5368    pub fn get_disable_he(&self) -> Result<(), ErrorContext> {
5369        let mut iter = self.clone();
5370        iter.pos = 0;
5371        for attr in iter {
5372            if let Nl80211Attrs::DisableHe(val) = attr? {
5373                return Ok(val);
5374            }
5375        }
5376        Err(ErrorContext::new_missing(
5377            "Nl80211Attrs",
5378            "DisableHe",
5379            self.orig_loc,
5380            self.buf.as_ptr() as usize,
5381        ))
5382    }
5383    pub fn get_obss_color_bitmap(&self) -> Result<u64, ErrorContext> {
5384        let mut iter = self.clone();
5385        iter.pos = 0;
5386        for attr in iter {
5387            if let Nl80211Attrs::ObssColorBitmap(val) = attr? {
5388                return Ok(val);
5389            }
5390        }
5391        Err(ErrorContext::new_missing(
5392            "Nl80211Attrs",
5393            "ObssColorBitmap",
5394            self.orig_loc,
5395            self.buf.as_ptr() as usize,
5396        ))
5397    }
5398    pub fn get_color_change_count(&self) -> Result<u8, ErrorContext> {
5399        let mut iter = self.clone();
5400        iter.pos = 0;
5401        for attr in iter {
5402            if let Nl80211Attrs::ColorChangeCount(val) = attr? {
5403                return Ok(val);
5404            }
5405        }
5406        Err(ErrorContext::new_missing(
5407            "Nl80211Attrs",
5408            "ColorChangeCount",
5409            self.orig_loc,
5410            self.buf.as_ptr() as usize,
5411        ))
5412    }
5413    pub fn get_color_change_color(&self) -> Result<u8, ErrorContext> {
5414        let mut iter = self.clone();
5415        iter.pos = 0;
5416        for attr in iter {
5417            if let Nl80211Attrs::ColorChangeColor(val) = attr? {
5418                return Ok(val);
5419            }
5420        }
5421        Err(ErrorContext::new_missing(
5422            "Nl80211Attrs",
5423            "ColorChangeColor",
5424            self.orig_loc,
5425            self.buf.as_ptr() as usize,
5426        ))
5427    }
5428    pub fn get_color_change_elems(&self) -> Result<&'a [u8], ErrorContext> {
5429        let mut iter = self.clone();
5430        iter.pos = 0;
5431        for attr in iter {
5432            if let Nl80211Attrs::ColorChangeElems(val) = attr? {
5433                return Ok(val);
5434            }
5435        }
5436        Err(ErrorContext::new_missing(
5437            "Nl80211Attrs",
5438            "ColorChangeElems",
5439            self.orig_loc,
5440            self.buf.as_ptr() as usize,
5441        ))
5442    }
5443    pub fn get_mbssid_config(&self) -> Result<&'a [u8], ErrorContext> {
5444        let mut iter = self.clone();
5445        iter.pos = 0;
5446        for attr in iter {
5447            if let Nl80211Attrs::MbssidConfig(val) = attr? {
5448                return Ok(val);
5449            }
5450        }
5451        Err(ErrorContext::new_missing(
5452            "Nl80211Attrs",
5453            "MbssidConfig",
5454            self.orig_loc,
5455            self.buf.as_ptr() as usize,
5456        ))
5457    }
5458    pub fn get_mbssid_elems(&self) -> Result<&'a [u8], ErrorContext> {
5459        let mut iter = self.clone();
5460        iter.pos = 0;
5461        for attr in iter {
5462            if let Nl80211Attrs::MbssidElems(val) = attr? {
5463                return Ok(val);
5464            }
5465        }
5466        Err(ErrorContext::new_missing(
5467            "Nl80211Attrs",
5468            "MbssidElems",
5469            self.orig_loc,
5470            self.buf.as_ptr() as usize,
5471        ))
5472    }
5473    pub fn get_radar_background(&self) -> Result<(), ErrorContext> {
5474        let mut iter = self.clone();
5475        iter.pos = 0;
5476        for attr in iter {
5477            if let Nl80211Attrs::RadarBackground(val) = attr? {
5478                return Ok(val);
5479            }
5480        }
5481        Err(ErrorContext::new_missing(
5482            "Nl80211Attrs",
5483            "RadarBackground",
5484            self.orig_loc,
5485            self.buf.as_ptr() as usize,
5486        ))
5487    }
5488    pub fn get_ap_settings_flags(&self) -> Result<u32, ErrorContext> {
5489        let mut iter = self.clone();
5490        iter.pos = 0;
5491        for attr in iter {
5492            if let Nl80211Attrs::ApSettingsFlags(val) = attr? {
5493                return Ok(val);
5494            }
5495        }
5496        Err(ErrorContext::new_missing(
5497            "Nl80211Attrs",
5498            "ApSettingsFlags",
5499            self.orig_loc,
5500            self.buf.as_ptr() as usize,
5501        ))
5502    }
5503    pub fn get_eht_capability(&self) -> Result<&'a [u8], ErrorContext> {
5504        let mut iter = self.clone();
5505        iter.pos = 0;
5506        for attr in iter {
5507            if let Nl80211Attrs::EhtCapability(val) = attr? {
5508                return Ok(val);
5509            }
5510        }
5511        Err(ErrorContext::new_missing(
5512            "Nl80211Attrs",
5513            "EhtCapability",
5514            self.orig_loc,
5515            self.buf.as_ptr() as usize,
5516        ))
5517    }
5518    pub fn get_disable_eht(&self) -> Result<(), ErrorContext> {
5519        let mut iter = self.clone();
5520        iter.pos = 0;
5521        for attr in iter {
5522            if let Nl80211Attrs::DisableEht(val) = attr? {
5523                return Ok(val);
5524            }
5525        }
5526        Err(ErrorContext::new_missing(
5527            "Nl80211Attrs",
5528            "DisableEht",
5529            self.orig_loc,
5530            self.buf.as_ptr() as usize,
5531        ))
5532    }
5533    pub fn get_mlo_links(&self) -> Result<&'a [u8], ErrorContext> {
5534        let mut iter = self.clone();
5535        iter.pos = 0;
5536        for attr in iter {
5537            if let Nl80211Attrs::MloLinks(val) = attr? {
5538                return Ok(val);
5539            }
5540        }
5541        Err(ErrorContext::new_missing(
5542            "Nl80211Attrs",
5543            "MloLinks",
5544            self.orig_loc,
5545            self.buf.as_ptr() as usize,
5546        ))
5547    }
5548    pub fn get_mlo_link_id(&self) -> Result<u8, ErrorContext> {
5549        let mut iter = self.clone();
5550        iter.pos = 0;
5551        for attr in iter {
5552            if let Nl80211Attrs::MloLinkId(val) = attr? {
5553                return Ok(val);
5554            }
5555        }
5556        Err(ErrorContext::new_missing(
5557            "Nl80211Attrs",
5558            "MloLinkId",
5559            self.orig_loc,
5560            self.buf.as_ptr() as usize,
5561        ))
5562    }
5563    pub fn get_mld_addr(&self) -> Result<&'a [u8], ErrorContext> {
5564        let mut iter = self.clone();
5565        iter.pos = 0;
5566        for attr in iter {
5567            if let Nl80211Attrs::MldAddr(val) = attr? {
5568                return Ok(val);
5569            }
5570        }
5571        Err(ErrorContext::new_missing(
5572            "Nl80211Attrs",
5573            "MldAddr",
5574            self.orig_loc,
5575            self.buf.as_ptr() as usize,
5576        ))
5577    }
5578    pub fn get_mlo_support(&self) -> Result<(), ErrorContext> {
5579        let mut iter = self.clone();
5580        iter.pos = 0;
5581        for attr in iter {
5582            if let Nl80211Attrs::MloSupport(val) = attr? {
5583                return Ok(val);
5584            }
5585        }
5586        Err(ErrorContext::new_missing(
5587            "Nl80211Attrs",
5588            "MloSupport",
5589            self.orig_loc,
5590            self.buf.as_ptr() as usize,
5591        ))
5592    }
5593    pub fn get_max_num_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
5594        let mut iter = self.clone();
5595        iter.pos = 0;
5596        for attr in iter {
5597            if let Nl80211Attrs::MaxNumAkmSuites(val) = attr? {
5598                return Ok(val);
5599            }
5600        }
5601        Err(ErrorContext::new_missing(
5602            "Nl80211Attrs",
5603            "MaxNumAkmSuites",
5604            self.orig_loc,
5605            self.buf.as_ptr() as usize,
5606        ))
5607    }
5608    pub fn get_eml_capability(&self) -> Result<u16, ErrorContext> {
5609        let mut iter = self.clone();
5610        iter.pos = 0;
5611        for attr in iter {
5612            if let Nl80211Attrs::EmlCapability(val) = attr? {
5613                return Ok(val);
5614            }
5615        }
5616        Err(ErrorContext::new_missing(
5617            "Nl80211Attrs",
5618            "EmlCapability",
5619            self.orig_loc,
5620            self.buf.as_ptr() as usize,
5621        ))
5622    }
5623    pub fn get_mld_capa_and_ops(&self) -> Result<u16, ErrorContext> {
5624        let mut iter = self.clone();
5625        iter.pos = 0;
5626        for attr in iter {
5627            if let Nl80211Attrs::MldCapaAndOps(val) = attr? {
5628                return Ok(val);
5629            }
5630        }
5631        Err(ErrorContext::new_missing(
5632            "Nl80211Attrs",
5633            "MldCapaAndOps",
5634            self.orig_loc,
5635            self.buf.as_ptr() as usize,
5636        ))
5637    }
5638    pub fn get_tx_hw_timestamp(&self) -> Result<u64, ErrorContext> {
5639        let mut iter = self.clone();
5640        iter.pos = 0;
5641        for attr in iter {
5642            if let Nl80211Attrs::TxHwTimestamp(val) = attr? {
5643                return Ok(val);
5644            }
5645        }
5646        Err(ErrorContext::new_missing(
5647            "Nl80211Attrs",
5648            "TxHwTimestamp",
5649            self.orig_loc,
5650            self.buf.as_ptr() as usize,
5651        ))
5652    }
5653    pub fn get_rx_hw_timestamp(&self) -> Result<u64, ErrorContext> {
5654        let mut iter = self.clone();
5655        iter.pos = 0;
5656        for attr in iter {
5657            if let Nl80211Attrs::RxHwTimestamp(val) = attr? {
5658                return Ok(val);
5659            }
5660        }
5661        Err(ErrorContext::new_missing(
5662            "Nl80211Attrs",
5663            "RxHwTimestamp",
5664            self.orig_loc,
5665            self.buf.as_ptr() as usize,
5666        ))
5667    }
5668    pub fn get_td_bitmap(&self) -> Result<&'a [u8], ErrorContext> {
5669        let mut iter = self.clone();
5670        iter.pos = 0;
5671        for attr in iter {
5672            if let Nl80211Attrs::TdBitmap(val) = attr? {
5673                return Ok(val);
5674            }
5675        }
5676        Err(ErrorContext::new_missing(
5677            "Nl80211Attrs",
5678            "TdBitmap",
5679            self.orig_loc,
5680            self.buf.as_ptr() as usize,
5681        ))
5682    }
5683    pub fn get_punct_bitmap(&self) -> Result<u32, ErrorContext> {
5684        let mut iter = self.clone();
5685        iter.pos = 0;
5686        for attr in iter {
5687            if let Nl80211Attrs::PunctBitmap(val) = attr? {
5688                return Ok(val);
5689            }
5690        }
5691        Err(ErrorContext::new_missing(
5692            "Nl80211Attrs",
5693            "PunctBitmap",
5694            self.orig_loc,
5695            self.buf.as_ptr() as usize,
5696        ))
5697    }
5698    pub fn get_max_hw_timestamp_peers(&self) -> Result<u16, ErrorContext> {
5699        let mut iter = self.clone();
5700        iter.pos = 0;
5701        for attr in iter {
5702            if let Nl80211Attrs::MaxHwTimestampPeers(val) = attr? {
5703                return Ok(val);
5704            }
5705        }
5706        Err(ErrorContext::new_missing(
5707            "Nl80211Attrs",
5708            "MaxHwTimestampPeers",
5709            self.orig_loc,
5710            self.buf.as_ptr() as usize,
5711        ))
5712    }
5713    pub fn get_hw_timestamp_enabled(&self) -> Result<(), ErrorContext> {
5714        let mut iter = self.clone();
5715        iter.pos = 0;
5716        for attr in iter {
5717            if let Nl80211Attrs::HwTimestampEnabled(val) = attr? {
5718                return Ok(val);
5719            }
5720        }
5721        Err(ErrorContext::new_missing(
5722            "Nl80211Attrs",
5723            "HwTimestampEnabled",
5724            self.orig_loc,
5725            self.buf.as_ptr() as usize,
5726        ))
5727    }
5728    pub fn get_ema_rnr_elems(&self) -> Result<&'a [u8], ErrorContext> {
5729        let mut iter = self.clone();
5730        iter.pos = 0;
5731        for attr in iter {
5732            if let Nl80211Attrs::EmaRnrElems(val) = attr? {
5733                return Ok(val);
5734            }
5735        }
5736        Err(ErrorContext::new_missing(
5737            "Nl80211Attrs",
5738            "EmaRnrElems",
5739            self.orig_loc,
5740            self.buf.as_ptr() as usize,
5741        ))
5742    }
5743    pub fn get_mlo_link_disabled(&self) -> Result<(), ErrorContext> {
5744        let mut iter = self.clone();
5745        iter.pos = 0;
5746        for attr in iter {
5747            if let Nl80211Attrs::MloLinkDisabled(val) = attr? {
5748                return Ok(val);
5749            }
5750        }
5751        Err(ErrorContext::new_missing(
5752            "Nl80211Attrs",
5753            "MloLinkDisabled",
5754            self.orig_loc,
5755            self.buf.as_ptr() as usize,
5756        ))
5757    }
5758    pub fn get_bss_dump_include_use_data(&self) -> Result<(), ErrorContext> {
5759        let mut iter = self.clone();
5760        iter.pos = 0;
5761        for attr in iter {
5762            if let Nl80211Attrs::BssDumpIncludeUseData(val) = attr? {
5763                return Ok(val);
5764            }
5765        }
5766        Err(ErrorContext::new_missing(
5767            "Nl80211Attrs",
5768            "BssDumpIncludeUseData",
5769            self.orig_loc,
5770            self.buf.as_ptr() as usize,
5771        ))
5772    }
5773    pub fn get_mlo_ttlm_dlink(&self) -> Result<u16, ErrorContext> {
5774        let mut iter = self.clone();
5775        iter.pos = 0;
5776        for attr in iter {
5777            if let Nl80211Attrs::MloTtlmDlink(val) = attr? {
5778                return Ok(val);
5779            }
5780        }
5781        Err(ErrorContext::new_missing(
5782            "Nl80211Attrs",
5783            "MloTtlmDlink",
5784            self.orig_loc,
5785            self.buf.as_ptr() as usize,
5786        ))
5787    }
5788    pub fn get_mlo_ttlm_ulink(&self) -> Result<u16, ErrorContext> {
5789        let mut iter = self.clone();
5790        iter.pos = 0;
5791        for attr in iter {
5792            if let Nl80211Attrs::MloTtlmUlink(val) = attr? {
5793                return Ok(val);
5794            }
5795        }
5796        Err(ErrorContext::new_missing(
5797            "Nl80211Attrs",
5798            "MloTtlmUlink",
5799            self.orig_loc,
5800            self.buf.as_ptr() as usize,
5801        ))
5802    }
5803    pub fn get_assoc_spp_amsdu(&self) -> Result<(), ErrorContext> {
5804        let mut iter = self.clone();
5805        iter.pos = 0;
5806        for attr in iter {
5807            if let Nl80211Attrs::AssocSppAmsdu(val) = attr? {
5808                return Ok(val);
5809            }
5810        }
5811        Err(ErrorContext::new_missing(
5812            "Nl80211Attrs",
5813            "AssocSppAmsdu",
5814            self.orig_loc,
5815            self.buf.as_ptr() as usize,
5816        ))
5817    }
5818    pub fn get_wiphy_radios(&self) -> Result<&'a [u8], ErrorContext> {
5819        let mut iter = self.clone();
5820        iter.pos = 0;
5821        for attr in iter {
5822            if let Nl80211Attrs::WiphyRadios(val) = attr? {
5823                return Ok(val);
5824            }
5825        }
5826        Err(ErrorContext::new_missing(
5827            "Nl80211Attrs",
5828            "WiphyRadios",
5829            self.orig_loc,
5830            self.buf.as_ptr() as usize,
5831        ))
5832    }
5833    pub fn get_wiphy_interface_combinations(&self) -> Result<&'a [u8], ErrorContext> {
5834        let mut iter = self.clone();
5835        iter.pos = 0;
5836        for attr in iter {
5837            if let Nl80211Attrs::WiphyInterfaceCombinations(val) = attr? {
5838                return Ok(val);
5839            }
5840        }
5841        Err(ErrorContext::new_missing(
5842            "Nl80211Attrs",
5843            "WiphyInterfaceCombinations",
5844            self.orig_loc,
5845            self.buf.as_ptr() as usize,
5846        ))
5847    }
5848    pub fn get_vif_radio_mask(&self) -> Result<u32, ErrorContext> {
5849        let mut iter = self.clone();
5850        iter.pos = 0;
5851        for attr in iter {
5852            if let Nl80211Attrs::VifRadioMask(val) = attr? {
5853                return Ok(val);
5854            }
5855        }
5856        Err(ErrorContext::new_missing(
5857            "Nl80211Attrs",
5858            "VifRadioMask",
5859            self.orig_loc,
5860            self.buf.as_ptr() as usize,
5861        ))
5862    }
5863}
5864#[derive(Clone, Copy, Default)]
5865pub struct IterableArrayU32<'a> {
5866    buf: &'a [u8],
5867    pos: usize,
5868    orig_loc: usize,
5869}
5870impl<'a> IterableArrayU32<'a> {
5871    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
5872        Self {
5873            buf,
5874            pos: 0,
5875            orig_loc,
5876        }
5877    }
5878    pub fn get_buf(&self) -> &'a [u8] {
5879        self.buf
5880    }
5881}
5882impl<'a> Iterator for IterableArrayU32<'a> {
5883    type Item = Result<u32, ErrorContext>;
5884    fn next(&mut self) -> Option<Self::Item> {
5885        if self.buf.len() == self.pos {
5886            return None;
5887        }
5888        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
5889            {
5890                let Some(res) = parse_u32(next) else { break };
5891                return Some(Ok(res));
5892            }
5893        }
5894        Some(Err(ErrorContext::new(
5895            "u32",
5896            None,
5897            self.orig_loc,
5898            self.buf.as_ptr().wrapping_add(self.pos) as usize,
5899        )))
5900    }
5901}
5902impl<'a> IfCombinationAttributes<'a> {
5903    pub fn new_array(buf: &[u8]) -> IterableArrayIfCombinationAttributes<'_> {
5904        IterableArrayIfCombinationAttributes::with_loc(buf, buf.as_ptr() as usize)
5905    }
5906}
5907#[derive(Clone, Copy, Default)]
5908pub struct IterableArrayIfCombinationAttributes<'a> {
5909    buf: &'a [u8],
5910    pos: usize,
5911    orig_loc: usize,
5912}
5913impl<'a> IterableArrayIfCombinationAttributes<'a> {
5914    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
5915        Self {
5916            buf,
5917            pos: 0,
5918            orig_loc,
5919        }
5920    }
5921    pub fn get_buf(&self) -> &'a [u8] {
5922        self.buf
5923    }
5924}
5925impl<'a> Iterator for IterableArrayIfCombinationAttributes<'a> {
5926    type Item = Result<IterableIfCombinationAttributes<'a>, ErrorContext>;
5927    fn next(&mut self) -> Option<Self::Item> {
5928        if self.buf.len() == self.pos {
5929            return None;
5930        }
5931        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
5932            {
5933                return Some(Ok(IterableIfCombinationAttributes::with_loc(
5934                    next,
5935                    self.orig_loc,
5936                )));
5937            }
5938        }
5939        Some(Err(ErrorContext::new(
5940            "IfCombinationAttributes",
5941            None,
5942            self.orig_loc,
5943            self.buf.as_ptr().wrapping_add(self.pos) as usize,
5944        )))
5945    }
5946}
5947impl Nl80211Attrs<'_> {
5948    pub fn new<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
5949        IterableNl80211Attrs::with_loc(buf, buf.as_ptr() as usize)
5950    }
5951    fn attr_from_type(r#type: u16) -> Option<&'static str> {
5952        let res = match r#type {
5953            1u16 => "Wiphy",
5954            2u16 => "WiphyName",
5955            3u16 => "Ifindex",
5956            4u16 => "Ifname",
5957            5u16 => "Iftype",
5958            6u16 => "Mac",
5959            7u16 => "KeyData",
5960            8u16 => "KeyIdx",
5961            9u16 => "KeyCipher",
5962            10u16 => "KeySeq",
5963            11u16 => "KeyDefault",
5964            12u16 => "BeaconInterval",
5965            13u16 => "DtimPeriod",
5966            14u16 => "BeaconHead",
5967            15u16 => "BeaconTail",
5968            16u16 => "StaAid",
5969            17u16 => "StaFlags",
5970            18u16 => "StaListenInterval",
5971            19u16 => "StaSupportedRates",
5972            20u16 => "StaVlan",
5973            21u16 => "StaInfo",
5974            22u16 => "WiphyBands",
5975            23u16 => "MntrFlags",
5976            24u16 => "MeshId",
5977            25u16 => "StaPlinkAction",
5978            26u16 => "MpathNextHop",
5979            27u16 => "MpathInfo",
5980            28u16 => "BssCtsProt",
5981            29u16 => "BssShortPreamble",
5982            30u16 => "BssShortSlotTime",
5983            31u16 => "HtCapability",
5984            32u16 => "SupportedIftypes",
5985            33u16 => "RegAlpha2",
5986            34u16 => "RegRules",
5987            35u16 => "MeshConfig",
5988            36u16 => "BssBasicRates",
5989            37u16 => "WiphyTxqParams",
5990            38u16 => "WiphyFreq",
5991            39u16 => "WiphyChannelType",
5992            40u16 => "KeyDefaultMgmt",
5993            41u16 => "MgmtSubtype",
5994            42u16 => "Ie",
5995            43u16 => "MaxNumScanSsids",
5996            44u16 => "ScanFrequencies",
5997            45u16 => "ScanSsids",
5998            46u16 => "Generation",
5999            47u16 => "Bss",
6000            48u16 => "RegInitiator",
6001            49u16 => "RegType",
6002            50u16 => "SupportedCommands",
6003            51u16 => "Frame",
6004            52u16 => "Ssid",
6005            53u16 => "AuthType",
6006            54u16 => "ReasonCode",
6007            55u16 => "KeyType",
6008            56u16 => "MaxScanIeLen",
6009            57u16 => "CipherSuites",
6010            58u16 => "FreqBefore",
6011            59u16 => "FreqAfter",
6012            60u16 => "FreqFixed",
6013            61u16 => "WiphyRetryShort",
6014            62u16 => "WiphyRetryLong",
6015            63u16 => "WiphyFragThreshold",
6016            64u16 => "WiphyRtsThreshold",
6017            65u16 => "TimedOut",
6018            66u16 => "UseMfp",
6019            67u16 => "StaFlags2",
6020            68u16 => "ControlPort",
6021            69u16 => "Testdata",
6022            70u16 => "Privacy",
6023            71u16 => "DisconnectedByAp",
6024            72u16 => "StatusCode",
6025            73u16 => "CipherSuitesPairwise",
6026            74u16 => "CipherSuiteGroup",
6027            75u16 => "WpaVersions",
6028            76u16 => "AkmSuites",
6029            77u16 => "ReqIe",
6030            78u16 => "RespIe",
6031            79u16 => "PrevBssid",
6032            80u16 => "Key",
6033            81u16 => "Keys",
6034            82u16 => "Pid",
6035            83u16 => "4addr",
6036            84u16 => "SurveyInfo",
6037            85u16 => "Pmkid",
6038            86u16 => "MaxNumPmkids",
6039            87u16 => "Duration",
6040            88u16 => "Cookie",
6041            89u16 => "WiphyCoverageClass",
6042            90u16 => "TxRates",
6043            91u16 => "FrameMatch",
6044            92u16 => "Ack",
6045            93u16 => "PsState",
6046            94u16 => "Cqm",
6047            95u16 => "LocalStateChange",
6048            96u16 => "ApIsolate",
6049            97u16 => "WiphyTxPowerSetting",
6050            98u16 => "WiphyTxPowerLevel",
6051            99u16 => "TxFrameTypes",
6052            100u16 => "RxFrameTypes",
6053            101u16 => "FrameType",
6054            102u16 => "ControlPortEthertype",
6055            103u16 => "ControlPortNoEncrypt",
6056            104u16 => "SupportIbssRsn",
6057            105u16 => "WiphyAntennaTx",
6058            106u16 => "WiphyAntennaRx",
6059            107u16 => "McastRate",
6060            108u16 => "OffchannelTxOk",
6061            109u16 => "BssHtOpmode",
6062            110u16 => "KeyDefaultTypes",
6063            111u16 => "MaxRemainOnChannelDuration",
6064            112u16 => "MeshSetup",
6065            113u16 => "WiphyAntennaAvailTx",
6066            114u16 => "WiphyAntennaAvailRx",
6067            115u16 => "SupportMeshAuth",
6068            116u16 => "StaPlinkState",
6069            117u16 => "WowlanTriggers",
6070            118u16 => "WowlanTriggersSupported",
6071            119u16 => "SchedScanInterval",
6072            120u16 => "InterfaceCombinations",
6073            121u16 => "SoftwareIftypes",
6074            122u16 => "RekeyData",
6075            123u16 => "MaxNumSchedScanSsids",
6076            124u16 => "MaxSchedScanIeLen",
6077            125u16 => "ScanSuppRates",
6078            126u16 => "HiddenSsid",
6079            127u16 => "IeProbeResp",
6080            128u16 => "IeAssocResp",
6081            129u16 => "StaWme",
6082            130u16 => "SupportApUapsd",
6083            131u16 => "RoamSupport",
6084            132u16 => "SchedScanMatch",
6085            133u16 => "MaxMatchSets",
6086            134u16 => "PmksaCandidate",
6087            135u16 => "TxNoCckRate",
6088            136u16 => "TdlsAction",
6089            137u16 => "TdlsDialogToken",
6090            138u16 => "TdlsOperation",
6091            139u16 => "TdlsSupport",
6092            140u16 => "TdlsExternalSetup",
6093            141u16 => "DeviceApSme",
6094            142u16 => "DontWaitForAck",
6095            143u16 => "FeatureFlags",
6096            144u16 => "ProbeRespOffload",
6097            145u16 => "ProbeResp",
6098            146u16 => "DfsRegion",
6099            147u16 => "DisableHt",
6100            148u16 => "HtCapabilityMask",
6101            149u16 => "NoackMap",
6102            150u16 => "InactivityTimeout",
6103            151u16 => "RxSignalDbm",
6104            152u16 => "BgScanPeriod",
6105            153u16 => "Wdev",
6106            154u16 => "UserRegHintType",
6107            155u16 => "ConnFailedReason",
6108            156u16 => "AuthData",
6109            157u16 => "VhtCapability",
6110            158u16 => "ScanFlags",
6111            159u16 => "ChannelWidth",
6112            160u16 => "CenterFreq1",
6113            161u16 => "CenterFreq2",
6114            162u16 => "P2pCtwindow",
6115            163u16 => "P2pOppps",
6116            164u16 => "LocalMeshPowerMode",
6117            165u16 => "AclPolicy",
6118            166u16 => "MacAddrs",
6119            167u16 => "MacAclMax",
6120            168u16 => "RadarEvent",
6121            169u16 => "ExtCapa",
6122            170u16 => "ExtCapaMask",
6123            171u16 => "StaCapability",
6124            172u16 => "StaExtCapability",
6125            173u16 => "ProtocolFeatures",
6126            174u16 => "SplitWiphyDump",
6127            175u16 => "DisableVht",
6128            176u16 => "VhtCapabilityMask",
6129            177u16 => "Mdid",
6130            178u16 => "IeRic",
6131            179u16 => "CritProtId",
6132            180u16 => "MaxCritProtDuration",
6133            181u16 => "PeerAid",
6134            182u16 => "CoalesceRule",
6135            183u16 => "ChSwitchCount",
6136            184u16 => "ChSwitchBlockTx",
6137            185u16 => "CsaIes",
6138            186u16 => "CntdwnOffsBeacon",
6139            187u16 => "CntdwnOffsPresp",
6140            188u16 => "RxmgmtFlags",
6141            189u16 => "StaSupportedChannels",
6142            190u16 => "StaSupportedOperClasses",
6143            191u16 => "HandleDfs",
6144            192u16 => "Support5Mhz",
6145            193u16 => "Support10Mhz",
6146            194u16 => "OpmodeNotif",
6147            195u16 => "VendorId",
6148            196u16 => "VendorSubcmd",
6149            197u16 => "VendorData",
6150            198u16 => "VendorEvents",
6151            199u16 => "QosMap",
6152            200u16 => "MacHint",
6153            201u16 => "WiphyFreqHint",
6154            202u16 => "MaxApAssocSta",
6155            203u16 => "TdlsPeerCapability",
6156            204u16 => "SocketOwner",
6157            205u16 => "CsaCOffsetsTx",
6158            206u16 => "MaxCsaCounters",
6159            207u16 => "TdlsInitiator",
6160            208u16 => "UseRrm",
6161            209u16 => "WiphyDynAck",
6162            210u16 => "Tsid",
6163            211u16 => "UserPrio",
6164            212u16 => "AdmittedTime",
6165            213u16 => "SmpsMode",
6166            214u16 => "OperClass",
6167            215u16 => "MacMask",
6168            216u16 => "WiphySelfManagedReg",
6169            217u16 => "ExtFeatures",
6170            218u16 => "SurveyRadioStats",
6171            219u16 => "NetnsFd",
6172            220u16 => "SchedScanDelay",
6173            221u16 => "RegIndoor",
6174            222u16 => "MaxNumSchedScanPlans",
6175            223u16 => "MaxScanPlanInterval",
6176            224u16 => "MaxScanPlanIterations",
6177            225u16 => "SchedScanPlans",
6178            226u16 => "Pbss",
6179            227u16 => "BssSelect",
6180            228u16 => "StaSupportP2pPs",
6181            229u16 => "Pad",
6182            230u16 => "IftypeExtCapa",
6183            231u16 => "MuMimoGroupData",
6184            232u16 => "MuMimoFollowMacAddr",
6185            233u16 => "ScanStartTimeTsf",
6186            234u16 => "ScanStartTimeTsfBssid",
6187            235u16 => "MeasurementDuration",
6188            236u16 => "MeasurementDurationMandatory",
6189            237u16 => "MeshPeerAid",
6190            238u16 => "NanMasterPref",
6191            239u16 => "Bands",
6192            240u16 => "NanFunc",
6193            241u16 => "NanMatch",
6194            242u16 => "FilsKek",
6195            243u16 => "FilsNonces",
6196            244u16 => "MulticastToUnicastEnabled",
6197            245u16 => "Bssid",
6198            246u16 => "SchedScanRelativeRssi",
6199            247u16 => "SchedScanRssiAdjust",
6200            248u16 => "TimeoutReason",
6201            249u16 => "FilsErpUsername",
6202            250u16 => "FilsErpRealm",
6203            251u16 => "FilsErpNextSeqNum",
6204            252u16 => "FilsErpRrk",
6205            253u16 => "FilsCacheId",
6206            254u16 => "Pmk",
6207            255u16 => "SchedScanMulti",
6208            256u16 => "SchedScanMaxReqs",
6209            257u16 => "Want1x4wayHs",
6210            258u16 => "Pmkr0Name",
6211            259u16 => "PortAuthorized",
6212            260u16 => "ExternalAuthAction",
6213            261u16 => "ExternalAuthSupport",
6214            262u16 => "Nss",
6215            263u16 => "AckSignal",
6216            264u16 => "ControlPortOverNl80211",
6217            265u16 => "TxqStats",
6218            266u16 => "TxqLimit",
6219            267u16 => "TxqMemoryLimit",
6220            268u16 => "TxqQuantum",
6221            269u16 => "HeCapability",
6222            270u16 => "FtmResponder",
6223            271u16 => "FtmResponderStats",
6224            272u16 => "Timeout",
6225            273u16 => "PeerMeasurements",
6226            274u16 => "AirtimeWeight",
6227            275u16 => "StaTxPowerSetting",
6228            276u16 => "StaTxPower",
6229            277u16 => "SaePassword",
6230            278u16 => "TwtResponder",
6231            279u16 => "HeObssPd",
6232            280u16 => "WiphyEdmgChannels",
6233            281u16 => "WiphyEdmgBwConfig",
6234            282u16 => "VlanId",
6235            283u16 => "HeBssColor",
6236            284u16 => "IftypeAkmSuites",
6237            285u16 => "TidConfig",
6238            286u16 => "ControlPortNoPreauth",
6239            287u16 => "PmkLifetime",
6240            288u16 => "PmkReauthThreshold",
6241            289u16 => "ReceiveMulticast",
6242            290u16 => "WiphyFreqOffset",
6243            291u16 => "CenterFreq1Offset",
6244            292u16 => "ScanFreqKhz",
6245            293u16 => "He6ghzCapability",
6246            294u16 => "FilsDiscovery",
6247            295u16 => "UnsolBcastProbeResp",
6248            296u16 => "S1gCapability",
6249            297u16 => "S1gCapabilityMask",
6250            298u16 => "SaePwe",
6251            299u16 => "ReconnectRequested",
6252            300u16 => "SarSpec",
6253            301u16 => "DisableHe",
6254            302u16 => "ObssColorBitmap",
6255            303u16 => "ColorChangeCount",
6256            304u16 => "ColorChangeColor",
6257            305u16 => "ColorChangeElems",
6258            306u16 => "MbssidConfig",
6259            307u16 => "MbssidElems",
6260            308u16 => "RadarBackground",
6261            309u16 => "ApSettingsFlags",
6262            310u16 => "EhtCapability",
6263            311u16 => "DisableEht",
6264            312u16 => "MloLinks",
6265            313u16 => "MloLinkId",
6266            314u16 => "MldAddr",
6267            315u16 => "MloSupport",
6268            316u16 => "MaxNumAkmSuites",
6269            317u16 => "EmlCapability",
6270            318u16 => "MldCapaAndOps",
6271            319u16 => "TxHwTimestamp",
6272            320u16 => "RxHwTimestamp",
6273            321u16 => "TdBitmap",
6274            322u16 => "PunctBitmap",
6275            323u16 => "MaxHwTimestampPeers",
6276            324u16 => "HwTimestampEnabled",
6277            325u16 => "EmaRnrElems",
6278            326u16 => "MloLinkDisabled",
6279            327u16 => "BssDumpIncludeUseData",
6280            328u16 => "MloTtlmDlink",
6281            329u16 => "MloTtlmUlink",
6282            330u16 => "AssocSppAmsdu",
6283            331u16 => "WiphyRadios",
6284            332u16 => "WiphyInterfaceCombinations",
6285            333u16 => "VifRadioMask",
6286            _ => return None,
6287        };
6288        Some(res)
6289    }
6290}
6291#[derive(Clone, Copy, Default)]
6292pub struct IterableNl80211Attrs<'a> {
6293    buf: &'a [u8],
6294    pos: usize,
6295    orig_loc: usize,
6296}
6297impl<'a> IterableNl80211Attrs<'a> {
6298    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
6299        Self {
6300            buf,
6301            pos: 0,
6302            orig_loc,
6303        }
6304    }
6305    pub fn get_buf(&self) -> &'a [u8] {
6306        self.buf
6307    }
6308}
6309impl<'a> Iterator for IterableNl80211Attrs<'a> {
6310    type Item = Result<Nl80211Attrs<'a>, ErrorContext>;
6311    fn next(&mut self) -> Option<Self::Item> {
6312        let pos = self.pos;
6313        let mut r#type;
6314        loop {
6315            r#type = None;
6316            if self.buf.len() == self.pos {
6317                return None;
6318            }
6319            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
6320                break;
6321            };
6322            r#type = Some(header.r#type);
6323            let res = match header.r#type {
6324                1u16 => Nl80211Attrs::Wiphy({
6325                    let res = parse_u32(next);
6326                    let Some(val) = res else { break };
6327                    val
6328                }),
6329                2u16 => Nl80211Attrs::WiphyName({
6330                    let res = CStr::from_bytes_with_nul(next).ok();
6331                    let Some(val) = res else { break };
6332                    val
6333                }),
6334                3u16 => Nl80211Attrs::Ifindex({
6335                    let res = parse_u32(next);
6336                    let Some(val) = res else { break };
6337                    val
6338                }),
6339                4u16 => Nl80211Attrs::Ifname({
6340                    let res = CStr::from_bytes_with_nul(next).ok();
6341                    let Some(val) = res else { break };
6342                    val
6343                }),
6344                5u16 => Nl80211Attrs::Iftype({
6345                    let res = parse_u32(next);
6346                    let Some(val) = res else { break };
6347                    val
6348                }),
6349                6u16 => Nl80211Attrs::Mac({
6350                    let res = Some(next);
6351                    let Some(val) = res else { break };
6352                    val
6353                }),
6354                7u16 => Nl80211Attrs::KeyData({
6355                    let res = Some(next);
6356                    let Some(val) = res else { break };
6357                    val
6358                }),
6359                8u16 => Nl80211Attrs::KeyIdx({
6360                    let res = parse_u8(next);
6361                    let Some(val) = res else { break };
6362                    val
6363                }),
6364                9u16 => Nl80211Attrs::KeyCipher({
6365                    let res = parse_u32(next);
6366                    let Some(val) = res else { break };
6367                    val
6368                }),
6369                10u16 => Nl80211Attrs::KeySeq({
6370                    let res = Some(next);
6371                    let Some(val) = res else { break };
6372                    val
6373                }),
6374                11u16 => Nl80211Attrs::KeyDefault(()),
6375                12u16 => Nl80211Attrs::BeaconInterval({
6376                    let res = parse_u32(next);
6377                    let Some(val) = res else { break };
6378                    val
6379                }),
6380                13u16 => Nl80211Attrs::DtimPeriod({
6381                    let res = parse_u32(next);
6382                    let Some(val) = res else { break };
6383                    val
6384                }),
6385                14u16 => Nl80211Attrs::BeaconHead({
6386                    let res = Some(next);
6387                    let Some(val) = res else { break };
6388                    val
6389                }),
6390                15u16 => Nl80211Attrs::BeaconTail({
6391                    let res = Some(next);
6392                    let Some(val) = res else { break };
6393                    val
6394                }),
6395                16u16 => Nl80211Attrs::StaAid({
6396                    let res = parse_u16(next);
6397                    let Some(val) = res else { break };
6398                    val
6399                }),
6400                17u16 => Nl80211Attrs::StaFlags({
6401                    let res = Some(next);
6402                    let Some(val) = res else { break };
6403                    val
6404                }),
6405                18u16 => Nl80211Attrs::StaListenInterval({
6406                    let res = parse_u16(next);
6407                    let Some(val) = res else { break };
6408                    val
6409                }),
6410                19u16 => Nl80211Attrs::StaSupportedRates({
6411                    let res = Some(next);
6412                    let Some(val) = res else { break };
6413                    val
6414                }),
6415                20u16 => Nl80211Attrs::StaVlan({
6416                    let res = parse_u32(next);
6417                    let Some(val) = res else { break };
6418                    val
6419                }),
6420                21u16 => Nl80211Attrs::StaInfo({
6421                    let res = Some(next);
6422                    let Some(val) = res else { break };
6423                    val
6424                }),
6425                22u16 => Nl80211Attrs::WiphyBands({
6426                    let res = Some(IterableWiphyBands::with_loc(next, self.orig_loc));
6427                    let Some(val) = res else { break };
6428                    val
6429                }),
6430                23u16 => Nl80211Attrs::MntrFlags({
6431                    let res = Some(next);
6432                    let Some(val) = res else { break };
6433                    val
6434                }),
6435                24u16 => Nl80211Attrs::MeshId({
6436                    let res = Some(next);
6437                    let Some(val) = res else { break };
6438                    val
6439                }),
6440                25u16 => Nl80211Attrs::StaPlinkAction({
6441                    let res = parse_u8(next);
6442                    let Some(val) = res else { break };
6443                    val
6444                }),
6445                26u16 => Nl80211Attrs::MpathNextHop({
6446                    let res = Some(next);
6447                    let Some(val) = res else { break };
6448                    val
6449                }),
6450                27u16 => Nl80211Attrs::MpathInfo({
6451                    let res = Some(next);
6452                    let Some(val) = res else { break };
6453                    val
6454                }),
6455                28u16 => Nl80211Attrs::BssCtsProt({
6456                    let res = parse_u8(next);
6457                    let Some(val) = res else { break };
6458                    val
6459                }),
6460                29u16 => Nl80211Attrs::BssShortPreamble({
6461                    let res = parse_u8(next);
6462                    let Some(val) = res else { break };
6463                    val
6464                }),
6465                30u16 => Nl80211Attrs::BssShortSlotTime({
6466                    let res = parse_u8(next);
6467                    let Some(val) = res else { break };
6468                    val
6469                }),
6470                31u16 => Nl80211Attrs::HtCapability({
6471                    let res = Some(next);
6472                    let Some(val) = res else { break };
6473                    val
6474                }),
6475                32u16 => Nl80211Attrs::SupportedIftypes({
6476                    let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
6477                    let Some(val) = res else { break };
6478                    val
6479                }),
6480                33u16 => Nl80211Attrs::RegAlpha2({
6481                    let res = Some(next);
6482                    let Some(val) = res else { break };
6483                    val
6484                }),
6485                34u16 => Nl80211Attrs::RegRules({
6486                    let res = Some(next);
6487                    let Some(val) = res else { break };
6488                    val
6489                }),
6490                35u16 => Nl80211Attrs::MeshConfig({
6491                    let res = Some(next);
6492                    let Some(val) = res else { break };
6493                    val
6494                }),
6495                36u16 => Nl80211Attrs::BssBasicRates({
6496                    let res = Some(next);
6497                    let Some(val) = res else { break };
6498                    val
6499                }),
6500                37u16 => Nl80211Attrs::WiphyTxqParams({
6501                    let res = Some(next);
6502                    let Some(val) = res else { break };
6503                    val
6504                }),
6505                38u16 => Nl80211Attrs::WiphyFreq({
6506                    let res = parse_u32(next);
6507                    let Some(val) = res else { break };
6508                    val
6509                }),
6510                39u16 => Nl80211Attrs::WiphyChannelType({
6511                    let res = parse_u32(next);
6512                    let Some(val) = res else { break };
6513                    val
6514                }),
6515                40u16 => Nl80211Attrs::KeyDefaultMgmt(()),
6516                41u16 => Nl80211Attrs::MgmtSubtype({
6517                    let res = parse_u8(next);
6518                    let Some(val) = res else { break };
6519                    val
6520                }),
6521                42u16 => Nl80211Attrs::Ie({
6522                    let res = Some(next);
6523                    let Some(val) = res else { break };
6524                    val
6525                }),
6526                43u16 => Nl80211Attrs::MaxNumScanSsids({
6527                    let res = parse_u8(next);
6528                    let Some(val) = res else { break };
6529                    val
6530                }),
6531                44u16 => Nl80211Attrs::ScanFrequencies({
6532                    let res = Some(next);
6533                    let Some(val) = res else { break };
6534                    val
6535                }),
6536                45u16 => Nl80211Attrs::ScanSsids({
6537                    let res = Some(next);
6538                    let Some(val) = res else { break };
6539                    val
6540                }),
6541                46u16 => Nl80211Attrs::Generation({
6542                    let res = parse_u32(next);
6543                    let Some(val) = res else { break };
6544                    val
6545                }),
6546                47u16 => Nl80211Attrs::Bss({
6547                    let res = Some(next);
6548                    let Some(val) = res else { break };
6549                    val
6550                }),
6551                48u16 => Nl80211Attrs::RegInitiator({
6552                    let res = parse_u8(next);
6553                    let Some(val) = res else { break };
6554                    val
6555                }),
6556                49u16 => Nl80211Attrs::RegType({
6557                    let res = parse_u8(next);
6558                    let Some(val) = res else { break };
6559                    val
6560                }),
6561                50u16 => Nl80211Attrs::SupportedCommands({
6562                    let res = Some(IterableArrayU32::with_loc(next, self.orig_loc));
6563                    let Some(val) = res else { break };
6564                    val
6565                }),
6566                51u16 => Nl80211Attrs::Frame({
6567                    let res = Some(next);
6568                    let Some(val) = res else { break };
6569                    val
6570                }),
6571                52u16 => Nl80211Attrs::Ssid({
6572                    let res = Some(next);
6573                    let Some(val) = res else { break };
6574                    val
6575                }),
6576                53u16 => Nl80211Attrs::AuthType({
6577                    let res = parse_u32(next);
6578                    let Some(val) = res else { break };
6579                    val
6580                }),
6581                54u16 => Nl80211Attrs::ReasonCode({
6582                    let res = parse_u16(next);
6583                    let Some(val) = res else { break };
6584                    val
6585                }),
6586                55u16 => Nl80211Attrs::KeyType({
6587                    let res = parse_u32(next);
6588                    let Some(val) = res else { break };
6589                    val
6590                }),
6591                56u16 => Nl80211Attrs::MaxScanIeLen({
6592                    let res = parse_u16(next);
6593                    let Some(val) = res else { break };
6594                    val
6595                }),
6596                57u16 => Nl80211Attrs::CipherSuites({
6597                    let res = Some(next);
6598                    let Some(val) = res else { break };
6599                    val
6600                }),
6601                58u16 => Nl80211Attrs::FreqBefore({
6602                    let res = Some(next);
6603                    let Some(val) = res else { break };
6604                    val
6605                }),
6606                59u16 => Nl80211Attrs::FreqAfter({
6607                    let res = Some(next);
6608                    let Some(val) = res else { break };
6609                    val
6610                }),
6611                60u16 => Nl80211Attrs::FreqFixed(()),
6612                61u16 => Nl80211Attrs::WiphyRetryShort({
6613                    let res = parse_u8(next);
6614                    let Some(val) = res else { break };
6615                    val
6616                }),
6617                62u16 => Nl80211Attrs::WiphyRetryLong({
6618                    let res = parse_u8(next);
6619                    let Some(val) = res else { break };
6620                    val
6621                }),
6622                63u16 => Nl80211Attrs::WiphyFragThreshold({
6623                    let res = parse_u32(next);
6624                    let Some(val) = res else { break };
6625                    val
6626                }),
6627                64u16 => Nl80211Attrs::WiphyRtsThreshold({
6628                    let res = parse_u32(next);
6629                    let Some(val) = res else { break };
6630                    val
6631                }),
6632                65u16 => Nl80211Attrs::TimedOut(()),
6633                66u16 => Nl80211Attrs::UseMfp({
6634                    let res = parse_u32(next);
6635                    let Some(val) = res else { break };
6636                    val
6637                }),
6638                67u16 => Nl80211Attrs::StaFlags2({
6639                    let res = Some(StaFlagUpdate::new_from_zeroed(next));
6640                    let Some(val) = res else { break };
6641                    val
6642                }),
6643                68u16 => Nl80211Attrs::ControlPort(()),
6644                69u16 => Nl80211Attrs::Testdata({
6645                    let res = Some(next);
6646                    let Some(val) = res else { break };
6647                    val
6648                }),
6649                70u16 => Nl80211Attrs::Privacy(()),
6650                71u16 => Nl80211Attrs::DisconnectedByAp(()),
6651                72u16 => Nl80211Attrs::StatusCode({
6652                    let res = parse_u16(next);
6653                    let Some(val) = res else { break };
6654                    val
6655                }),
6656                73u16 => Nl80211Attrs::CipherSuitesPairwise({
6657                    let res = Some(next);
6658                    let Some(val) = res else { break };
6659                    val
6660                }),
6661                74u16 => Nl80211Attrs::CipherSuiteGroup({
6662                    let res = parse_u32(next);
6663                    let Some(val) = res else { break };
6664                    val
6665                }),
6666                75u16 => Nl80211Attrs::WpaVersions({
6667                    let res = parse_u32(next);
6668                    let Some(val) = res else { break };
6669                    val
6670                }),
6671                76u16 => Nl80211Attrs::AkmSuites({
6672                    let res = Some(next);
6673                    let Some(val) = res else { break };
6674                    val
6675                }),
6676                77u16 => Nl80211Attrs::ReqIe({
6677                    let res = Some(next);
6678                    let Some(val) = res else { break };
6679                    val
6680                }),
6681                78u16 => Nl80211Attrs::RespIe({
6682                    let res = Some(next);
6683                    let Some(val) = res else { break };
6684                    val
6685                }),
6686                79u16 => Nl80211Attrs::PrevBssid({
6687                    let res = Some(next);
6688                    let Some(val) = res else { break };
6689                    val
6690                }),
6691                80u16 => Nl80211Attrs::Key({
6692                    let res = Some(next);
6693                    let Some(val) = res else { break };
6694                    val
6695                }),
6696                81u16 => Nl80211Attrs::Keys({
6697                    let res = Some(next);
6698                    let Some(val) = res else { break };
6699                    val
6700                }),
6701                82u16 => Nl80211Attrs::Pid({
6702                    let res = parse_u32(next);
6703                    let Some(val) = res else { break };
6704                    val
6705                }),
6706                83u16 => Nl80211Attrs::_4addr({
6707                    let res = parse_u8(next);
6708                    let Some(val) = res else { break };
6709                    val
6710                }),
6711                84u16 => Nl80211Attrs::SurveyInfo({
6712                    let res = Some(next);
6713                    let Some(val) = res else { break };
6714                    val
6715                }),
6716                85u16 => Nl80211Attrs::Pmkid({
6717                    let res = Some(next);
6718                    let Some(val) = res else { break };
6719                    val
6720                }),
6721                86u16 => Nl80211Attrs::MaxNumPmkids({
6722                    let res = parse_u8(next);
6723                    let Some(val) = res else { break };
6724                    val
6725                }),
6726                87u16 => Nl80211Attrs::Duration({
6727                    let res = parse_u32(next);
6728                    let Some(val) = res else { break };
6729                    val
6730                }),
6731                88u16 => Nl80211Attrs::Cookie({
6732                    let res = parse_u64(next);
6733                    let Some(val) = res else { break };
6734                    val
6735                }),
6736                89u16 => Nl80211Attrs::WiphyCoverageClass({
6737                    let res = parse_u8(next);
6738                    let Some(val) = res else { break };
6739                    val
6740                }),
6741                90u16 => Nl80211Attrs::TxRates({
6742                    let res = Some(next);
6743                    let Some(val) = res else { break };
6744                    val
6745                }),
6746                91u16 => Nl80211Attrs::FrameMatch({
6747                    let res = Some(next);
6748                    let Some(val) = res else { break };
6749                    val
6750                }),
6751                92u16 => Nl80211Attrs::Ack(()),
6752                93u16 => Nl80211Attrs::PsState({
6753                    let res = parse_u32(next);
6754                    let Some(val) = res else { break };
6755                    val
6756                }),
6757                94u16 => Nl80211Attrs::Cqm({
6758                    let res = Some(next);
6759                    let Some(val) = res else { break };
6760                    val
6761                }),
6762                95u16 => Nl80211Attrs::LocalStateChange(()),
6763                96u16 => Nl80211Attrs::ApIsolate({
6764                    let res = parse_u8(next);
6765                    let Some(val) = res else { break };
6766                    val
6767                }),
6768                97u16 => Nl80211Attrs::WiphyTxPowerSetting({
6769                    let res = parse_u32(next);
6770                    let Some(val) = res else { break };
6771                    val
6772                }),
6773                98u16 => Nl80211Attrs::WiphyTxPowerLevel({
6774                    let res = parse_u32(next);
6775                    let Some(val) = res else { break };
6776                    val
6777                }),
6778                99u16 => Nl80211Attrs::TxFrameTypes({
6779                    let res = Some(IterableIftypeAttrs::with_loc(next, self.orig_loc));
6780                    let Some(val) = res else { break };
6781                    val
6782                }),
6783                100u16 => Nl80211Attrs::RxFrameTypes({
6784                    let res = Some(IterableIftypeAttrs::with_loc(next, self.orig_loc));
6785                    let Some(val) = res else { break };
6786                    val
6787                }),
6788                101u16 => Nl80211Attrs::FrameType({
6789                    let res = parse_u16(next);
6790                    let Some(val) = res else { break };
6791                    val
6792                }),
6793                102u16 => Nl80211Attrs::ControlPortEthertype(()),
6794                103u16 => Nl80211Attrs::ControlPortNoEncrypt(()),
6795                104u16 => Nl80211Attrs::SupportIbssRsn(()),
6796                105u16 => Nl80211Attrs::WiphyAntennaTx({
6797                    let res = parse_u32(next);
6798                    let Some(val) = res else { break };
6799                    val
6800                }),
6801                106u16 => Nl80211Attrs::WiphyAntennaRx({
6802                    let res = parse_u32(next);
6803                    let Some(val) = res else { break };
6804                    val
6805                }),
6806                107u16 => Nl80211Attrs::McastRate({
6807                    let res = parse_u32(next);
6808                    let Some(val) = res else { break };
6809                    val
6810                }),
6811                108u16 => Nl80211Attrs::OffchannelTxOk(()),
6812                109u16 => Nl80211Attrs::BssHtOpmode({
6813                    let res = parse_u16(next);
6814                    let Some(val) = res else { break };
6815                    val
6816                }),
6817                110u16 => Nl80211Attrs::KeyDefaultTypes({
6818                    let res = Some(next);
6819                    let Some(val) = res else { break };
6820                    val
6821                }),
6822                111u16 => Nl80211Attrs::MaxRemainOnChannelDuration({
6823                    let res = parse_u32(next);
6824                    let Some(val) = res else { break };
6825                    val
6826                }),
6827                112u16 => Nl80211Attrs::MeshSetup({
6828                    let res = Some(next);
6829                    let Some(val) = res else { break };
6830                    val
6831                }),
6832                113u16 => Nl80211Attrs::WiphyAntennaAvailTx({
6833                    let res = parse_u32(next);
6834                    let Some(val) = res else { break };
6835                    val
6836                }),
6837                114u16 => Nl80211Attrs::WiphyAntennaAvailRx({
6838                    let res = parse_u32(next);
6839                    let Some(val) = res else { break };
6840                    val
6841                }),
6842                115u16 => Nl80211Attrs::SupportMeshAuth(()),
6843                116u16 => Nl80211Attrs::StaPlinkState({
6844                    let res = parse_u8(next);
6845                    let Some(val) = res else { break };
6846                    val
6847                }),
6848                117u16 => Nl80211Attrs::WowlanTriggers({
6849                    let res = Some(next);
6850                    let Some(val) = res else { break };
6851                    val
6852                }),
6853                118u16 => Nl80211Attrs::WowlanTriggersSupported({
6854                    let res = Some(IterableWowlanTriggersAttrs::with_loc(next, self.orig_loc));
6855                    let Some(val) = res else { break };
6856                    val
6857                }),
6858                119u16 => Nl80211Attrs::SchedScanInterval({
6859                    let res = parse_u32(next);
6860                    let Some(val) = res else { break };
6861                    val
6862                }),
6863                120u16 => Nl80211Attrs::InterfaceCombinations({
6864                    let res = Some(IterableArrayIfCombinationAttributes::with_loc(
6865                        next,
6866                        self.orig_loc,
6867                    ));
6868                    let Some(val) = res else { break };
6869                    val
6870                }),
6871                121u16 => Nl80211Attrs::SoftwareIftypes({
6872                    let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
6873                    let Some(val) = res else { break };
6874                    val
6875                }),
6876                122u16 => Nl80211Attrs::RekeyData({
6877                    let res = Some(next);
6878                    let Some(val) = res else { break };
6879                    val
6880                }),
6881                123u16 => Nl80211Attrs::MaxNumSchedScanSsids({
6882                    let res = parse_u8(next);
6883                    let Some(val) = res else { break };
6884                    val
6885                }),
6886                124u16 => Nl80211Attrs::MaxSchedScanIeLen({
6887                    let res = parse_u16(next);
6888                    let Some(val) = res else { break };
6889                    val
6890                }),
6891                125u16 => Nl80211Attrs::ScanSuppRates({
6892                    let res = Some(next);
6893                    let Some(val) = res else { break };
6894                    val
6895                }),
6896                126u16 => Nl80211Attrs::HiddenSsid({
6897                    let res = parse_u32(next);
6898                    let Some(val) = res else { break };
6899                    val
6900                }),
6901                127u16 => Nl80211Attrs::IeProbeResp({
6902                    let res = Some(next);
6903                    let Some(val) = res else { break };
6904                    val
6905                }),
6906                128u16 => Nl80211Attrs::IeAssocResp({
6907                    let res = Some(next);
6908                    let Some(val) = res else { break };
6909                    val
6910                }),
6911                129u16 => Nl80211Attrs::StaWme({
6912                    let res = Some(next);
6913                    let Some(val) = res else { break };
6914                    val
6915                }),
6916                130u16 => Nl80211Attrs::SupportApUapsd(()),
6917                131u16 => Nl80211Attrs::RoamSupport(()),
6918                132u16 => Nl80211Attrs::SchedScanMatch({
6919                    let res = Some(next);
6920                    let Some(val) = res else { break };
6921                    val
6922                }),
6923                133u16 => Nl80211Attrs::MaxMatchSets({
6924                    let res = parse_u8(next);
6925                    let Some(val) = res else { break };
6926                    val
6927                }),
6928                134u16 => Nl80211Attrs::PmksaCandidate({
6929                    let res = Some(next);
6930                    let Some(val) = res else { break };
6931                    val
6932                }),
6933                135u16 => Nl80211Attrs::TxNoCckRate(()),
6934                136u16 => Nl80211Attrs::TdlsAction({
6935                    let res = parse_u8(next);
6936                    let Some(val) = res else { break };
6937                    val
6938                }),
6939                137u16 => Nl80211Attrs::TdlsDialogToken({
6940                    let res = parse_u8(next);
6941                    let Some(val) = res else { break };
6942                    val
6943                }),
6944                138u16 => Nl80211Attrs::TdlsOperation({
6945                    let res = parse_u8(next);
6946                    let Some(val) = res else { break };
6947                    val
6948                }),
6949                139u16 => Nl80211Attrs::TdlsSupport(()),
6950                140u16 => Nl80211Attrs::TdlsExternalSetup(()),
6951                141u16 => Nl80211Attrs::DeviceApSme({
6952                    let res = parse_u32(next);
6953                    let Some(val) = res else { break };
6954                    val
6955                }),
6956                142u16 => Nl80211Attrs::DontWaitForAck(()),
6957                143u16 => Nl80211Attrs::FeatureFlags({
6958                    let res = parse_u32(next);
6959                    let Some(val) = res else { break };
6960                    val
6961                }),
6962                144u16 => Nl80211Attrs::ProbeRespOffload({
6963                    let res = parse_u32(next);
6964                    let Some(val) = res else { break };
6965                    val
6966                }),
6967                145u16 => Nl80211Attrs::ProbeResp({
6968                    let res = Some(next);
6969                    let Some(val) = res else { break };
6970                    val
6971                }),
6972                146u16 => Nl80211Attrs::DfsRegion({
6973                    let res = parse_u8(next);
6974                    let Some(val) = res else { break };
6975                    val
6976                }),
6977                147u16 => Nl80211Attrs::DisableHt(()),
6978                148u16 => Nl80211Attrs::HtCapabilityMask({
6979                    let res = Some(next);
6980                    let Some(val) = res else { break };
6981                    val
6982                }),
6983                149u16 => Nl80211Attrs::NoackMap({
6984                    let res = parse_u16(next);
6985                    let Some(val) = res else { break };
6986                    val
6987                }),
6988                150u16 => Nl80211Attrs::InactivityTimeout({
6989                    let res = parse_u16(next);
6990                    let Some(val) = res else { break };
6991                    val
6992                }),
6993                151u16 => Nl80211Attrs::RxSignalDbm({
6994                    let res = parse_u32(next);
6995                    let Some(val) = res else { break };
6996                    val
6997                }),
6998                152u16 => Nl80211Attrs::BgScanPeriod({
6999                    let res = parse_u16(next);
7000                    let Some(val) = res else { break };
7001                    val
7002                }),
7003                153u16 => Nl80211Attrs::Wdev({
7004                    let res = parse_u64(next);
7005                    let Some(val) = res else { break };
7006                    val
7007                }),
7008                154u16 => Nl80211Attrs::UserRegHintType({
7009                    let res = parse_u32(next);
7010                    let Some(val) = res else { break };
7011                    val
7012                }),
7013                155u16 => Nl80211Attrs::ConnFailedReason({
7014                    let res = parse_u32(next);
7015                    let Some(val) = res else { break };
7016                    val
7017                }),
7018                156u16 => Nl80211Attrs::AuthData({
7019                    let res = Some(next);
7020                    let Some(val) = res else { break };
7021                    val
7022                }),
7023                157u16 => Nl80211Attrs::VhtCapability({
7024                    let res = Some(next);
7025                    let Some(val) = res else { break };
7026                    val
7027                }),
7028                158u16 => Nl80211Attrs::ScanFlags({
7029                    let res = parse_u32(next);
7030                    let Some(val) = res else { break };
7031                    val
7032                }),
7033                159u16 => Nl80211Attrs::ChannelWidth({
7034                    let res = parse_u32(next);
7035                    let Some(val) = res else { break };
7036                    val
7037                }),
7038                160u16 => Nl80211Attrs::CenterFreq1({
7039                    let res = parse_u32(next);
7040                    let Some(val) = res else { break };
7041                    val
7042                }),
7043                161u16 => Nl80211Attrs::CenterFreq2({
7044                    let res = parse_u32(next);
7045                    let Some(val) = res else { break };
7046                    val
7047                }),
7048                162u16 => Nl80211Attrs::P2pCtwindow({
7049                    let res = parse_u8(next);
7050                    let Some(val) = res else { break };
7051                    val
7052                }),
7053                163u16 => Nl80211Attrs::P2pOppps({
7054                    let res = parse_u8(next);
7055                    let Some(val) = res else { break };
7056                    val
7057                }),
7058                164u16 => Nl80211Attrs::LocalMeshPowerMode({
7059                    let res = parse_u32(next);
7060                    let Some(val) = res else { break };
7061                    val
7062                }),
7063                165u16 => Nl80211Attrs::AclPolicy({
7064                    let res = parse_u32(next);
7065                    let Some(val) = res else { break };
7066                    val
7067                }),
7068                166u16 => Nl80211Attrs::MacAddrs({
7069                    let res = Some(next);
7070                    let Some(val) = res else { break };
7071                    val
7072                }),
7073                167u16 => Nl80211Attrs::MacAclMax({
7074                    let res = parse_u32(next);
7075                    let Some(val) = res else { break };
7076                    val
7077                }),
7078                168u16 => Nl80211Attrs::RadarEvent({
7079                    let res = parse_u32(next);
7080                    let Some(val) = res else { break };
7081                    val
7082                }),
7083                169u16 => Nl80211Attrs::ExtCapa({
7084                    let res = Some(next);
7085                    let Some(val) = res else { break };
7086                    val
7087                }),
7088                170u16 => Nl80211Attrs::ExtCapaMask({
7089                    let res = Some(next);
7090                    let Some(val) = res else { break };
7091                    val
7092                }),
7093                171u16 => Nl80211Attrs::StaCapability({
7094                    let res = parse_u16(next);
7095                    let Some(val) = res else { break };
7096                    val
7097                }),
7098                172u16 => Nl80211Attrs::StaExtCapability({
7099                    let res = Some(next);
7100                    let Some(val) = res else { break };
7101                    val
7102                }),
7103                173u16 => Nl80211Attrs::ProtocolFeatures({
7104                    let res = parse_u32(next);
7105                    let Some(val) = res else { break };
7106                    val
7107                }),
7108                174u16 => Nl80211Attrs::SplitWiphyDump(()),
7109                175u16 => Nl80211Attrs::DisableVht(()),
7110                176u16 => Nl80211Attrs::VhtCapabilityMask({
7111                    let res = Some(next);
7112                    let Some(val) = res else { break };
7113                    val
7114                }),
7115                177u16 => Nl80211Attrs::Mdid({
7116                    let res = parse_u16(next);
7117                    let Some(val) = res else { break };
7118                    val
7119                }),
7120                178u16 => Nl80211Attrs::IeRic({
7121                    let res = Some(next);
7122                    let Some(val) = res else { break };
7123                    val
7124                }),
7125                179u16 => Nl80211Attrs::CritProtId({
7126                    let res = parse_u16(next);
7127                    let Some(val) = res else { break };
7128                    val
7129                }),
7130                180u16 => Nl80211Attrs::MaxCritProtDuration({
7131                    let res = parse_u16(next);
7132                    let Some(val) = res else { break };
7133                    val
7134                }),
7135                181u16 => Nl80211Attrs::PeerAid({
7136                    let res = parse_u16(next);
7137                    let Some(val) = res else { break };
7138                    val
7139                }),
7140                182u16 => Nl80211Attrs::CoalesceRule({
7141                    let res = Some(next);
7142                    let Some(val) = res else { break };
7143                    val
7144                }),
7145                183u16 => Nl80211Attrs::ChSwitchCount({
7146                    let res = parse_u32(next);
7147                    let Some(val) = res else { break };
7148                    val
7149                }),
7150                184u16 => Nl80211Attrs::ChSwitchBlockTx(()),
7151                185u16 => Nl80211Attrs::CsaIes({
7152                    let res = Some(next);
7153                    let Some(val) = res else { break };
7154                    val
7155                }),
7156                186u16 => Nl80211Attrs::CntdwnOffsBeacon({
7157                    let res = Some(next);
7158                    let Some(val) = res else { break };
7159                    val
7160                }),
7161                187u16 => Nl80211Attrs::CntdwnOffsPresp({
7162                    let res = Some(next);
7163                    let Some(val) = res else { break };
7164                    val
7165                }),
7166                188u16 => Nl80211Attrs::RxmgmtFlags({
7167                    let res = Some(next);
7168                    let Some(val) = res else { break };
7169                    val
7170                }),
7171                189u16 => Nl80211Attrs::StaSupportedChannels({
7172                    let res = Some(next);
7173                    let Some(val) = res else { break };
7174                    val
7175                }),
7176                190u16 => Nl80211Attrs::StaSupportedOperClasses({
7177                    let res = Some(next);
7178                    let Some(val) = res else { break };
7179                    val
7180                }),
7181                191u16 => Nl80211Attrs::HandleDfs(()),
7182                192u16 => Nl80211Attrs::Support5Mhz(()),
7183                193u16 => Nl80211Attrs::Support10Mhz(()),
7184                194u16 => Nl80211Attrs::OpmodeNotif({
7185                    let res = parse_u8(next);
7186                    let Some(val) = res else { break };
7187                    val
7188                }),
7189                195u16 => Nl80211Attrs::VendorId({
7190                    let res = parse_u32(next);
7191                    let Some(val) = res else { break };
7192                    val
7193                }),
7194                196u16 => Nl80211Attrs::VendorSubcmd({
7195                    let res = parse_u32(next);
7196                    let Some(val) = res else { break };
7197                    val
7198                }),
7199                197u16 => Nl80211Attrs::VendorData({
7200                    let res = Some(next);
7201                    let Some(val) = res else { break };
7202                    val
7203                }),
7204                198u16 => Nl80211Attrs::VendorEvents({
7205                    let res = Some(next);
7206                    let Some(val) = res else { break };
7207                    val
7208                }),
7209                199u16 => Nl80211Attrs::QosMap({
7210                    let res = Some(next);
7211                    let Some(val) = res else { break };
7212                    val
7213                }),
7214                200u16 => Nl80211Attrs::MacHint({
7215                    let res = Some(next);
7216                    let Some(val) = res else { break };
7217                    val
7218                }),
7219                201u16 => Nl80211Attrs::WiphyFreqHint({
7220                    let res = parse_u32(next);
7221                    let Some(val) = res else { break };
7222                    val
7223                }),
7224                202u16 => Nl80211Attrs::MaxApAssocSta({
7225                    let res = parse_u32(next);
7226                    let Some(val) = res else { break };
7227                    val
7228                }),
7229                203u16 => Nl80211Attrs::TdlsPeerCapability({
7230                    let res = parse_u32(next);
7231                    let Some(val) = res else { break };
7232                    val
7233                }),
7234                204u16 => Nl80211Attrs::SocketOwner(()),
7235                205u16 => Nl80211Attrs::CsaCOffsetsTx({
7236                    let res = Some(next);
7237                    let Some(val) = res else { break };
7238                    val
7239                }),
7240                206u16 => Nl80211Attrs::MaxCsaCounters({
7241                    let res = parse_u8(next);
7242                    let Some(val) = res else { break };
7243                    val
7244                }),
7245                207u16 => Nl80211Attrs::TdlsInitiator(()),
7246                208u16 => Nl80211Attrs::UseRrm(()),
7247                209u16 => Nl80211Attrs::WiphyDynAck(()),
7248                210u16 => Nl80211Attrs::Tsid({
7249                    let res = parse_u8(next);
7250                    let Some(val) = res else { break };
7251                    val
7252                }),
7253                211u16 => Nl80211Attrs::UserPrio({
7254                    let res = parse_u8(next);
7255                    let Some(val) = res else { break };
7256                    val
7257                }),
7258                212u16 => Nl80211Attrs::AdmittedTime({
7259                    let res = parse_u16(next);
7260                    let Some(val) = res else { break };
7261                    val
7262                }),
7263                213u16 => Nl80211Attrs::SmpsMode({
7264                    let res = parse_u8(next);
7265                    let Some(val) = res else { break };
7266                    val
7267                }),
7268                214u16 => Nl80211Attrs::OperClass({
7269                    let res = parse_u8(next);
7270                    let Some(val) = res else { break };
7271                    val
7272                }),
7273                215u16 => Nl80211Attrs::MacMask({
7274                    let res = Some(next);
7275                    let Some(val) = res else { break };
7276                    val
7277                }),
7278                216u16 => Nl80211Attrs::WiphySelfManagedReg(()),
7279                217u16 => Nl80211Attrs::ExtFeatures({
7280                    let res = Some(next);
7281                    let Some(val) = res else { break };
7282                    val
7283                }),
7284                218u16 => Nl80211Attrs::SurveyRadioStats({
7285                    let res = Some(next);
7286                    let Some(val) = res else { break };
7287                    val
7288                }),
7289                219u16 => Nl80211Attrs::NetnsFd({
7290                    let res = parse_u32(next);
7291                    let Some(val) = res else { break };
7292                    val
7293                }),
7294                220u16 => Nl80211Attrs::SchedScanDelay({
7295                    let res = parse_u32(next);
7296                    let Some(val) = res else { break };
7297                    val
7298                }),
7299                221u16 => Nl80211Attrs::RegIndoor(()),
7300                222u16 => Nl80211Attrs::MaxNumSchedScanPlans({
7301                    let res = parse_u32(next);
7302                    let Some(val) = res else { break };
7303                    val
7304                }),
7305                223u16 => Nl80211Attrs::MaxScanPlanInterval({
7306                    let res = parse_u32(next);
7307                    let Some(val) = res else { break };
7308                    val
7309                }),
7310                224u16 => Nl80211Attrs::MaxScanPlanIterations({
7311                    let res = parse_u32(next);
7312                    let Some(val) = res else { break };
7313                    val
7314                }),
7315                225u16 => Nl80211Attrs::SchedScanPlans({
7316                    let res = Some(next);
7317                    let Some(val) = res else { break };
7318                    val
7319                }),
7320                226u16 => Nl80211Attrs::Pbss(()),
7321                227u16 => Nl80211Attrs::BssSelect({
7322                    let res = Some(next);
7323                    let Some(val) = res else { break };
7324                    val
7325                }),
7326                228u16 => Nl80211Attrs::StaSupportP2pPs({
7327                    let res = parse_u8(next);
7328                    let Some(val) = res else { break };
7329                    val
7330                }),
7331                229u16 => Nl80211Attrs::Pad({
7332                    let res = Some(next);
7333                    let Some(val) = res else { break };
7334                    val
7335                }),
7336                230u16 => Nl80211Attrs::IftypeExtCapa({
7337                    let res = Some(next);
7338                    let Some(val) = res else { break };
7339                    val
7340                }),
7341                231u16 => Nl80211Attrs::MuMimoGroupData({
7342                    let res = Some(next);
7343                    let Some(val) = res else { break };
7344                    val
7345                }),
7346                232u16 => Nl80211Attrs::MuMimoFollowMacAddr({
7347                    let res = Some(next);
7348                    let Some(val) = res else { break };
7349                    val
7350                }),
7351                233u16 => Nl80211Attrs::ScanStartTimeTsf({
7352                    let res = parse_u64(next);
7353                    let Some(val) = res else { break };
7354                    val
7355                }),
7356                234u16 => Nl80211Attrs::ScanStartTimeTsfBssid({
7357                    let res = Some(next);
7358                    let Some(val) = res else { break };
7359                    val
7360                }),
7361                235u16 => Nl80211Attrs::MeasurementDuration({
7362                    let res = parse_u16(next);
7363                    let Some(val) = res else { break };
7364                    val
7365                }),
7366                236u16 => Nl80211Attrs::MeasurementDurationMandatory(()),
7367                237u16 => Nl80211Attrs::MeshPeerAid({
7368                    let res = parse_u16(next);
7369                    let Some(val) = res else { break };
7370                    val
7371                }),
7372                238u16 => Nl80211Attrs::NanMasterPref({
7373                    let res = parse_u8(next);
7374                    let Some(val) = res else { break };
7375                    val
7376                }),
7377                239u16 => Nl80211Attrs::Bands({
7378                    let res = parse_u32(next);
7379                    let Some(val) = res else { break };
7380                    val
7381                }),
7382                240u16 => Nl80211Attrs::NanFunc({
7383                    let res = Some(next);
7384                    let Some(val) = res else { break };
7385                    val
7386                }),
7387                241u16 => Nl80211Attrs::NanMatch({
7388                    let res = Some(next);
7389                    let Some(val) = res else { break };
7390                    val
7391                }),
7392                242u16 => Nl80211Attrs::FilsKek({
7393                    let res = Some(next);
7394                    let Some(val) = res else { break };
7395                    val
7396                }),
7397                243u16 => Nl80211Attrs::FilsNonces({
7398                    let res = Some(next);
7399                    let Some(val) = res else { break };
7400                    val
7401                }),
7402                244u16 => Nl80211Attrs::MulticastToUnicastEnabled(()),
7403                245u16 => Nl80211Attrs::Bssid({
7404                    let res = Some(next);
7405                    let Some(val) = res else { break };
7406                    val
7407                }),
7408                246u16 => Nl80211Attrs::SchedScanRelativeRssi({
7409                    let res = parse_i8(next);
7410                    let Some(val) = res else { break };
7411                    val
7412                }),
7413                247u16 => Nl80211Attrs::SchedScanRssiAdjust({
7414                    let res = Some(next);
7415                    let Some(val) = res else { break };
7416                    val
7417                }),
7418                248u16 => Nl80211Attrs::TimeoutReason({
7419                    let res = parse_u32(next);
7420                    let Some(val) = res else { break };
7421                    val
7422                }),
7423                249u16 => Nl80211Attrs::FilsErpUsername({
7424                    let res = Some(next);
7425                    let Some(val) = res else { break };
7426                    val
7427                }),
7428                250u16 => Nl80211Attrs::FilsErpRealm({
7429                    let res = Some(next);
7430                    let Some(val) = res else { break };
7431                    val
7432                }),
7433                251u16 => Nl80211Attrs::FilsErpNextSeqNum({
7434                    let res = parse_u16(next);
7435                    let Some(val) = res else { break };
7436                    val
7437                }),
7438                252u16 => Nl80211Attrs::FilsErpRrk({
7439                    let res = Some(next);
7440                    let Some(val) = res else { break };
7441                    val
7442                }),
7443                253u16 => Nl80211Attrs::FilsCacheId({
7444                    let res = Some(next);
7445                    let Some(val) = res else { break };
7446                    val
7447                }),
7448                254u16 => Nl80211Attrs::Pmk({
7449                    let res = Some(next);
7450                    let Some(val) = res else { break };
7451                    val
7452                }),
7453                255u16 => Nl80211Attrs::SchedScanMulti(()),
7454                256u16 => Nl80211Attrs::SchedScanMaxReqs({
7455                    let res = parse_u32(next);
7456                    let Some(val) = res else { break };
7457                    val
7458                }),
7459                257u16 => Nl80211Attrs::Want1x4wayHs(()),
7460                258u16 => Nl80211Attrs::Pmkr0Name({
7461                    let res = Some(next);
7462                    let Some(val) = res else { break };
7463                    val
7464                }),
7465                259u16 => Nl80211Attrs::PortAuthorized({
7466                    let res = Some(next);
7467                    let Some(val) = res else { break };
7468                    val
7469                }),
7470                260u16 => Nl80211Attrs::ExternalAuthAction({
7471                    let res = parse_u32(next);
7472                    let Some(val) = res else { break };
7473                    val
7474                }),
7475                261u16 => Nl80211Attrs::ExternalAuthSupport(()),
7476                262u16 => Nl80211Attrs::Nss({
7477                    let res = parse_u8(next);
7478                    let Some(val) = res else { break };
7479                    val
7480                }),
7481                263u16 => Nl80211Attrs::AckSignal({
7482                    let res = parse_i32(next);
7483                    let Some(val) = res else { break };
7484                    val
7485                }),
7486                264u16 => Nl80211Attrs::ControlPortOverNl80211(()),
7487                265u16 => Nl80211Attrs::TxqStats({
7488                    let res = Some(IterableTxqStatsAttrs::with_loc(next, self.orig_loc));
7489                    let Some(val) = res else { break };
7490                    val
7491                }),
7492                266u16 => Nl80211Attrs::TxqLimit({
7493                    let res = parse_u32(next);
7494                    let Some(val) = res else { break };
7495                    val
7496                }),
7497                267u16 => Nl80211Attrs::TxqMemoryLimit({
7498                    let res = parse_u32(next);
7499                    let Some(val) = res else { break };
7500                    val
7501                }),
7502                268u16 => Nl80211Attrs::TxqQuantum({
7503                    let res = parse_u32(next);
7504                    let Some(val) = res else { break };
7505                    val
7506                }),
7507                269u16 => Nl80211Attrs::HeCapability({
7508                    let res = Some(next);
7509                    let Some(val) = res else { break };
7510                    val
7511                }),
7512                270u16 => Nl80211Attrs::FtmResponder({
7513                    let res = Some(next);
7514                    let Some(val) = res else { break };
7515                    val
7516                }),
7517                271u16 => Nl80211Attrs::FtmResponderStats({
7518                    let res = Some(next);
7519                    let Some(val) = res else { break };
7520                    val
7521                }),
7522                272u16 => Nl80211Attrs::Timeout({
7523                    let res = parse_u32(next);
7524                    let Some(val) = res else { break };
7525                    val
7526                }),
7527                273u16 => Nl80211Attrs::PeerMeasurements({
7528                    let res = Some(next);
7529                    let Some(val) = res else { break };
7530                    val
7531                }),
7532                274u16 => Nl80211Attrs::AirtimeWeight({
7533                    let res = parse_u16(next);
7534                    let Some(val) = res else { break };
7535                    val
7536                }),
7537                275u16 => Nl80211Attrs::StaTxPowerSetting({
7538                    let res = parse_u8(next);
7539                    let Some(val) = res else { break };
7540                    val
7541                }),
7542                276u16 => Nl80211Attrs::StaTxPower({
7543                    let res = parse_i16(next);
7544                    let Some(val) = res else { break };
7545                    val
7546                }),
7547                277u16 => Nl80211Attrs::SaePassword({
7548                    let res = Some(next);
7549                    let Some(val) = res else { break };
7550                    val
7551                }),
7552                278u16 => Nl80211Attrs::TwtResponder(()),
7553                279u16 => Nl80211Attrs::HeObssPd({
7554                    let res = Some(next);
7555                    let Some(val) = res else { break };
7556                    val
7557                }),
7558                280u16 => Nl80211Attrs::WiphyEdmgChannels({
7559                    let res = parse_u8(next);
7560                    let Some(val) = res else { break };
7561                    val
7562                }),
7563                281u16 => Nl80211Attrs::WiphyEdmgBwConfig({
7564                    let res = parse_u8(next);
7565                    let Some(val) = res else { break };
7566                    val
7567                }),
7568                282u16 => Nl80211Attrs::VlanId({
7569                    let res = parse_u16(next);
7570                    let Some(val) = res else { break };
7571                    val
7572                }),
7573                283u16 => Nl80211Attrs::HeBssColor({
7574                    let res = Some(next);
7575                    let Some(val) = res else { break };
7576                    val
7577                }),
7578                284u16 => Nl80211Attrs::IftypeAkmSuites({
7579                    let res = Some(next);
7580                    let Some(val) = res else { break };
7581                    val
7582                }),
7583                285u16 => Nl80211Attrs::TidConfig({
7584                    let res = Some(next);
7585                    let Some(val) = res else { break };
7586                    val
7587                }),
7588                286u16 => Nl80211Attrs::ControlPortNoPreauth(()),
7589                287u16 => Nl80211Attrs::PmkLifetime({
7590                    let res = parse_u32(next);
7591                    let Some(val) = res else { break };
7592                    val
7593                }),
7594                288u16 => Nl80211Attrs::PmkReauthThreshold({
7595                    let res = parse_u8(next);
7596                    let Some(val) = res else { break };
7597                    val
7598                }),
7599                289u16 => Nl80211Attrs::ReceiveMulticast(()),
7600                290u16 => Nl80211Attrs::WiphyFreqOffset({
7601                    let res = parse_u32(next);
7602                    let Some(val) = res else { break };
7603                    val
7604                }),
7605                291u16 => Nl80211Attrs::CenterFreq1Offset({
7606                    let res = parse_u32(next);
7607                    let Some(val) = res else { break };
7608                    val
7609                }),
7610                292u16 => Nl80211Attrs::ScanFreqKhz({
7611                    let res = Some(next);
7612                    let Some(val) = res else { break };
7613                    val
7614                }),
7615                293u16 => Nl80211Attrs::He6ghzCapability({
7616                    let res = Some(next);
7617                    let Some(val) = res else { break };
7618                    val
7619                }),
7620                294u16 => Nl80211Attrs::FilsDiscovery({
7621                    let res = Some(next);
7622                    let Some(val) = res else { break };
7623                    val
7624                }),
7625                295u16 => Nl80211Attrs::UnsolBcastProbeResp({
7626                    let res = Some(next);
7627                    let Some(val) = res else { break };
7628                    val
7629                }),
7630                296u16 => Nl80211Attrs::S1gCapability({
7631                    let res = Some(next);
7632                    let Some(val) = res else { break };
7633                    val
7634                }),
7635                297u16 => Nl80211Attrs::S1gCapabilityMask({
7636                    let res = Some(next);
7637                    let Some(val) = res else { break };
7638                    val
7639                }),
7640                298u16 => Nl80211Attrs::SaePwe({
7641                    let res = parse_u8(next);
7642                    let Some(val) = res else { break };
7643                    val
7644                }),
7645                299u16 => Nl80211Attrs::ReconnectRequested({
7646                    let res = Some(next);
7647                    let Some(val) = res else { break };
7648                    val
7649                }),
7650                300u16 => Nl80211Attrs::SarSpec({
7651                    let res = Some(IterableSarAttributes::with_loc(next, self.orig_loc));
7652                    let Some(val) = res else { break };
7653                    val
7654                }),
7655                301u16 => Nl80211Attrs::DisableHe(()),
7656                302u16 => Nl80211Attrs::ObssColorBitmap({
7657                    let res = parse_u64(next);
7658                    let Some(val) = res else { break };
7659                    val
7660                }),
7661                303u16 => Nl80211Attrs::ColorChangeCount({
7662                    let res = parse_u8(next);
7663                    let Some(val) = res else { break };
7664                    val
7665                }),
7666                304u16 => Nl80211Attrs::ColorChangeColor({
7667                    let res = parse_u8(next);
7668                    let Some(val) = res else { break };
7669                    val
7670                }),
7671                305u16 => Nl80211Attrs::ColorChangeElems({
7672                    let res = Some(next);
7673                    let Some(val) = res else { break };
7674                    val
7675                }),
7676                306u16 => Nl80211Attrs::MbssidConfig({
7677                    let res = Some(next);
7678                    let Some(val) = res else { break };
7679                    val
7680                }),
7681                307u16 => Nl80211Attrs::MbssidElems({
7682                    let res = Some(next);
7683                    let Some(val) = res else { break };
7684                    val
7685                }),
7686                308u16 => Nl80211Attrs::RadarBackground(()),
7687                309u16 => Nl80211Attrs::ApSettingsFlags({
7688                    let res = parse_u32(next);
7689                    let Some(val) = res else { break };
7690                    val
7691                }),
7692                310u16 => Nl80211Attrs::EhtCapability({
7693                    let res = Some(next);
7694                    let Some(val) = res else { break };
7695                    val
7696                }),
7697                311u16 => Nl80211Attrs::DisableEht(()),
7698                312u16 => Nl80211Attrs::MloLinks({
7699                    let res = Some(next);
7700                    let Some(val) = res else { break };
7701                    val
7702                }),
7703                313u16 => Nl80211Attrs::MloLinkId({
7704                    let res = parse_u8(next);
7705                    let Some(val) = res else { break };
7706                    val
7707                }),
7708                314u16 => Nl80211Attrs::MldAddr({
7709                    let res = Some(next);
7710                    let Some(val) = res else { break };
7711                    val
7712                }),
7713                315u16 => Nl80211Attrs::MloSupport(()),
7714                316u16 => Nl80211Attrs::MaxNumAkmSuites({
7715                    let res = Some(next);
7716                    let Some(val) = res else { break };
7717                    val
7718                }),
7719                317u16 => Nl80211Attrs::EmlCapability({
7720                    let res = parse_u16(next);
7721                    let Some(val) = res else { break };
7722                    val
7723                }),
7724                318u16 => Nl80211Attrs::MldCapaAndOps({
7725                    let res = parse_u16(next);
7726                    let Some(val) = res else { break };
7727                    val
7728                }),
7729                319u16 => Nl80211Attrs::TxHwTimestamp({
7730                    let res = parse_u64(next);
7731                    let Some(val) = res else { break };
7732                    val
7733                }),
7734                320u16 => Nl80211Attrs::RxHwTimestamp({
7735                    let res = parse_u64(next);
7736                    let Some(val) = res else { break };
7737                    val
7738                }),
7739                321u16 => Nl80211Attrs::TdBitmap({
7740                    let res = Some(next);
7741                    let Some(val) = res else { break };
7742                    val
7743                }),
7744                322u16 => Nl80211Attrs::PunctBitmap({
7745                    let res = parse_u32(next);
7746                    let Some(val) = res else { break };
7747                    val
7748                }),
7749                323u16 => Nl80211Attrs::MaxHwTimestampPeers({
7750                    let res = parse_u16(next);
7751                    let Some(val) = res else { break };
7752                    val
7753                }),
7754                324u16 => Nl80211Attrs::HwTimestampEnabled(()),
7755                325u16 => Nl80211Attrs::EmaRnrElems({
7756                    let res = Some(next);
7757                    let Some(val) = res else { break };
7758                    val
7759                }),
7760                326u16 => Nl80211Attrs::MloLinkDisabled(()),
7761                327u16 => Nl80211Attrs::BssDumpIncludeUseData(()),
7762                328u16 => Nl80211Attrs::MloTtlmDlink({
7763                    let res = parse_u16(next);
7764                    let Some(val) = res else { break };
7765                    val
7766                }),
7767                329u16 => Nl80211Attrs::MloTtlmUlink({
7768                    let res = parse_u16(next);
7769                    let Some(val) = res else { break };
7770                    val
7771                }),
7772                330u16 => Nl80211Attrs::AssocSppAmsdu(()),
7773                331u16 => Nl80211Attrs::WiphyRadios({
7774                    let res = Some(next);
7775                    let Some(val) = res else { break };
7776                    val
7777                }),
7778                332u16 => Nl80211Attrs::WiphyInterfaceCombinations({
7779                    let res = Some(next);
7780                    let Some(val) = res else { break };
7781                    val
7782                }),
7783                333u16 => Nl80211Attrs::VifRadioMask({
7784                    let res = parse_u32(next);
7785                    let Some(val) = res else { break };
7786                    val
7787                }),
7788                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
7789                n => continue,
7790            };
7791            return Some(Ok(res));
7792        }
7793        Some(Err(ErrorContext::new(
7794            "Nl80211Attrs",
7795            r#type.and_then(|t| Nl80211Attrs::attr_from_type(t)),
7796            self.orig_loc,
7797            self.buf.as_ptr().wrapping_add(pos) as usize,
7798        )))
7799    }
7800}
7801impl std::fmt::Debug for IterableArrayU32<'_> {
7802    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7803        fmt.debug_list()
7804            .entries(self.clone().map(FlattenErrorContext))
7805            .finish()
7806    }
7807}
7808impl std::fmt::Debug for IterableArrayIfCombinationAttributes<'_> {
7809    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7810        fmt.debug_list()
7811            .entries(self.clone().map(FlattenErrorContext))
7812            .finish()
7813    }
7814}
7815impl<'a> std::fmt::Debug for IterableNl80211Attrs<'_> {
7816    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7817        let mut fmt = f.debug_struct("Nl80211Attrs");
7818        for attr in self.clone() {
7819            let attr = match attr {
7820                Ok(a) => a,
7821                Err(err) => {
7822                    fmt.finish()?;
7823                    f.write_str("Err(")?;
7824                    err.fmt(f)?;
7825                    return f.write_str(")");
7826                }
7827            };
7828            match attr {
7829                Nl80211Attrs::Wiphy(val) => fmt.field("Wiphy", &val),
7830                Nl80211Attrs::WiphyName(val) => fmt.field("WiphyName", &val),
7831                Nl80211Attrs::Ifindex(val) => fmt.field("Ifindex", &val),
7832                Nl80211Attrs::Ifname(val) => fmt.field("Ifname", &val),
7833                Nl80211Attrs::Iftype(val) => fmt.field("Iftype", &val),
7834                Nl80211Attrs::Mac(val) => fmt.field("Mac", &FormatMac(val)),
7835                Nl80211Attrs::KeyData(val) => fmt.field("KeyData", &val),
7836                Nl80211Attrs::KeyIdx(val) => fmt.field("KeyIdx", &val),
7837                Nl80211Attrs::KeyCipher(val) => fmt.field("KeyCipher", &val),
7838                Nl80211Attrs::KeySeq(val) => fmt.field("KeySeq", &val),
7839                Nl80211Attrs::KeyDefault(val) => fmt.field("KeyDefault", &val),
7840                Nl80211Attrs::BeaconInterval(val) => fmt.field("BeaconInterval", &val),
7841                Nl80211Attrs::DtimPeriod(val) => fmt.field("DtimPeriod", &val),
7842                Nl80211Attrs::BeaconHead(val) => fmt.field("BeaconHead", &val),
7843                Nl80211Attrs::BeaconTail(val) => fmt.field("BeaconTail", &val),
7844                Nl80211Attrs::StaAid(val) => fmt.field("StaAid", &val),
7845                Nl80211Attrs::StaFlags(val) => fmt.field("StaFlags", &val),
7846                Nl80211Attrs::StaListenInterval(val) => fmt.field("StaListenInterval", &val),
7847                Nl80211Attrs::StaSupportedRates(val) => fmt.field("StaSupportedRates", &val),
7848                Nl80211Attrs::StaVlan(val) => fmt.field("StaVlan", &val),
7849                Nl80211Attrs::StaInfo(val) => fmt.field("StaInfo", &val),
7850                Nl80211Attrs::WiphyBands(val) => fmt.field("WiphyBands", &val),
7851                Nl80211Attrs::MntrFlags(val) => fmt.field("MntrFlags", &val),
7852                Nl80211Attrs::MeshId(val) => fmt.field("MeshId", &val),
7853                Nl80211Attrs::StaPlinkAction(val) => fmt.field("StaPlinkAction", &val),
7854                Nl80211Attrs::MpathNextHop(val) => fmt.field("MpathNextHop", &FormatMac(val)),
7855                Nl80211Attrs::MpathInfo(val) => fmt.field("MpathInfo", &val),
7856                Nl80211Attrs::BssCtsProt(val) => fmt.field("BssCtsProt", &val),
7857                Nl80211Attrs::BssShortPreamble(val) => fmt.field("BssShortPreamble", &val),
7858                Nl80211Attrs::BssShortSlotTime(val) => fmt.field("BssShortSlotTime", &val),
7859                Nl80211Attrs::HtCapability(val) => fmt.field("HtCapability", &val),
7860                Nl80211Attrs::SupportedIftypes(val) => fmt.field("SupportedIftypes", &val),
7861                Nl80211Attrs::RegAlpha2(val) => fmt.field("RegAlpha2", &val),
7862                Nl80211Attrs::RegRules(val) => fmt.field("RegRules", &val),
7863                Nl80211Attrs::MeshConfig(val) => fmt.field("MeshConfig", &val),
7864                Nl80211Attrs::BssBasicRates(val) => fmt.field("BssBasicRates", &val),
7865                Nl80211Attrs::WiphyTxqParams(val) => fmt.field("WiphyTxqParams", &val),
7866                Nl80211Attrs::WiphyFreq(val) => fmt.field("WiphyFreq", &val),
7867                Nl80211Attrs::WiphyChannelType(val) => fmt.field(
7868                    "WiphyChannelType",
7869                    &FormatEnum(val.into(), ChannelType::from_value),
7870                ),
7871                Nl80211Attrs::KeyDefaultMgmt(val) => fmt.field("KeyDefaultMgmt", &val),
7872                Nl80211Attrs::MgmtSubtype(val) => fmt.field("MgmtSubtype", &val),
7873                Nl80211Attrs::Ie(val) => fmt.field("Ie", &val),
7874                Nl80211Attrs::MaxNumScanSsids(val) => fmt.field("MaxNumScanSsids", &val),
7875                Nl80211Attrs::ScanFrequencies(val) => fmt.field("ScanFrequencies", &val),
7876                Nl80211Attrs::ScanSsids(val) => fmt.field("ScanSsids", &val),
7877                Nl80211Attrs::Generation(val) => fmt.field("Generation", &val),
7878                Nl80211Attrs::Bss(val) => fmt.field("Bss", &val),
7879                Nl80211Attrs::RegInitiator(val) => fmt.field("RegInitiator", &val),
7880                Nl80211Attrs::RegType(val) => fmt.field("RegType", &val),
7881                Nl80211Attrs::SupportedCommands(val) => fmt.field(
7882                    "SupportedCommands",
7883                    &MapFormatArray(val, |v| FormatEnum(v.into(), Commands::from_value)),
7884                ),
7885                Nl80211Attrs::Frame(val) => fmt.field("Frame", &val),
7886                Nl80211Attrs::Ssid(val) => fmt.field("Ssid", &val),
7887                Nl80211Attrs::AuthType(val) => fmt.field("AuthType", &val),
7888                Nl80211Attrs::ReasonCode(val) => fmt.field("ReasonCode", &val),
7889                Nl80211Attrs::KeyType(val) => fmt.field("KeyType", &val),
7890                Nl80211Attrs::MaxScanIeLen(val) => fmt.field("MaxScanIeLen", &val),
7891                Nl80211Attrs::CipherSuites(val) => fmt.field("CipherSuites", &FormatHex(val)),
7892                Nl80211Attrs::FreqBefore(val) => fmt.field("FreqBefore", &val),
7893                Nl80211Attrs::FreqAfter(val) => fmt.field("FreqAfter", &val),
7894                Nl80211Attrs::FreqFixed(val) => fmt.field("FreqFixed", &val),
7895                Nl80211Attrs::WiphyRetryShort(val) => fmt.field("WiphyRetryShort", &val),
7896                Nl80211Attrs::WiphyRetryLong(val) => fmt.field("WiphyRetryLong", &val),
7897                Nl80211Attrs::WiphyFragThreshold(val) => fmt.field("WiphyFragThreshold", &val),
7898                Nl80211Attrs::WiphyRtsThreshold(val) => fmt.field("WiphyRtsThreshold", &val),
7899                Nl80211Attrs::TimedOut(val) => fmt.field("TimedOut", &val),
7900                Nl80211Attrs::UseMfp(val) => fmt.field("UseMfp", &val),
7901                Nl80211Attrs::StaFlags2(val) => fmt.field("StaFlags2", &val),
7902                Nl80211Attrs::ControlPort(val) => fmt.field("ControlPort", &val),
7903                Nl80211Attrs::Testdata(val) => fmt.field("Testdata", &val),
7904                Nl80211Attrs::Privacy(val) => fmt.field("Privacy", &val),
7905                Nl80211Attrs::DisconnectedByAp(val) => fmt.field("DisconnectedByAp", &val),
7906                Nl80211Attrs::StatusCode(val) => fmt.field("StatusCode", &val),
7907                Nl80211Attrs::CipherSuitesPairwise(val) => fmt.field("CipherSuitesPairwise", &val),
7908                Nl80211Attrs::CipherSuiteGroup(val) => fmt.field("CipherSuiteGroup", &val),
7909                Nl80211Attrs::WpaVersions(val) => fmt.field("WpaVersions", &val),
7910                Nl80211Attrs::AkmSuites(val) => fmt.field("AkmSuites", &val),
7911                Nl80211Attrs::ReqIe(val) => fmt.field("ReqIe", &val),
7912                Nl80211Attrs::RespIe(val) => fmt.field("RespIe", &val),
7913                Nl80211Attrs::PrevBssid(val) => fmt.field("PrevBssid", &val),
7914                Nl80211Attrs::Key(val) => fmt.field("Key", &val),
7915                Nl80211Attrs::Keys(val) => fmt.field("Keys", &val),
7916                Nl80211Attrs::Pid(val) => fmt.field("Pid", &val),
7917                Nl80211Attrs::_4addr(val) => fmt.field("_4addr", &val),
7918                Nl80211Attrs::SurveyInfo(val) => fmt.field("SurveyInfo", &val),
7919                Nl80211Attrs::Pmkid(val) => fmt.field("Pmkid", &val),
7920                Nl80211Attrs::MaxNumPmkids(val) => fmt.field("MaxNumPmkids", &val),
7921                Nl80211Attrs::Duration(val) => fmt.field("Duration", &val),
7922                Nl80211Attrs::Cookie(val) => fmt.field("Cookie", &val),
7923                Nl80211Attrs::WiphyCoverageClass(val) => fmt.field("WiphyCoverageClass", &val),
7924                Nl80211Attrs::TxRates(val) => fmt.field("TxRates", &val),
7925                Nl80211Attrs::FrameMatch(val) => fmt.field("FrameMatch", &val),
7926                Nl80211Attrs::Ack(val) => fmt.field("Ack", &val),
7927                Nl80211Attrs::PsState(val) => fmt.field("PsState", &val),
7928                Nl80211Attrs::Cqm(val) => fmt.field("Cqm", &val),
7929                Nl80211Attrs::LocalStateChange(val) => fmt.field("LocalStateChange", &val),
7930                Nl80211Attrs::ApIsolate(val) => fmt.field("ApIsolate", &val),
7931                Nl80211Attrs::WiphyTxPowerSetting(val) => fmt.field("WiphyTxPowerSetting", &val),
7932                Nl80211Attrs::WiphyTxPowerLevel(val) => fmt.field("WiphyTxPowerLevel", &val),
7933                Nl80211Attrs::TxFrameTypes(val) => fmt.field("TxFrameTypes", &val),
7934                Nl80211Attrs::RxFrameTypes(val) => fmt.field("RxFrameTypes", &val),
7935                Nl80211Attrs::FrameType(val) => fmt.field("FrameType", &val),
7936                Nl80211Attrs::ControlPortEthertype(val) => fmt.field("ControlPortEthertype", &val),
7937                Nl80211Attrs::ControlPortNoEncrypt(val) => fmt.field("ControlPortNoEncrypt", &val),
7938                Nl80211Attrs::SupportIbssRsn(val) => fmt.field("SupportIbssRsn", &val),
7939                Nl80211Attrs::WiphyAntennaTx(val) => fmt.field("WiphyAntennaTx", &val),
7940                Nl80211Attrs::WiphyAntennaRx(val) => fmt.field("WiphyAntennaRx", &val),
7941                Nl80211Attrs::McastRate(val) => fmt.field("McastRate", &val),
7942                Nl80211Attrs::OffchannelTxOk(val) => fmt.field("OffchannelTxOk", &val),
7943                Nl80211Attrs::BssHtOpmode(val) => fmt.field("BssHtOpmode", &val),
7944                Nl80211Attrs::KeyDefaultTypes(val) => fmt.field("KeyDefaultTypes", &val),
7945                Nl80211Attrs::MaxRemainOnChannelDuration(val) => {
7946                    fmt.field("MaxRemainOnChannelDuration", &val)
7947                }
7948                Nl80211Attrs::MeshSetup(val) => fmt.field("MeshSetup", &val),
7949                Nl80211Attrs::WiphyAntennaAvailTx(val) => fmt.field("WiphyAntennaAvailTx", &val),
7950                Nl80211Attrs::WiphyAntennaAvailRx(val) => fmt.field("WiphyAntennaAvailRx", &val),
7951                Nl80211Attrs::SupportMeshAuth(val) => fmt.field("SupportMeshAuth", &val),
7952                Nl80211Attrs::StaPlinkState(val) => fmt.field("StaPlinkState", &val),
7953                Nl80211Attrs::WowlanTriggers(val) => fmt.field("WowlanTriggers", &val),
7954                Nl80211Attrs::WowlanTriggersSupported(val) => {
7955                    fmt.field("WowlanTriggersSupported", &val)
7956                }
7957                Nl80211Attrs::SchedScanInterval(val) => fmt.field("SchedScanInterval", &val),
7958                Nl80211Attrs::InterfaceCombinations(val) => {
7959                    fmt.field("InterfaceCombinations", &val)
7960                }
7961                Nl80211Attrs::SoftwareIftypes(val) => fmt.field("SoftwareIftypes", &val),
7962                Nl80211Attrs::RekeyData(val) => fmt.field("RekeyData", &val),
7963                Nl80211Attrs::MaxNumSchedScanSsids(val) => fmt.field("MaxNumSchedScanSsids", &val),
7964                Nl80211Attrs::MaxSchedScanIeLen(val) => fmt.field("MaxSchedScanIeLen", &val),
7965                Nl80211Attrs::ScanSuppRates(val) => fmt.field("ScanSuppRates", &val),
7966                Nl80211Attrs::HiddenSsid(val) => fmt.field("HiddenSsid", &val),
7967                Nl80211Attrs::IeProbeResp(val) => fmt.field("IeProbeResp", &val),
7968                Nl80211Attrs::IeAssocResp(val) => fmt.field("IeAssocResp", &val),
7969                Nl80211Attrs::StaWme(val) => fmt.field("StaWme", &val),
7970                Nl80211Attrs::SupportApUapsd(val) => fmt.field("SupportApUapsd", &val),
7971                Nl80211Attrs::RoamSupport(val) => fmt.field("RoamSupport", &val),
7972                Nl80211Attrs::SchedScanMatch(val) => fmt.field("SchedScanMatch", &val),
7973                Nl80211Attrs::MaxMatchSets(val) => fmt.field("MaxMatchSets", &val),
7974                Nl80211Attrs::PmksaCandidate(val) => fmt.field("PmksaCandidate", &val),
7975                Nl80211Attrs::TxNoCckRate(val) => fmt.field("TxNoCckRate", &val),
7976                Nl80211Attrs::TdlsAction(val) => fmt.field("TdlsAction", &val),
7977                Nl80211Attrs::TdlsDialogToken(val) => fmt.field("TdlsDialogToken", &val),
7978                Nl80211Attrs::TdlsOperation(val) => fmt.field("TdlsOperation", &val),
7979                Nl80211Attrs::TdlsSupport(val) => fmt.field("TdlsSupport", &val),
7980                Nl80211Attrs::TdlsExternalSetup(val) => fmt.field("TdlsExternalSetup", &val),
7981                Nl80211Attrs::DeviceApSme(val) => fmt.field("DeviceApSme", &val),
7982                Nl80211Attrs::DontWaitForAck(val) => fmt.field("DontWaitForAck", &val),
7983                Nl80211Attrs::FeatureFlags(val) => fmt.field(
7984                    "FeatureFlags",
7985                    &FormatFlags(val.into(), FeatureFlags::from_value),
7986                ),
7987                Nl80211Attrs::ProbeRespOffload(val) => fmt.field("ProbeRespOffload", &val),
7988                Nl80211Attrs::ProbeResp(val) => fmt.field("ProbeResp", &val),
7989                Nl80211Attrs::DfsRegion(val) => fmt.field("DfsRegion", &val),
7990                Nl80211Attrs::DisableHt(val) => fmt.field("DisableHt", &val),
7991                Nl80211Attrs::HtCapabilityMask(val) => fmt.field("HtCapabilityMask", &val),
7992                Nl80211Attrs::NoackMap(val) => fmt.field("NoackMap", &val),
7993                Nl80211Attrs::InactivityTimeout(val) => fmt.field("InactivityTimeout", &val),
7994                Nl80211Attrs::RxSignalDbm(val) => fmt.field("RxSignalDbm", &val),
7995                Nl80211Attrs::BgScanPeriod(val) => fmt.field("BgScanPeriod", &val),
7996                Nl80211Attrs::Wdev(val) => fmt.field("Wdev", &val),
7997                Nl80211Attrs::UserRegHintType(val) => fmt.field("UserRegHintType", &val),
7998                Nl80211Attrs::ConnFailedReason(val) => fmt.field("ConnFailedReason", &val),
7999                Nl80211Attrs::AuthData(val) => fmt.field("AuthData", &val),
8000                Nl80211Attrs::VhtCapability(val) => fmt.field("VhtCapability", &val),
8001                Nl80211Attrs::ScanFlags(val) => fmt.field("ScanFlags", &val),
8002                Nl80211Attrs::ChannelWidth(val) => fmt.field("ChannelWidth", &val),
8003                Nl80211Attrs::CenterFreq1(val) => fmt.field("CenterFreq1", &val),
8004                Nl80211Attrs::CenterFreq2(val) => fmt.field("CenterFreq2", &val),
8005                Nl80211Attrs::P2pCtwindow(val) => fmt.field("P2pCtwindow", &val),
8006                Nl80211Attrs::P2pOppps(val) => fmt.field("P2pOppps", &val),
8007                Nl80211Attrs::LocalMeshPowerMode(val) => fmt.field("LocalMeshPowerMode", &val),
8008                Nl80211Attrs::AclPolicy(val) => fmt.field("AclPolicy", &val),
8009                Nl80211Attrs::MacAddrs(val) => fmt.field("MacAddrs", &val),
8010                Nl80211Attrs::MacAclMax(val) => fmt.field("MacAclMax", &val),
8011                Nl80211Attrs::RadarEvent(val) => fmt.field("RadarEvent", &val),
8012                Nl80211Attrs::ExtCapa(val) => fmt.field("ExtCapa", &val),
8013                Nl80211Attrs::ExtCapaMask(val) => fmt.field("ExtCapaMask", &val),
8014                Nl80211Attrs::StaCapability(val) => fmt.field("StaCapability", &val),
8015                Nl80211Attrs::StaExtCapability(val) => fmt.field("StaExtCapability", &val),
8016                Nl80211Attrs::ProtocolFeatures(val) => fmt.field(
8017                    "ProtocolFeatures",
8018                    &FormatFlags(val.into(), ProtocolFeatures::from_value),
8019                ),
8020                Nl80211Attrs::SplitWiphyDump(val) => fmt.field("SplitWiphyDump", &val),
8021                Nl80211Attrs::DisableVht(val) => fmt.field("DisableVht", &val),
8022                Nl80211Attrs::VhtCapabilityMask(val) => fmt.field("VhtCapabilityMask", &val),
8023                Nl80211Attrs::Mdid(val) => fmt.field("Mdid", &val),
8024                Nl80211Attrs::IeRic(val) => fmt.field("IeRic", &val),
8025                Nl80211Attrs::CritProtId(val) => fmt.field("CritProtId", &val),
8026                Nl80211Attrs::MaxCritProtDuration(val) => fmt.field("MaxCritProtDuration", &val),
8027                Nl80211Attrs::PeerAid(val) => fmt.field("PeerAid", &val),
8028                Nl80211Attrs::CoalesceRule(val) => fmt.field("CoalesceRule", &val),
8029                Nl80211Attrs::ChSwitchCount(val) => fmt.field("ChSwitchCount", &val),
8030                Nl80211Attrs::ChSwitchBlockTx(val) => fmt.field("ChSwitchBlockTx", &val),
8031                Nl80211Attrs::CsaIes(val) => fmt.field("CsaIes", &val),
8032                Nl80211Attrs::CntdwnOffsBeacon(val) => fmt.field("CntdwnOffsBeacon", &val),
8033                Nl80211Attrs::CntdwnOffsPresp(val) => fmt.field("CntdwnOffsPresp", &val),
8034                Nl80211Attrs::RxmgmtFlags(val) => fmt.field("RxmgmtFlags", &val),
8035                Nl80211Attrs::StaSupportedChannels(val) => fmt.field("StaSupportedChannels", &val),
8036                Nl80211Attrs::StaSupportedOperClasses(val) => {
8037                    fmt.field("StaSupportedOperClasses", &val)
8038                }
8039                Nl80211Attrs::HandleDfs(val) => fmt.field("HandleDfs", &val),
8040                Nl80211Attrs::Support5Mhz(val) => fmt.field("Support5Mhz", &val),
8041                Nl80211Attrs::Support10Mhz(val) => fmt.field("Support10Mhz", &val),
8042                Nl80211Attrs::OpmodeNotif(val) => fmt.field("OpmodeNotif", &val),
8043                Nl80211Attrs::VendorId(val) => fmt.field("VendorId", &val),
8044                Nl80211Attrs::VendorSubcmd(val) => fmt.field("VendorSubcmd", &val),
8045                Nl80211Attrs::VendorData(val) => fmt.field("VendorData", &val),
8046                Nl80211Attrs::VendorEvents(val) => fmt.field("VendorEvents", &val),
8047                Nl80211Attrs::QosMap(val) => fmt.field("QosMap", &val),
8048                Nl80211Attrs::MacHint(val) => fmt.field("MacHint", &FormatMac(val)),
8049                Nl80211Attrs::WiphyFreqHint(val) => fmt.field("WiphyFreqHint", &val),
8050                Nl80211Attrs::MaxApAssocSta(val) => fmt.field("MaxApAssocSta", &val),
8051                Nl80211Attrs::TdlsPeerCapability(val) => fmt.field("TdlsPeerCapability", &val),
8052                Nl80211Attrs::SocketOwner(val) => fmt.field("SocketOwner", &val),
8053                Nl80211Attrs::CsaCOffsetsTx(val) => fmt.field("CsaCOffsetsTx", &val),
8054                Nl80211Attrs::MaxCsaCounters(val) => fmt.field("MaxCsaCounters", &val),
8055                Nl80211Attrs::TdlsInitiator(val) => fmt.field("TdlsInitiator", &val),
8056                Nl80211Attrs::UseRrm(val) => fmt.field("UseRrm", &val),
8057                Nl80211Attrs::WiphyDynAck(val) => fmt.field("WiphyDynAck", &val),
8058                Nl80211Attrs::Tsid(val) => fmt.field("Tsid", &val),
8059                Nl80211Attrs::UserPrio(val) => fmt.field("UserPrio", &val),
8060                Nl80211Attrs::AdmittedTime(val) => fmt.field("AdmittedTime", &val),
8061                Nl80211Attrs::SmpsMode(val) => fmt.field("SmpsMode", &val),
8062                Nl80211Attrs::OperClass(val) => fmt.field("OperClass", &val),
8063                Nl80211Attrs::MacMask(val) => fmt.field("MacMask", &FormatMac(val)),
8064                Nl80211Attrs::WiphySelfManagedReg(val) => fmt.field("WiphySelfManagedReg", &val),
8065                Nl80211Attrs::ExtFeatures(val) => fmt.field("ExtFeatures", &val),
8066                Nl80211Attrs::SurveyRadioStats(val) => fmt.field("SurveyRadioStats", &val),
8067                Nl80211Attrs::NetnsFd(val) => fmt.field("NetnsFd", &val),
8068                Nl80211Attrs::SchedScanDelay(val) => fmt.field("SchedScanDelay", &val),
8069                Nl80211Attrs::RegIndoor(val) => fmt.field("RegIndoor", &val),
8070                Nl80211Attrs::MaxNumSchedScanPlans(val) => fmt.field("MaxNumSchedScanPlans", &val),
8071                Nl80211Attrs::MaxScanPlanInterval(val) => fmt.field("MaxScanPlanInterval", &val),
8072                Nl80211Attrs::MaxScanPlanIterations(val) => {
8073                    fmt.field("MaxScanPlanIterations", &val)
8074                }
8075                Nl80211Attrs::SchedScanPlans(val) => fmt.field("SchedScanPlans", &val),
8076                Nl80211Attrs::Pbss(val) => fmt.field("Pbss", &val),
8077                Nl80211Attrs::BssSelect(val) => fmt.field("BssSelect", &val),
8078                Nl80211Attrs::StaSupportP2pPs(val) => fmt.field("StaSupportP2pPs", &val),
8079                Nl80211Attrs::Pad(val) => fmt.field("Pad", &val),
8080                Nl80211Attrs::IftypeExtCapa(val) => fmt.field("IftypeExtCapa", &val),
8081                Nl80211Attrs::MuMimoGroupData(val) => fmt.field("MuMimoGroupData", &val),
8082                Nl80211Attrs::MuMimoFollowMacAddr(val) => {
8083                    fmt.field("MuMimoFollowMacAddr", &FormatMac(val))
8084                }
8085                Nl80211Attrs::ScanStartTimeTsf(val) => fmt.field("ScanStartTimeTsf", &val),
8086                Nl80211Attrs::ScanStartTimeTsfBssid(val) => {
8087                    fmt.field("ScanStartTimeTsfBssid", &val)
8088                }
8089                Nl80211Attrs::MeasurementDuration(val) => fmt.field("MeasurementDuration", &val),
8090                Nl80211Attrs::MeasurementDurationMandatory(val) => {
8091                    fmt.field("MeasurementDurationMandatory", &val)
8092                }
8093                Nl80211Attrs::MeshPeerAid(val) => fmt.field("MeshPeerAid", &val),
8094                Nl80211Attrs::NanMasterPref(val) => fmt.field("NanMasterPref", &val),
8095                Nl80211Attrs::Bands(val) => fmt.field("Bands", &val),
8096                Nl80211Attrs::NanFunc(val) => fmt.field("NanFunc", &val),
8097                Nl80211Attrs::NanMatch(val) => fmt.field("NanMatch", &val),
8098                Nl80211Attrs::FilsKek(val) => fmt.field("FilsKek", &val),
8099                Nl80211Attrs::FilsNonces(val) => fmt.field("FilsNonces", &val),
8100                Nl80211Attrs::MulticastToUnicastEnabled(val) => {
8101                    fmt.field("MulticastToUnicastEnabled", &val)
8102                }
8103                Nl80211Attrs::Bssid(val) => fmt.field("Bssid", &FormatMac(val)),
8104                Nl80211Attrs::SchedScanRelativeRssi(val) => {
8105                    fmt.field("SchedScanRelativeRssi", &val)
8106                }
8107                Nl80211Attrs::SchedScanRssiAdjust(val) => fmt.field("SchedScanRssiAdjust", &val),
8108                Nl80211Attrs::TimeoutReason(val) => fmt.field("TimeoutReason", &val),
8109                Nl80211Attrs::FilsErpUsername(val) => fmt.field("FilsErpUsername", &val),
8110                Nl80211Attrs::FilsErpRealm(val) => fmt.field("FilsErpRealm", &val),
8111                Nl80211Attrs::FilsErpNextSeqNum(val) => fmt.field("FilsErpNextSeqNum", &val),
8112                Nl80211Attrs::FilsErpRrk(val) => fmt.field("FilsErpRrk", &val),
8113                Nl80211Attrs::FilsCacheId(val) => fmt.field("FilsCacheId", &val),
8114                Nl80211Attrs::Pmk(val) => fmt.field("Pmk", &val),
8115                Nl80211Attrs::SchedScanMulti(val) => fmt.field("SchedScanMulti", &val),
8116                Nl80211Attrs::SchedScanMaxReqs(val) => fmt.field("SchedScanMaxReqs", &val),
8117                Nl80211Attrs::Want1x4wayHs(val) => fmt.field("Want1x4wayHs", &val),
8118                Nl80211Attrs::Pmkr0Name(val) => fmt.field("Pmkr0Name", &val),
8119                Nl80211Attrs::PortAuthorized(val) => fmt.field("PortAuthorized", &val),
8120                Nl80211Attrs::ExternalAuthAction(val) => fmt.field("ExternalAuthAction", &val),
8121                Nl80211Attrs::ExternalAuthSupport(val) => fmt.field("ExternalAuthSupport", &val),
8122                Nl80211Attrs::Nss(val) => fmt.field("Nss", &val),
8123                Nl80211Attrs::AckSignal(val) => fmt.field("AckSignal", &val),
8124                Nl80211Attrs::ControlPortOverNl80211(val) => {
8125                    fmt.field("ControlPortOverNl80211", &val)
8126                }
8127                Nl80211Attrs::TxqStats(val) => fmt.field("TxqStats", &val),
8128                Nl80211Attrs::TxqLimit(val) => fmt.field("TxqLimit", &val),
8129                Nl80211Attrs::TxqMemoryLimit(val) => fmt.field("TxqMemoryLimit", &val),
8130                Nl80211Attrs::TxqQuantum(val) => fmt.field("TxqQuantum", &val),
8131                Nl80211Attrs::HeCapability(val) => fmt.field("HeCapability", &val),
8132                Nl80211Attrs::FtmResponder(val) => fmt.field("FtmResponder", &val),
8133                Nl80211Attrs::FtmResponderStats(val) => fmt.field("FtmResponderStats", &val),
8134                Nl80211Attrs::Timeout(val) => fmt.field("Timeout", &val),
8135                Nl80211Attrs::PeerMeasurements(val) => fmt.field("PeerMeasurements", &val),
8136                Nl80211Attrs::AirtimeWeight(val) => fmt.field("AirtimeWeight", &val),
8137                Nl80211Attrs::StaTxPowerSetting(val) => fmt.field("StaTxPowerSetting", &val),
8138                Nl80211Attrs::StaTxPower(val) => fmt.field("StaTxPower", &val),
8139                Nl80211Attrs::SaePassword(val) => fmt.field("SaePassword", &val),
8140                Nl80211Attrs::TwtResponder(val) => fmt.field("TwtResponder", &val),
8141                Nl80211Attrs::HeObssPd(val) => fmt.field("HeObssPd", &val),
8142                Nl80211Attrs::WiphyEdmgChannels(val) => fmt.field("WiphyEdmgChannels", &val),
8143                Nl80211Attrs::WiphyEdmgBwConfig(val) => fmt.field("WiphyEdmgBwConfig", &val),
8144                Nl80211Attrs::VlanId(val) => fmt.field("VlanId", &val),
8145                Nl80211Attrs::HeBssColor(val) => fmt.field("HeBssColor", &val),
8146                Nl80211Attrs::IftypeAkmSuites(val) => fmt.field("IftypeAkmSuites", &val),
8147                Nl80211Attrs::TidConfig(val) => fmt.field("TidConfig", &val),
8148                Nl80211Attrs::ControlPortNoPreauth(val) => fmt.field("ControlPortNoPreauth", &val),
8149                Nl80211Attrs::PmkLifetime(val) => fmt.field("PmkLifetime", &val),
8150                Nl80211Attrs::PmkReauthThreshold(val) => fmt.field("PmkReauthThreshold", &val),
8151                Nl80211Attrs::ReceiveMulticast(val) => fmt.field("ReceiveMulticast", &val),
8152                Nl80211Attrs::WiphyFreqOffset(val) => fmt.field("WiphyFreqOffset", &val),
8153                Nl80211Attrs::CenterFreq1Offset(val) => fmt.field("CenterFreq1Offset", &val),
8154                Nl80211Attrs::ScanFreqKhz(val) => fmt.field("ScanFreqKhz", &val),
8155                Nl80211Attrs::He6ghzCapability(val) => fmt.field("He6ghzCapability", &val),
8156                Nl80211Attrs::FilsDiscovery(val) => fmt.field("FilsDiscovery", &val),
8157                Nl80211Attrs::UnsolBcastProbeResp(val) => fmt.field("UnsolBcastProbeResp", &val),
8158                Nl80211Attrs::S1gCapability(val) => fmt.field("S1gCapability", &val),
8159                Nl80211Attrs::S1gCapabilityMask(val) => fmt.field("S1gCapabilityMask", &val),
8160                Nl80211Attrs::SaePwe(val) => fmt.field("SaePwe", &val),
8161                Nl80211Attrs::ReconnectRequested(val) => fmt.field("ReconnectRequested", &val),
8162                Nl80211Attrs::SarSpec(val) => fmt.field("SarSpec", &val),
8163                Nl80211Attrs::DisableHe(val) => fmt.field("DisableHe", &val),
8164                Nl80211Attrs::ObssColorBitmap(val) => fmt.field("ObssColorBitmap", &val),
8165                Nl80211Attrs::ColorChangeCount(val) => fmt.field("ColorChangeCount", &val),
8166                Nl80211Attrs::ColorChangeColor(val) => fmt.field("ColorChangeColor", &val),
8167                Nl80211Attrs::ColorChangeElems(val) => fmt.field("ColorChangeElems", &val),
8168                Nl80211Attrs::MbssidConfig(val) => fmt.field("MbssidConfig", &val),
8169                Nl80211Attrs::MbssidElems(val) => fmt.field("MbssidElems", &val),
8170                Nl80211Attrs::RadarBackground(val) => fmt.field("RadarBackground", &val),
8171                Nl80211Attrs::ApSettingsFlags(val) => fmt.field("ApSettingsFlags", &val),
8172                Nl80211Attrs::EhtCapability(val) => fmt.field("EhtCapability", &val),
8173                Nl80211Attrs::DisableEht(val) => fmt.field("DisableEht", &val),
8174                Nl80211Attrs::MloLinks(val) => fmt.field("MloLinks", &val),
8175                Nl80211Attrs::MloLinkId(val) => fmt.field("MloLinkId", &val),
8176                Nl80211Attrs::MldAddr(val) => fmt.field("MldAddr", &FormatMac(val)),
8177                Nl80211Attrs::MloSupport(val) => fmt.field("MloSupport", &val),
8178                Nl80211Attrs::MaxNumAkmSuites(val) => fmt.field("MaxNumAkmSuites", &val),
8179                Nl80211Attrs::EmlCapability(val) => fmt.field("EmlCapability", &val),
8180                Nl80211Attrs::MldCapaAndOps(val) => fmt.field("MldCapaAndOps", &val),
8181                Nl80211Attrs::TxHwTimestamp(val) => fmt.field("TxHwTimestamp", &val),
8182                Nl80211Attrs::RxHwTimestamp(val) => fmt.field("RxHwTimestamp", &val),
8183                Nl80211Attrs::TdBitmap(val) => fmt.field("TdBitmap", &val),
8184                Nl80211Attrs::PunctBitmap(val) => fmt.field("PunctBitmap", &val),
8185                Nl80211Attrs::MaxHwTimestampPeers(val) => fmt.field("MaxHwTimestampPeers", &val),
8186                Nl80211Attrs::HwTimestampEnabled(val) => fmt.field("HwTimestampEnabled", &val),
8187                Nl80211Attrs::EmaRnrElems(val) => fmt.field("EmaRnrElems", &val),
8188                Nl80211Attrs::MloLinkDisabled(val) => fmt.field("MloLinkDisabled", &val),
8189                Nl80211Attrs::BssDumpIncludeUseData(val) => {
8190                    fmt.field("BssDumpIncludeUseData", &val)
8191                }
8192                Nl80211Attrs::MloTtlmDlink(val) => fmt.field("MloTtlmDlink", &val),
8193                Nl80211Attrs::MloTtlmUlink(val) => fmt.field("MloTtlmUlink", &val),
8194                Nl80211Attrs::AssocSppAmsdu(val) => fmt.field("AssocSppAmsdu", &val),
8195                Nl80211Attrs::WiphyRadios(val) => fmt.field("WiphyRadios", &val),
8196                Nl80211Attrs::WiphyInterfaceCombinations(val) => {
8197                    fmt.field("WiphyInterfaceCombinations", &val)
8198                }
8199                Nl80211Attrs::VifRadioMask(val) => fmt.field("VifRadioMask", &val),
8200            };
8201        }
8202        fmt.finish()
8203    }
8204}
8205impl IterableNl80211Attrs<'_> {
8206    pub fn lookup_attr(
8207        &self,
8208        offset: usize,
8209        missing_type: Option<u16>,
8210    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
8211        let mut stack = Vec::new();
8212        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
8213        if missing_type.is_some() && cur == offset {
8214            stack.push(("Nl80211Attrs", offset));
8215            return (
8216                stack,
8217                missing_type.and_then(|t| Nl80211Attrs::attr_from_type(t)),
8218            );
8219        }
8220        if cur > offset || cur + self.buf.len() < offset {
8221            return (stack, None);
8222        }
8223        let mut attrs = self.clone();
8224        let mut last_off = cur + attrs.pos;
8225        let mut missing = None;
8226        while let Some(attr) = attrs.next() {
8227            let Ok(attr) = attr else { break };
8228            match attr {
8229                Nl80211Attrs::Wiphy(val) => {
8230                    if last_off == offset {
8231                        stack.push(("Wiphy", last_off));
8232                        break;
8233                    }
8234                }
8235                Nl80211Attrs::WiphyName(val) => {
8236                    if last_off == offset {
8237                        stack.push(("WiphyName", last_off));
8238                        break;
8239                    }
8240                }
8241                Nl80211Attrs::Ifindex(val) => {
8242                    if last_off == offset {
8243                        stack.push(("Ifindex", last_off));
8244                        break;
8245                    }
8246                }
8247                Nl80211Attrs::Ifname(val) => {
8248                    if last_off == offset {
8249                        stack.push(("Ifname", last_off));
8250                        break;
8251                    }
8252                }
8253                Nl80211Attrs::Iftype(val) => {
8254                    if last_off == offset {
8255                        stack.push(("Iftype", last_off));
8256                        break;
8257                    }
8258                }
8259                Nl80211Attrs::Mac(val) => {
8260                    if last_off == offset {
8261                        stack.push(("Mac", last_off));
8262                        break;
8263                    }
8264                }
8265                Nl80211Attrs::KeyData(val) => {
8266                    if last_off == offset {
8267                        stack.push(("KeyData", last_off));
8268                        break;
8269                    }
8270                }
8271                Nl80211Attrs::KeyIdx(val) => {
8272                    if last_off == offset {
8273                        stack.push(("KeyIdx", last_off));
8274                        break;
8275                    }
8276                }
8277                Nl80211Attrs::KeyCipher(val) => {
8278                    if last_off == offset {
8279                        stack.push(("KeyCipher", last_off));
8280                        break;
8281                    }
8282                }
8283                Nl80211Attrs::KeySeq(val) => {
8284                    if last_off == offset {
8285                        stack.push(("KeySeq", last_off));
8286                        break;
8287                    }
8288                }
8289                Nl80211Attrs::KeyDefault(val) => {
8290                    if last_off == offset {
8291                        stack.push(("KeyDefault", last_off));
8292                        break;
8293                    }
8294                }
8295                Nl80211Attrs::BeaconInterval(val) => {
8296                    if last_off == offset {
8297                        stack.push(("BeaconInterval", last_off));
8298                        break;
8299                    }
8300                }
8301                Nl80211Attrs::DtimPeriod(val) => {
8302                    if last_off == offset {
8303                        stack.push(("DtimPeriod", last_off));
8304                        break;
8305                    }
8306                }
8307                Nl80211Attrs::BeaconHead(val) => {
8308                    if last_off == offset {
8309                        stack.push(("BeaconHead", last_off));
8310                        break;
8311                    }
8312                }
8313                Nl80211Attrs::BeaconTail(val) => {
8314                    if last_off == offset {
8315                        stack.push(("BeaconTail", last_off));
8316                        break;
8317                    }
8318                }
8319                Nl80211Attrs::StaAid(val) => {
8320                    if last_off == offset {
8321                        stack.push(("StaAid", last_off));
8322                        break;
8323                    }
8324                }
8325                Nl80211Attrs::StaFlags(val) => {
8326                    if last_off == offset {
8327                        stack.push(("StaFlags", last_off));
8328                        break;
8329                    }
8330                }
8331                Nl80211Attrs::StaListenInterval(val) => {
8332                    if last_off == offset {
8333                        stack.push(("StaListenInterval", last_off));
8334                        break;
8335                    }
8336                }
8337                Nl80211Attrs::StaSupportedRates(val) => {
8338                    if last_off == offset {
8339                        stack.push(("StaSupportedRates", last_off));
8340                        break;
8341                    }
8342                }
8343                Nl80211Attrs::StaVlan(val) => {
8344                    if last_off == offset {
8345                        stack.push(("StaVlan", last_off));
8346                        break;
8347                    }
8348                }
8349                Nl80211Attrs::StaInfo(val) => {
8350                    if last_off == offset {
8351                        stack.push(("StaInfo", last_off));
8352                        break;
8353                    }
8354                }
8355                Nl80211Attrs::WiphyBands(val) => {
8356                    (stack, missing) = val.lookup_attr(offset, missing_type);
8357                    if !stack.is_empty() {
8358                        break;
8359                    }
8360                }
8361                Nl80211Attrs::MntrFlags(val) => {
8362                    if last_off == offset {
8363                        stack.push(("MntrFlags", last_off));
8364                        break;
8365                    }
8366                }
8367                Nl80211Attrs::MeshId(val) => {
8368                    if last_off == offset {
8369                        stack.push(("MeshId", last_off));
8370                        break;
8371                    }
8372                }
8373                Nl80211Attrs::StaPlinkAction(val) => {
8374                    if last_off == offset {
8375                        stack.push(("StaPlinkAction", last_off));
8376                        break;
8377                    }
8378                }
8379                Nl80211Attrs::MpathNextHop(val) => {
8380                    if last_off == offset {
8381                        stack.push(("MpathNextHop", last_off));
8382                        break;
8383                    }
8384                }
8385                Nl80211Attrs::MpathInfo(val) => {
8386                    if last_off == offset {
8387                        stack.push(("MpathInfo", last_off));
8388                        break;
8389                    }
8390                }
8391                Nl80211Attrs::BssCtsProt(val) => {
8392                    if last_off == offset {
8393                        stack.push(("BssCtsProt", last_off));
8394                        break;
8395                    }
8396                }
8397                Nl80211Attrs::BssShortPreamble(val) => {
8398                    if last_off == offset {
8399                        stack.push(("BssShortPreamble", last_off));
8400                        break;
8401                    }
8402                }
8403                Nl80211Attrs::BssShortSlotTime(val) => {
8404                    if last_off == offset {
8405                        stack.push(("BssShortSlotTime", last_off));
8406                        break;
8407                    }
8408                }
8409                Nl80211Attrs::HtCapability(val) => {
8410                    if last_off == offset {
8411                        stack.push(("HtCapability", last_off));
8412                        break;
8413                    }
8414                }
8415                Nl80211Attrs::SupportedIftypes(val) => {
8416                    (stack, missing) = val.lookup_attr(offset, missing_type);
8417                    if !stack.is_empty() {
8418                        break;
8419                    }
8420                }
8421                Nl80211Attrs::RegAlpha2(val) => {
8422                    if last_off == offset {
8423                        stack.push(("RegAlpha2", last_off));
8424                        break;
8425                    }
8426                }
8427                Nl80211Attrs::RegRules(val) => {
8428                    if last_off == offset {
8429                        stack.push(("RegRules", last_off));
8430                        break;
8431                    }
8432                }
8433                Nl80211Attrs::MeshConfig(val) => {
8434                    if last_off == offset {
8435                        stack.push(("MeshConfig", last_off));
8436                        break;
8437                    }
8438                }
8439                Nl80211Attrs::BssBasicRates(val) => {
8440                    if last_off == offset {
8441                        stack.push(("BssBasicRates", last_off));
8442                        break;
8443                    }
8444                }
8445                Nl80211Attrs::WiphyTxqParams(val) => {
8446                    if last_off == offset {
8447                        stack.push(("WiphyTxqParams", last_off));
8448                        break;
8449                    }
8450                }
8451                Nl80211Attrs::WiphyFreq(val) => {
8452                    if last_off == offset {
8453                        stack.push(("WiphyFreq", last_off));
8454                        break;
8455                    }
8456                }
8457                Nl80211Attrs::WiphyChannelType(val) => {
8458                    if last_off == offset {
8459                        stack.push(("WiphyChannelType", last_off));
8460                        break;
8461                    }
8462                }
8463                Nl80211Attrs::KeyDefaultMgmt(val) => {
8464                    if last_off == offset {
8465                        stack.push(("KeyDefaultMgmt", last_off));
8466                        break;
8467                    }
8468                }
8469                Nl80211Attrs::MgmtSubtype(val) => {
8470                    if last_off == offset {
8471                        stack.push(("MgmtSubtype", last_off));
8472                        break;
8473                    }
8474                }
8475                Nl80211Attrs::Ie(val) => {
8476                    if last_off == offset {
8477                        stack.push(("Ie", last_off));
8478                        break;
8479                    }
8480                }
8481                Nl80211Attrs::MaxNumScanSsids(val) => {
8482                    if last_off == offset {
8483                        stack.push(("MaxNumScanSsids", last_off));
8484                        break;
8485                    }
8486                }
8487                Nl80211Attrs::ScanFrequencies(val) => {
8488                    if last_off == offset {
8489                        stack.push(("ScanFrequencies", last_off));
8490                        break;
8491                    }
8492                }
8493                Nl80211Attrs::ScanSsids(val) => {
8494                    if last_off == offset {
8495                        stack.push(("ScanSsids", last_off));
8496                        break;
8497                    }
8498                }
8499                Nl80211Attrs::Generation(val) => {
8500                    if last_off == offset {
8501                        stack.push(("Generation", last_off));
8502                        break;
8503                    }
8504                }
8505                Nl80211Attrs::Bss(val) => {
8506                    if last_off == offset {
8507                        stack.push(("Bss", last_off));
8508                        break;
8509                    }
8510                }
8511                Nl80211Attrs::RegInitiator(val) => {
8512                    if last_off == offset {
8513                        stack.push(("RegInitiator", last_off));
8514                        break;
8515                    }
8516                }
8517                Nl80211Attrs::RegType(val) => {
8518                    if last_off == offset {
8519                        stack.push(("RegType", last_off));
8520                        break;
8521                    }
8522                }
8523                Nl80211Attrs::SupportedCommands(val) => {
8524                    if last_off == offset {
8525                        stack.push(("SupportedCommands", last_off));
8526                        break;
8527                    }
8528                }
8529                Nl80211Attrs::Frame(val) => {
8530                    if last_off == offset {
8531                        stack.push(("Frame", last_off));
8532                        break;
8533                    }
8534                }
8535                Nl80211Attrs::Ssid(val) => {
8536                    if last_off == offset {
8537                        stack.push(("Ssid", last_off));
8538                        break;
8539                    }
8540                }
8541                Nl80211Attrs::AuthType(val) => {
8542                    if last_off == offset {
8543                        stack.push(("AuthType", last_off));
8544                        break;
8545                    }
8546                }
8547                Nl80211Attrs::ReasonCode(val) => {
8548                    if last_off == offset {
8549                        stack.push(("ReasonCode", last_off));
8550                        break;
8551                    }
8552                }
8553                Nl80211Attrs::KeyType(val) => {
8554                    if last_off == offset {
8555                        stack.push(("KeyType", last_off));
8556                        break;
8557                    }
8558                }
8559                Nl80211Attrs::MaxScanIeLen(val) => {
8560                    if last_off == offset {
8561                        stack.push(("MaxScanIeLen", last_off));
8562                        break;
8563                    }
8564                }
8565                Nl80211Attrs::CipherSuites(val) => {
8566                    if last_off == offset {
8567                        stack.push(("CipherSuites", last_off));
8568                        break;
8569                    }
8570                }
8571                Nl80211Attrs::FreqBefore(val) => {
8572                    if last_off == offset {
8573                        stack.push(("FreqBefore", last_off));
8574                        break;
8575                    }
8576                }
8577                Nl80211Attrs::FreqAfter(val) => {
8578                    if last_off == offset {
8579                        stack.push(("FreqAfter", last_off));
8580                        break;
8581                    }
8582                }
8583                Nl80211Attrs::FreqFixed(val) => {
8584                    if last_off == offset {
8585                        stack.push(("FreqFixed", last_off));
8586                        break;
8587                    }
8588                }
8589                Nl80211Attrs::WiphyRetryShort(val) => {
8590                    if last_off == offset {
8591                        stack.push(("WiphyRetryShort", last_off));
8592                        break;
8593                    }
8594                }
8595                Nl80211Attrs::WiphyRetryLong(val) => {
8596                    if last_off == offset {
8597                        stack.push(("WiphyRetryLong", last_off));
8598                        break;
8599                    }
8600                }
8601                Nl80211Attrs::WiphyFragThreshold(val) => {
8602                    if last_off == offset {
8603                        stack.push(("WiphyFragThreshold", last_off));
8604                        break;
8605                    }
8606                }
8607                Nl80211Attrs::WiphyRtsThreshold(val) => {
8608                    if last_off == offset {
8609                        stack.push(("WiphyRtsThreshold", last_off));
8610                        break;
8611                    }
8612                }
8613                Nl80211Attrs::TimedOut(val) => {
8614                    if last_off == offset {
8615                        stack.push(("TimedOut", last_off));
8616                        break;
8617                    }
8618                }
8619                Nl80211Attrs::UseMfp(val) => {
8620                    if last_off == offset {
8621                        stack.push(("UseMfp", last_off));
8622                        break;
8623                    }
8624                }
8625                Nl80211Attrs::StaFlags2(val) => {
8626                    if last_off == offset {
8627                        stack.push(("StaFlags2", last_off));
8628                        break;
8629                    }
8630                }
8631                Nl80211Attrs::ControlPort(val) => {
8632                    if last_off == offset {
8633                        stack.push(("ControlPort", last_off));
8634                        break;
8635                    }
8636                }
8637                Nl80211Attrs::Testdata(val) => {
8638                    if last_off == offset {
8639                        stack.push(("Testdata", last_off));
8640                        break;
8641                    }
8642                }
8643                Nl80211Attrs::Privacy(val) => {
8644                    if last_off == offset {
8645                        stack.push(("Privacy", last_off));
8646                        break;
8647                    }
8648                }
8649                Nl80211Attrs::DisconnectedByAp(val) => {
8650                    if last_off == offset {
8651                        stack.push(("DisconnectedByAp", last_off));
8652                        break;
8653                    }
8654                }
8655                Nl80211Attrs::StatusCode(val) => {
8656                    if last_off == offset {
8657                        stack.push(("StatusCode", last_off));
8658                        break;
8659                    }
8660                }
8661                Nl80211Attrs::CipherSuitesPairwise(val) => {
8662                    if last_off == offset {
8663                        stack.push(("CipherSuitesPairwise", last_off));
8664                        break;
8665                    }
8666                }
8667                Nl80211Attrs::CipherSuiteGroup(val) => {
8668                    if last_off == offset {
8669                        stack.push(("CipherSuiteGroup", last_off));
8670                        break;
8671                    }
8672                }
8673                Nl80211Attrs::WpaVersions(val) => {
8674                    if last_off == offset {
8675                        stack.push(("WpaVersions", last_off));
8676                        break;
8677                    }
8678                }
8679                Nl80211Attrs::AkmSuites(val) => {
8680                    if last_off == offset {
8681                        stack.push(("AkmSuites", last_off));
8682                        break;
8683                    }
8684                }
8685                Nl80211Attrs::ReqIe(val) => {
8686                    if last_off == offset {
8687                        stack.push(("ReqIe", last_off));
8688                        break;
8689                    }
8690                }
8691                Nl80211Attrs::RespIe(val) => {
8692                    if last_off == offset {
8693                        stack.push(("RespIe", last_off));
8694                        break;
8695                    }
8696                }
8697                Nl80211Attrs::PrevBssid(val) => {
8698                    if last_off == offset {
8699                        stack.push(("PrevBssid", last_off));
8700                        break;
8701                    }
8702                }
8703                Nl80211Attrs::Key(val) => {
8704                    if last_off == offset {
8705                        stack.push(("Key", last_off));
8706                        break;
8707                    }
8708                }
8709                Nl80211Attrs::Keys(val) => {
8710                    if last_off == offset {
8711                        stack.push(("Keys", last_off));
8712                        break;
8713                    }
8714                }
8715                Nl80211Attrs::Pid(val) => {
8716                    if last_off == offset {
8717                        stack.push(("Pid", last_off));
8718                        break;
8719                    }
8720                }
8721                Nl80211Attrs::_4addr(val) => {
8722                    if last_off == offset {
8723                        stack.push(("4addr", last_off));
8724                        break;
8725                    }
8726                }
8727                Nl80211Attrs::SurveyInfo(val) => {
8728                    if last_off == offset {
8729                        stack.push(("SurveyInfo", last_off));
8730                        break;
8731                    }
8732                }
8733                Nl80211Attrs::Pmkid(val) => {
8734                    if last_off == offset {
8735                        stack.push(("Pmkid", last_off));
8736                        break;
8737                    }
8738                }
8739                Nl80211Attrs::MaxNumPmkids(val) => {
8740                    if last_off == offset {
8741                        stack.push(("MaxNumPmkids", last_off));
8742                        break;
8743                    }
8744                }
8745                Nl80211Attrs::Duration(val) => {
8746                    if last_off == offset {
8747                        stack.push(("Duration", last_off));
8748                        break;
8749                    }
8750                }
8751                Nl80211Attrs::Cookie(val) => {
8752                    if last_off == offset {
8753                        stack.push(("Cookie", last_off));
8754                        break;
8755                    }
8756                }
8757                Nl80211Attrs::WiphyCoverageClass(val) => {
8758                    if last_off == offset {
8759                        stack.push(("WiphyCoverageClass", last_off));
8760                        break;
8761                    }
8762                }
8763                Nl80211Attrs::TxRates(val) => {
8764                    if last_off == offset {
8765                        stack.push(("TxRates", last_off));
8766                        break;
8767                    }
8768                }
8769                Nl80211Attrs::FrameMatch(val) => {
8770                    if last_off == offset {
8771                        stack.push(("FrameMatch", last_off));
8772                        break;
8773                    }
8774                }
8775                Nl80211Attrs::Ack(val) => {
8776                    if last_off == offset {
8777                        stack.push(("Ack", last_off));
8778                        break;
8779                    }
8780                }
8781                Nl80211Attrs::PsState(val) => {
8782                    if last_off == offset {
8783                        stack.push(("PsState", last_off));
8784                        break;
8785                    }
8786                }
8787                Nl80211Attrs::Cqm(val) => {
8788                    if last_off == offset {
8789                        stack.push(("Cqm", last_off));
8790                        break;
8791                    }
8792                }
8793                Nl80211Attrs::LocalStateChange(val) => {
8794                    if last_off == offset {
8795                        stack.push(("LocalStateChange", last_off));
8796                        break;
8797                    }
8798                }
8799                Nl80211Attrs::ApIsolate(val) => {
8800                    if last_off == offset {
8801                        stack.push(("ApIsolate", last_off));
8802                        break;
8803                    }
8804                }
8805                Nl80211Attrs::WiphyTxPowerSetting(val) => {
8806                    if last_off == offset {
8807                        stack.push(("WiphyTxPowerSetting", last_off));
8808                        break;
8809                    }
8810                }
8811                Nl80211Attrs::WiphyTxPowerLevel(val) => {
8812                    if last_off == offset {
8813                        stack.push(("WiphyTxPowerLevel", last_off));
8814                        break;
8815                    }
8816                }
8817                Nl80211Attrs::TxFrameTypes(val) => {
8818                    (stack, missing) = val.lookup_attr(offset, missing_type);
8819                    if !stack.is_empty() {
8820                        break;
8821                    }
8822                }
8823                Nl80211Attrs::RxFrameTypes(val) => {
8824                    (stack, missing) = val.lookup_attr(offset, missing_type);
8825                    if !stack.is_empty() {
8826                        break;
8827                    }
8828                }
8829                Nl80211Attrs::FrameType(val) => {
8830                    if last_off == offset {
8831                        stack.push(("FrameType", last_off));
8832                        break;
8833                    }
8834                }
8835                Nl80211Attrs::ControlPortEthertype(val) => {
8836                    if last_off == offset {
8837                        stack.push(("ControlPortEthertype", last_off));
8838                        break;
8839                    }
8840                }
8841                Nl80211Attrs::ControlPortNoEncrypt(val) => {
8842                    if last_off == offset {
8843                        stack.push(("ControlPortNoEncrypt", last_off));
8844                        break;
8845                    }
8846                }
8847                Nl80211Attrs::SupportIbssRsn(val) => {
8848                    if last_off == offset {
8849                        stack.push(("SupportIbssRsn", last_off));
8850                        break;
8851                    }
8852                }
8853                Nl80211Attrs::WiphyAntennaTx(val) => {
8854                    if last_off == offset {
8855                        stack.push(("WiphyAntennaTx", last_off));
8856                        break;
8857                    }
8858                }
8859                Nl80211Attrs::WiphyAntennaRx(val) => {
8860                    if last_off == offset {
8861                        stack.push(("WiphyAntennaRx", last_off));
8862                        break;
8863                    }
8864                }
8865                Nl80211Attrs::McastRate(val) => {
8866                    if last_off == offset {
8867                        stack.push(("McastRate", last_off));
8868                        break;
8869                    }
8870                }
8871                Nl80211Attrs::OffchannelTxOk(val) => {
8872                    if last_off == offset {
8873                        stack.push(("OffchannelTxOk", last_off));
8874                        break;
8875                    }
8876                }
8877                Nl80211Attrs::BssHtOpmode(val) => {
8878                    if last_off == offset {
8879                        stack.push(("BssHtOpmode", last_off));
8880                        break;
8881                    }
8882                }
8883                Nl80211Attrs::KeyDefaultTypes(val) => {
8884                    if last_off == offset {
8885                        stack.push(("KeyDefaultTypes", last_off));
8886                        break;
8887                    }
8888                }
8889                Nl80211Attrs::MaxRemainOnChannelDuration(val) => {
8890                    if last_off == offset {
8891                        stack.push(("MaxRemainOnChannelDuration", last_off));
8892                        break;
8893                    }
8894                }
8895                Nl80211Attrs::MeshSetup(val) => {
8896                    if last_off == offset {
8897                        stack.push(("MeshSetup", last_off));
8898                        break;
8899                    }
8900                }
8901                Nl80211Attrs::WiphyAntennaAvailTx(val) => {
8902                    if last_off == offset {
8903                        stack.push(("WiphyAntennaAvailTx", last_off));
8904                        break;
8905                    }
8906                }
8907                Nl80211Attrs::WiphyAntennaAvailRx(val) => {
8908                    if last_off == offset {
8909                        stack.push(("WiphyAntennaAvailRx", last_off));
8910                        break;
8911                    }
8912                }
8913                Nl80211Attrs::SupportMeshAuth(val) => {
8914                    if last_off == offset {
8915                        stack.push(("SupportMeshAuth", last_off));
8916                        break;
8917                    }
8918                }
8919                Nl80211Attrs::StaPlinkState(val) => {
8920                    if last_off == offset {
8921                        stack.push(("StaPlinkState", last_off));
8922                        break;
8923                    }
8924                }
8925                Nl80211Attrs::WowlanTriggers(val) => {
8926                    if last_off == offset {
8927                        stack.push(("WowlanTriggers", last_off));
8928                        break;
8929                    }
8930                }
8931                Nl80211Attrs::WowlanTriggersSupported(val) => {
8932                    (stack, missing) = val.lookup_attr(offset, missing_type);
8933                    if !stack.is_empty() {
8934                        break;
8935                    }
8936                }
8937                Nl80211Attrs::SchedScanInterval(val) => {
8938                    if last_off == offset {
8939                        stack.push(("SchedScanInterval", last_off));
8940                        break;
8941                    }
8942                }
8943                Nl80211Attrs::InterfaceCombinations(val) => {
8944                    for entry in val {
8945                        let Ok(attr) = entry else { break };
8946                        (stack, missing) = attr.lookup_attr(offset, missing_type);
8947                        if !stack.is_empty() {
8948                            break;
8949                        }
8950                    }
8951                    if !stack.is_empty() {
8952                        stack.push(("InterfaceCombinations", last_off));
8953                        break;
8954                    }
8955                }
8956                Nl80211Attrs::SoftwareIftypes(val) => {
8957                    (stack, missing) = val.lookup_attr(offset, missing_type);
8958                    if !stack.is_empty() {
8959                        break;
8960                    }
8961                }
8962                Nl80211Attrs::RekeyData(val) => {
8963                    if last_off == offset {
8964                        stack.push(("RekeyData", last_off));
8965                        break;
8966                    }
8967                }
8968                Nl80211Attrs::MaxNumSchedScanSsids(val) => {
8969                    if last_off == offset {
8970                        stack.push(("MaxNumSchedScanSsids", last_off));
8971                        break;
8972                    }
8973                }
8974                Nl80211Attrs::MaxSchedScanIeLen(val) => {
8975                    if last_off == offset {
8976                        stack.push(("MaxSchedScanIeLen", last_off));
8977                        break;
8978                    }
8979                }
8980                Nl80211Attrs::ScanSuppRates(val) => {
8981                    if last_off == offset {
8982                        stack.push(("ScanSuppRates", last_off));
8983                        break;
8984                    }
8985                }
8986                Nl80211Attrs::HiddenSsid(val) => {
8987                    if last_off == offset {
8988                        stack.push(("HiddenSsid", last_off));
8989                        break;
8990                    }
8991                }
8992                Nl80211Attrs::IeProbeResp(val) => {
8993                    if last_off == offset {
8994                        stack.push(("IeProbeResp", last_off));
8995                        break;
8996                    }
8997                }
8998                Nl80211Attrs::IeAssocResp(val) => {
8999                    if last_off == offset {
9000                        stack.push(("IeAssocResp", last_off));
9001                        break;
9002                    }
9003                }
9004                Nl80211Attrs::StaWme(val) => {
9005                    if last_off == offset {
9006                        stack.push(("StaWme", last_off));
9007                        break;
9008                    }
9009                }
9010                Nl80211Attrs::SupportApUapsd(val) => {
9011                    if last_off == offset {
9012                        stack.push(("SupportApUapsd", last_off));
9013                        break;
9014                    }
9015                }
9016                Nl80211Attrs::RoamSupport(val) => {
9017                    if last_off == offset {
9018                        stack.push(("RoamSupport", last_off));
9019                        break;
9020                    }
9021                }
9022                Nl80211Attrs::SchedScanMatch(val) => {
9023                    if last_off == offset {
9024                        stack.push(("SchedScanMatch", last_off));
9025                        break;
9026                    }
9027                }
9028                Nl80211Attrs::MaxMatchSets(val) => {
9029                    if last_off == offset {
9030                        stack.push(("MaxMatchSets", last_off));
9031                        break;
9032                    }
9033                }
9034                Nl80211Attrs::PmksaCandidate(val) => {
9035                    if last_off == offset {
9036                        stack.push(("PmksaCandidate", last_off));
9037                        break;
9038                    }
9039                }
9040                Nl80211Attrs::TxNoCckRate(val) => {
9041                    if last_off == offset {
9042                        stack.push(("TxNoCckRate", last_off));
9043                        break;
9044                    }
9045                }
9046                Nl80211Attrs::TdlsAction(val) => {
9047                    if last_off == offset {
9048                        stack.push(("TdlsAction", last_off));
9049                        break;
9050                    }
9051                }
9052                Nl80211Attrs::TdlsDialogToken(val) => {
9053                    if last_off == offset {
9054                        stack.push(("TdlsDialogToken", last_off));
9055                        break;
9056                    }
9057                }
9058                Nl80211Attrs::TdlsOperation(val) => {
9059                    if last_off == offset {
9060                        stack.push(("TdlsOperation", last_off));
9061                        break;
9062                    }
9063                }
9064                Nl80211Attrs::TdlsSupport(val) => {
9065                    if last_off == offset {
9066                        stack.push(("TdlsSupport", last_off));
9067                        break;
9068                    }
9069                }
9070                Nl80211Attrs::TdlsExternalSetup(val) => {
9071                    if last_off == offset {
9072                        stack.push(("TdlsExternalSetup", last_off));
9073                        break;
9074                    }
9075                }
9076                Nl80211Attrs::DeviceApSme(val) => {
9077                    if last_off == offset {
9078                        stack.push(("DeviceApSme", last_off));
9079                        break;
9080                    }
9081                }
9082                Nl80211Attrs::DontWaitForAck(val) => {
9083                    if last_off == offset {
9084                        stack.push(("DontWaitForAck", last_off));
9085                        break;
9086                    }
9087                }
9088                Nl80211Attrs::FeatureFlags(val) => {
9089                    if last_off == offset {
9090                        stack.push(("FeatureFlags", last_off));
9091                        break;
9092                    }
9093                }
9094                Nl80211Attrs::ProbeRespOffload(val) => {
9095                    if last_off == offset {
9096                        stack.push(("ProbeRespOffload", last_off));
9097                        break;
9098                    }
9099                }
9100                Nl80211Attrs::ProbeResp(val) => {
9101                    if last_off == offset {
9102                        stack.push(("ProbeResp", last_off));
9103                        break;
9104                    }
9105                }
9106                Nl80211Attrs::DfsRegion(val) => {
9107                    if last_off == offset {
9108                        stack.push(("DfsRegion", last_off));
9109                        break;
9110                    }
9111                }
9112                Nl80211Attrs::DisableHt(val) => {
9113                    if last_off == offset {
9114                        stack.push(("DisableHt", last_off));
9115                        break;
9116                    }
9117                }
9118                Nl80211Attrs::HtCapabilityMask(val) => {
9119                    if last_off == offset {
9120                        stack.push(("HtCapabilityMask", last_off));
9121                        break;
9122                    }
9123                }
9124                Nl80211Attrs::NoackMap(val) => {
9125                    if last_off == offset {
9126                        stack.push(("NoackMap", last_off));
9127                        break;
9128                    }
9129                }
9130                Nl80211Attrs::InactivityTimeout(val) => {
9131                    if last_off == offset {
9132                        stack.push(("InactivityTimeout", last_off));
9133                        break;
9134                    }
9135                }
9136                Nl80211Attrs::RxSignalDbm(val) => {
9137                    if last_off == offset {
9138                        stack.push(("RxSignalDbm", last_off));
9139                        break;
9140                    }
9141                }
9142                Nl80211Attrs::BgScanPeriod(val) => {
9143                    if last_off == offset {
9144                        stack.push(("BgScanPeriod", last_off));
9145                        break;
9146                    }
9147                }
9148                Nl80211Attrs::Wdev(val) => {
9149                    if last_off == offset {
9150                        stack.push(("Wdev", last_off));
9151                        break;
9152                    }
9153                }
9154                Nl80211Attrs::UserRegHintType(val) => {
9155                    if last_off == offset {
9156                        stack.push(("UserRegHintType", last_off));
9157                        break;
9158                    }
9159                }
9160                Nl80211Attrs::ConnFailedReason(val) => {
9161                    if last_off == offset {
9162                        stack.push(("ConnFailedReason", last_off));
9163                        break;
9164                    }
9165                }
9166                Nl80211Attrs::AuthData(val) => {
9167                    if last_off == offset {
9168                        stack.push(("AuthData", last_off));
9169                        break;
9170                    }
9171                }
9172                Nl80211Attrs::VhtCapability(val) => {
9173                    if last_off == offset {
9174                        stack.push(("VhtCapability", last_off));
9175                        break;
9176                    }
9177                }
9178                Nl80211Attrs::ScanFlags(val) => {
9179                    if last_off == offset {
9180                        stack.push(("ScanFlags", last_off));
9181                        break;
9182                    }
9183                }
9184                Nl80211Attrs::ChannelWidth(val) => {
9185                    if last_off == offset {
9186                        stack.push(("ChannelWidth", last_off));
9187                        break;
9188                    }
9189                }
9190                Nl80211Attrs::CenterFreq1(val) => {
9191                    if last_off == offset {
9192                        stack.push(("CenterFreq1", last_off));
9193                        break;
9194                    }
9195                }
9196                Nl80211Attrs::CenterFreq2(val) => {
9197                    if last_off == offset {
9198                        stack.push(("CenterFreq2", last_off));
9199                        break;
9200                    }
9201                }
9202                Nl80211Attrs::P2pCtwindow(val) => {
9203                    if last_off == offset {
9204                        stack.push(("P2pCtwindow", last_off));
9205                        break;
9206                    }
9207                }
9208                Nl80211Attrs::P2pOppps(val) => {
9209                    if last_off == offset {
9210                        stack.push(("P2pOppps", last_off));
9211                        break;
9212                    }
9213                }
9214                Nl80211Attrs::LocalMeshPowerMode(val) => {
9215                    if last_off == offset {
9216                        stack.push(("LocalMeshPowerMode", last_off));
9217                        break;
9218                    }
9219                }
9220                Nl80211Attrs::AclPolicy(val) => {
9221                    if last_off == offset {
9222                        stack.push(("AclPolicy", last_off));
9223                        break;
9224                    }
9225                }
9226                Nl80211Attrs::MacAddrs(val) => {
9227                    if last_off == offset {
9228                        stack.push(("MacAddrs", last_off));
9229                        break;
9230                    }
9231                }
9232                Nl80211Attrs::MacAclMax(val) => {
9233                    if last_off == offset {
9234                        stack.push(("MacAclMax", last_off));
9235                        break;
9236                    }
9237                }
9238                Nl80211Attrs::RadarEvent(val) => {
9239                    if last_off == offset {
9240                        stack.push(("RadarEvent", last_off));
9241                        break;
9242                    }
9243                }
9244                Nl80211Attrs::ExtCapa(val) => {
9245                    if last_off == offset {
9246                        stack.push(("ExtCapa", last_off));
9247                        break;
9248                    }
9249                }
9250                Nl80211Attrs::ExtCapaMask(val) => {
9251                    if last_off == offset {
9252                        stack.push(("ExtCapaMask", last_off));
9253                        break;
9254                    }
9255                }
9256                Nl80211Attrs::StaCapability(val) => {
9257                    if last_off == offset {
9258                        stack.push(("StaCapability", last_off));
9259                        break;
9260                    }
9261                }
9262                Nl80211Attrs::StaExtCapability(val) => {
9263                    if last_off == offset {
9264                        stack.push(("StaExtCapability", last_off));
9265                        break;
9266                    }
9267                }
9268                Nl80211Attrs::ProtocolFeatures(val) => {
9269                    if last_off == offset {
9270                        stack.push(("ProtocolFeatures", last_off));
9271                        break;
9272                    }
9273                }
9274                Nl80211Attrs::SplitWiphyDump(val) => {
9275                    if last_off == offset {
9276                        stack.push(("SplitWiphyDump", last_off));
9277                        break;
9278                    }
9279                }
9280                Nl80211Attrs::DisableVht(val) => {
9281                    if last_off == offset {
9282                        stack.push(("DisableVht", last_off));
9283                        break;
9284                    }
9285                }
9286                Nl80211Attrs::VhtCapabilityMask(val) => {
9287                    if last_off == offset {
9288                        stack.push(("VhtCapabilityMask", last_off));
9289                        break;
9290                    }
9291                }
9292                Nl80211Attrs::Mdid(val) => {
9293                    if last_off == offset {
9294                        stack.push(("Mdid", last_off));
9295                        break;
9296                    }
9297                }
9298                Nl80211Attrs::IeRic(val) => {
9299                    if last_off == offset {
9300                        stack.push(("IeRic", last_off));
9301                        break;
9302                    }
9303                }
9304                Nl80211Attrs::CritProtId(val) => {
9305                    if last_off == offset {
9306                        stack.push(("CritProtId", last_off));
9307                        break;
9308                    }
9309                }
9310                Nl80211Attrs::MaxCritProtDuration(val) => {
9311                    if last_off == offset {
9312                        stack.push(("MaxCritProtDuration", last_off));
9313                        break;
9314                    }
9315                }
9316                Nl80211Attrs::PeerAid(val) => {
9317                    if last_off == offset {
9318                        stack.push(("PeerAid", last_off));
9319                        break;
9320                    }
9321                }
9322                Nl80211Attrs::CoalesceRule(val) => {
9323                    if last_off == offset {
9324                        stack.push(("CoalesceRule", last_off));
9325                        break;
9326                    }
9327                }
9328                Nl80211Attrs::ChSwitchCount(val) => {
9329                    if last_off == offset {
9330                        stack.push(("ChSwitchCount", last_off));
9331                        break;
9332                    }
9333                }
9334                Nl80211Attrs::ChSwitchBlockTx(val) => {
9335                    if last_off == offset {
9336                        stack.push(("ChSwitchBlockTx", last_off));
9337                        break;
9338                    }
9339                }
9340                Nl80211Attrs::CsaIes(val) => {
9341                    if last_off == offset {
9342                        stack.push(("CsaIes", last_off));
9343                        break;
9344                    }
9345                }
9346                Nl80211Attrs::CntdwnOffsBeacon(val) => {
9347                    if last_off == offset {
9348                        stack.push(("CntdwnOffsBeacon", last_off));
9349                        break;
9350                    }
9351                }
9352                Nl80211Attrs::CntdwnOffsPresp(val) => {
9353                    if last_off == offset {
9354                        stack.push(("CntdwnOffsPresp", last_off));
9355                        break;
9356                    }
9357                }
9358                Nl80211Attrs::RxmgmtFlags(val) => {
9359                    if last_off == offset {
9360                        stack.push(("RxmgmtFlags", last_off));
9361                        break;
9362                    }
9363                }
9364                Nl80211Attrs::StaSupportedChannels(val) => {
9365                    if last_off == offset {
9366                        stack.push(("StaSupportedChannels", last_off));
9367                        break;
9368                    }
9369                }
9370                Nl80211Attrs::StaSupportedOperClasses(val) => {
9371                    if last_off == offset {
9372                        stack.push(("StaSupportedOperClasses", last_off));
9373                        break;
9374                    }
9375                }
9376                Nl80211Attrs::HandleDfs(val) => {
9377                    if last_off == offset {
9378                        stack.push(("HandleDfs", last_off));
9379                        break;
9380                    }
9381                }
9382                Nl80211Attrs::Support5Mhz(val) => {
9383                    if last_off == offset {
9384                        stack.push(("Support5Mhz", last_off));
9385                        break;
9386                    }
9387                }
9388                Nl80211Attrs::Support10Mhz(val) => {
9389                    if last_off == offset {
9390                        stack.push(("Support10Mhz", last_off));
9391                        break;
9392                    }
9393                }
9394                Nl80211Attrs::OpmodeNotif(val) => {
9395                    if last_off == offset {
9396                        stack.push(("OpmodeNotif", last_off));
9397                        break;
9398                    }
9399                }
9400                Nl80211Attrs::VendorId(val) => {
9401                    if last_off == offset {
9402                        stack.push(("VendorId", last_off));
9403                        break;
9404                    }
9405                }
9406                Nl80211Attrs::VendorSubcmd(val) => {
9407                    if last_off == offset {
9408                        stack.push(("VendorSubcmd", last_off));
9409                        break;
9410                    }
9411                }
9412                Nl80211Attrs::VendorData(val) => {
9413                    if last_off == offset {
9414                        stack.push(("VendorData", last_off));
9415                        break;
9416                    }
9417                }
9418                Nl80211Attrs::VendorEvents(val) => {
9419                    if last_off == offset {
9420                        stack.push(("VendorEvents", last_off));
9421                        break;
9422                    }
9423                }
9424                Nl80211Attrs::QosMap(val) => {
9425                    if last_off == offset {
9426                        stack.push(("QosMap", last_off));
9427                        break;
9428                    }
9429                }
9430                Nl80211Attrs::MacHint(val) => {
9431                    if last_off == offset {
9432                        stack.push(("MacHint", last_off));
9433                        break;
9434                    }
9435                }
9436                Nl80211Attrs::WiphyFreqHint(val) => {
9437                    if last_off == offset {
9438                        stack.push(("WiphyFreqHint", last_off));
9439                        break;
9440                    }
9441                }
9442                Nl80211Attrs::MaxApAssocSta(val) => {
9443                    if last_off == offset {
9444                        stack.push(("MaxApAssocSta", last_off));
9445                        break;
9446                    }
9447                }
9448                Nl80211Attrs::TdlsPeerCapability(val) => {
9449                    if last_off == offset {
9450                        stack.push(("TdlsPeerCapability", last_off));
9451                        break;
9452                    }
9453                }
9454                Nl80211Attrs::SocketOwner(val) => {
9455                    if last_off == offset {
9456                        stack.push(("SocketOwner", last_off));
9457                        break;
9458                    }
9459                }
9460                Nl80211Attrs::CsaCOffsetsTx(val) => {
9461                    if last_off == offset {
9462                        stack.push(("CsaCOffsetsTx", last_off));
9463                        break;
9464                    }
9465                }
9466                Nl80211Attrs::MaxCsaCounters(val) => {
9467                    if last_off == offset {
9468                        stack.push(("MaxCsaCounters", last_off));
9469                        break;
9470                    }
9471                }
9472                Nl80211Attrs::TdlsInitiator(val) => {
9473                    if last_off == offset {
9474                        stack.push(("TdlsInitiator", last_off));
9475                        break;
9476                    }
9477                }
9478                Nl80211Attrs::UseRrm(val) => {
9479                    if last_off == offset {
9480                        stack.push(("UseRrm", last_off));
9481                        break;
9482                    }
9483                }
9484                Nl80211Attrs::WiphyDynAck(val) => {
9485                    if last_off == offset {
9486                        stack.push(("WiphyDynAck", last_off));
9487                        break;
9488                    }
9489                }
9490                Nl80211Attrs::Tsid(val) => {
9491                    if last_off == offset {
9492                        stack.push(("Tsid", last_off));
9493                        break;
9494                    }
9495                }
9496                Nl80211Attrs::UserPrio(val) => {
9497                    if last_off == offset {
9498                        stack.push(("UserPrio", last_off));
9499                        break;
9500                    }
9501                }
9502                Nl80211Attrs::AdmittedTime(val) => {
9503                    if last_off == offset {
9504                        stack.push(("AdmittedTime", last_off));
9505                        break;
9506                    }
9507                }
9508                Nl80211Attrs::SmpsMode(val) => {
9509                    if last_off == offset {
9510                        stack.push(("SmpsMode", last_off));
9511                        break;
9512                    }
9513                }
9514                Nl80211Attrs::OperClass(val) => {
9515                    if last_off == offset {
9516                        stack.push(("OperClass", last_off));
9517                        break;
9518                    }
9519                }
9520                Nl80211Attrs::MacMask(val) => {
9521                    if last_off == offset {
9522                        stack.push(("MacMask", last_off));
9523                        break;
9524                    }
9525                }
9526                Nl80211Attrs::WiphySelfManagedReg(val) => {
9527                    if last_off == offset {
9528                        stack.push(("WiphySelfManagedReg", last_off));
9529                        break;
9530                    }
9531                }
9532                Nl80211Attrs::ExtFeatures(val) => {
9533                    if last_off == offset {
9534                        stack.push(("ExtFeatures", last_off));
9535                        break;
9536                    }
9537                }
9538                Nl80211Attrs::SurveyRadioStats(val) => {
9539                    if last_off == offset {
9540                        stack.push(("SurveyRadioStats", last_off));
9541                        break;
9542                    }
9543                }
9544                Nl80211Attrs::NetnsFd(val) => {
9545                    if last_off == offset {
9546                        stack.push(("NetnsFd", last_off));
9547                        break;
9548                    }
9549                }
9550                Nl80211Attrs::SchedScanDelay(val) => {
9551                    if last_off == offset {
9552                        stack.push(("SchedScanDelay", last_off));
9553                        break;
9554                    }
9555                }
9556                Nl80211Attrs::RegIndoor(val) => {
9557                    if last_off == offset {
9558                        stack.push(("RegIndoor", last_off));
9559                        break;
9560                    }
9561                }
9562                Nl80211Attrs::MaxNumSchedScanPlans(val) => {
9563                    if last_off == offset {
9564                        stack.push(("MaxNumSchedScanPlans", last_off));
9565                        break;
9566                    }
9567                }
9568                Nl80211Attrs::MaxScanPlanInterval(val) => {
9569                    if last_off == offset {
9570                        stack.push(("MaxScanPlanInterval", last_off));
9571                        break;
9572                    }
9573                }
9574                Nl80211Attrs::MaxScanPlanIterations(val) => {
9575                    if last_off == offset {
9576                        stack.push(("MaxScanPlanIterations", last_off));
9577                        break;
9578                    }
9579                }
9580                Nl80211Attrs::SchedScanPlans(val) => {
9581                    if last_off == offset {
9582                        stack.push(("SchedScanPlans", last_off));
9583                        break;
9584                    }
9585                }
9586                Nl80211Attrs::Pbss(val) => {
9587                    if last_off == offset {
9588                        stack.push(("Pbss", last_off));
9589                        break;
9590                    }
9591                }
9592                Nl80211Attrs::BssSelect(val) => {
9593                    if last_off == offset {
9594                        stack.push(("BssSelect", last_off));
9595                        break;
9596                    }
9597                }
9598                Nl80211Attrs::StaSupportP2pPs(val) => {
9599                    if last_off == offset {
9600                        stack.push(("StaSupportP2pPs", last_off));
9601                        break;
9602                    }
9603                }
9604                Nl80211Attrs::Pad(val) => {
9605                    if last_off == offset {
9606                        stack.push(("Pad", last_off));
9607                        break;
9608                    }
9609                }
9610                Nl80211Attrs::IftypeExtCapa(val) => {
9611                    if last_off == offset {
9612                        stack.push(("IftypeExtCapa", last_off));
9613                        break;
9614                    }
9615                }
9616                Nl80211Attrs::MuMimoGroupData(val) => {
9617                    if last_off == offset {
9618                        stack.push(("MuMimoGroupData", last_off));
9619                        break;
9620                    }
9621                }
9622                Nl80211Attrs::MuMimoFollowMacAddr(val) => {
9623                    if last_off == offset {
9624                        stack.push(("MuMimoFollowMacAddr", last_off));
9625                        break;
9626                    }
9627                }
9628                Nl80211Attrs::ScanStartTimeTsf(val) => {
9629                    if last_off == offset {
9630                        stack.push(("ScanStartTimeTsf", last_off));
9631                        break;
9632                    }
9633                }
9634                Nl80211Attrs::ScanStartTimeTsfBssid(val) => {
9635                    if last_off == offset {
9636                        stack.push(("ScanStartTimeTsfBssid", last_off));
9637                        break;
9638                    }
9639                }
9640                Nl80211Attrs::MeasurementDuration(val) => {
9641                    if last_off == offset {
9642                        stack.push(("MeasurementDuration", last_off));
9643                        break;
9644                    }
9645                }
9646                Nl80211Attrs::MeasurementDurationMandatory(val) => {
9647                    if last_off == offset {
9648                        stack.push(("MeasurementDurationMandatory", last_off));
9649                        break;
9650                    }
9651                }
9652                Nl80211Attrs::MeshPeerAid(val) => {
9653                    if last_off == offset {
9654                        stack.push(("MeshPeerAid", last_off));
9655                        break;
9656                    }
9657                }
9658                Nl80211Attrs::NanMasterPref(val) => {
9659                    if last_off == offset {
9660                        stack.push(("NanMasterPref", last_off));
9661                        break;
9662                    }
9663                }
9664                Nl80211Attrs::Bands(val) => {
9665                    if last_off == offset {
9666                        stack.push(("Bands", last_off));
9667                        break;
9668                    }
9669                }
9670                Nl80211Attrs::NanFunc(val) => {
9671                    if last_off == offset {
9672                        stack.push(("NanFunc", last_off));
9673                        break;
9674                    }
9675                }
9676                Nl80211Attrs::NanMatch(val) => {
9677                    if last_off == offset {
9678                        stack.push(("NanMatch", last_off));
9679                        break;
9680                    }
9681                }
9682                Nl80211Attrs::FilsKek(val) => {
9683                    if last_off == offset {
9684                        stack.push(("FilsKek", last_off));
9685                        break;
9686                    }
9687                }
9688                Nl80211Attrs::FilsNonces(val) => {
9689                    if last_off == offset {
9690                        stack.push(("FilsNonces", last_off));
9691                        break;
9692                    }
9693                }
9694                Nl80211Attrs::MulticastToUnicastEnabled(val) => {
9695                    if last_off == offset {
9696                        stack.push(("MulticastToUnicastEnabled", last_off));
9697                        break;
9698                    }
9699                }
9700                Nl80211Attrs::Bssid(val) => {
9701                    if last_off == offset {
9702                        stack.push(("Bssid", last_off));
9703                        break;
9704                    }
9705                }
9706                Nl80211Attrs::SchedScanRelativeRssi(val) => {
9707                    if last_off == offset {
9708                        stack.push(("SchedScanRelativeRssi", last_off));
9709                        break;
9710                    }
9711                }
9712                Nl80211Attrs::SchedScanRssiAdjust(val) => {
9713                    if last_off == offset {
9714                        stack.push(("SchedScanRssiAdjust", last_off));
9715                        break;
9716                    }
9717                }
9718                Nl80211Attrs::TimeoutReason(val) => {
9719                    if last_off == offset {
9720                        stack.push(("TimeoutReason", last_off));
9721                        break;
9722                    }
9723                }
9724                Nl80211Attrs::FilsErpUsername(val) => {
9725                    if last_off == offset {
9726                        stack.push(("FilsErpUsername", last_off));
9727                        break;
9728                    }
9729                }
9730                Nl80211Attrs::FilsErpRealm(val) => {
9731                    if last_off == offset {
9732                        stack.push(("FilsErpRealm", last_off));
9733                        break;
9734                    }
9735                }
9736                Nl80211Attrs::FilsErpNextSeqNum(val) => {
9737                    if last_off == offset {
9738                        stack.push(("FilsErpNextSeqNum", last_off));
9739                        break;
9740                    }
9741                }
9742                Nl80211Attrs::FilsErpRrk(val) => {
9743                    if last_off == offset {
9744                        stack.push(("FilsErpRrk", last_off));
9745                        break;
9746                    }
9747                }
9748                Nl80211Attrs::FilsCacheId(val) => {
9749                    if last_off == offset {
9750                        stack.push(("FilsCacheId", last_off));
9751                        break;
9752                    }
9753                }
9754                Nl80211Attrs::Pmk(val) => {
9755                    if last_off == offset {
9756                        stack.push(("Pmk", last_off));
9757                        break;
9758                    }
9759                }
9760                Nl80211Attrs::SchedScanMulti(val) => {
9761                    if last_off == offset {
9762                        stack.push(("SchedScanMulti", last_off));
9763                        break;
9764                    }
9765                }
9766                Nl80211Attrs::SchedScanMaxReqs(val) => {
9767                    if last_off == offset {
9768                        stack.push(("SchedScanMaxReqs", last_off));
9769                        break;
9770                    }
9771                }
9772                Nl80211Attrs::Want1x4wayHs(val) => {
9773                    if last_off == offset {
9774                        stack.push(("Want1x4wayHs", last_off));
9775                        break;
9776                    }
9777                }
9778                Nl80211Attrs::Pmkr0Name(val) => {
9779                    if last_off == offset {
9780                        stack.push(("Pmkr0Name", last_off));
9781                        break;
9782                    }
9783                }
9784                Nl80211Attrs::PortAuthorized(val) => {
9785                    if last_off == offset {
9786                        stack.push(("PortAuthorized", last_off));
9787                        break;
9788                    }
9789                }
9790                Nl80211Attrs::ExternalAuthAction(val) => {
9791                    if last_off == offset {
9792                        stack.push(("ExternalAuthAction", last_off));
9793                        break;
9794                    }
9795                }
9796                Nl80211Attrs::ExternalAuthSupport(val) => {
9797                    if last_off == offset {
9798                        stack.push(("ExternalAuthSupport", last_off));
9799                        break;
9800                    }
9801                }
9802                Nl80211Attrs::Nss(val) => {
9803                    if last_off == offset {
9804                        stack.push(("Nss", last_off));
9805                        break;
9806                    }
9807                }
9808                Nl80211Attrs::AckSignal(val) => {
9809                    if last_off == offset {
9810                        stack.push(("AckSignal", last_off));
9811                        break;
9812                    }
9813                }
9814                Nl80211Attrs::ControlPortOverNl80211(val) => {
9815                    if last_off == offset {
9816                        stack.push(("ControlPortOverNl80211", last_off));
9817                        break;
9818                    }
9819                }
9820                Nl80211Attrs::TxqStats(val) => {
9821                    (stack, missing) = val.lookup_attr(offset, missing_type);
9822                    if !stack.is_empty() {
9823                        break;
9824                    }
9825                }
9826                Nl80211Attrs::TxqLimit(val) => {
9827                    if last_off == offset {
9828                        stack.push(("TxqLimit", last_off));
9829                        break;
9830                    }
9831                }
9832                Nl80211Attrs::TxqMemoryLimit(val) => {
9833                    if last_off == offset {
9834                        stack.push(("TxqMemoryLimit", last_off));
9835                        break;
9836                    }
9837                }
9838                Nl80211Attrs::TxqQuantum(val) => {
9839                    if last_off == offset {
9840                        stack.push(("TxqQuantum", last_off));
9841                        break;
9842                    }
9843                }
9844                Nl80211Attrs::HeCapability(val) => {
9845                    if last_off == offset {
9846                        stack.push(("HeCapability", last_off));
9847                        break;
9848                    }
9849                }
9850                Nl80211Attrs::FtmResponder(val) => {
9851                    if last_off == offset {
9852                        stack.push(("FtmResponder", last_off));
9853                        break;
9854                    }
9855                }
9856                Nl80211Attrs::FtmResponderStats(val) => {
9857                    if last_off == offset {
9858                        stack.push(("FtmResponderStats", last_off));
9859                        break;
9860                    }
9861                }
9862                Nl80211Attrs::Timeout(val) => {
9863                    if last_off == offset {
9864                        stack.push(("Timeout", last_off));
9865                        break;
9866                    }
9867                }
9868                Nl80211Attrs::PeerMeasurements(val) => {
9869                    if last_off == offset {
9870                        stack.push(("PeerMeasurements", last_off));
9871                        break;
9872                    }
9873                }
9874                Nl80211Attrs::AirtimeWeight(val) => {
9875                    if last_off == offset {
9876                        stack.push(("AirtimeWeight", last_off));
9877                        break;
9878                    }
9879                }
9880                Nl80211Attrs::StaTxPowerSetting(val) => {
9881                    if last_off == offset {
9882                        stack.push(("StaTxPowerSetting", last_off));
9883                        break;
9884                    }
9885                }
9886                Nl80211Attrs::StaTxPower(val) => {
9887                    if last_off == offset {
9888                        stack.push(("StaTxPower", last_off));
9889                        break;
9890                    }
9891                }
9892                Nl80211Attrs::SaePassword(val) => {
9893                    if last_off == offset {
9894                        stack.push(("SaePassword", last_off));
9895                        break;
9896                    }
9897                }
9898                Nl80211Attrs::TwtResponder(val) => {
9899                    if last_off == offset {
9900                        stack.push(("TwtResponder", last_off));
9901                        break;
9902                    }
9903                }
9904                Nl80211Attrs::HeObssPd(val) => {
9905                    if last_off == offset {
9906                        stack.push(("HeObssPd", last_off));
9907                        break;
9908                    }
9909                }
9910                Nl80211Attrs::WiphyEdmgChannels(val) => {
9911                    if last_off == offset {
9912                        stack.push(("WiphyEdmgChannels", last_off));
9913                        break;
9914                    }
9915                }
9916                Nl80211Attrs::WiphyEdmgBwConfig(val) => {
9917                    if last_off == offset {
9918                        stack.push(("WiphyEdmgBwConfig", last_off));
9919                        break;
9920                    }
9921                }
9922                Nl80211Attrs::VlanId(val) => {
9923                    if last_off == offset {
9924                        stack.push(("VlanId", last_off));
9925                        break;
9926                    }
9927                }
9928                Nl80211Attrs::HeBssColor(val) => {
9929                    if last_off == offset {
9930                        stack.push(("HeBssColor", last_off));
9931                        break;
9932                    }
9933                }
9934                Nl80211Attrs::IftypeAkmSuites(val) => {
9935                    if last_off == offset {
9936                        stack.push(("IftypeAkmSuites", last_off));
9937                        break;
9938                    }
9939                }
9940                Nl80211Attrs::TidConfig(val) => {
9941                    if last_off == offset {
9942                        stack.push(("TidConfig", last_off));
9943                        break;
9944                    }
9945                }
9946                Nl80211Attrs::ControlPortNoPreauth(val) => {
9947                    if last_off == offset {
9948                        stack.push(("ControlPortNoPreauth", last_off));
9949                        break;
9950                    }
9951                }
9952                Nl80211Attrs::PmkLifetime(val) => {
9953                    if last_off == offset {
9954                        stack.push(("PmkLifetime", last_off));
9955                        break;
9956                    }
9957                }
9958                Nl80211Attrs::PmkReauthThreshold(val) => {
9959                    if last_off == offset {
9960                        stack.push(("PmkReauthThreshold", last_off));
9961                        break;
9962                    }
9963                }
9964                Nl80211Attrs::ReceiveMulticast(val) => {
9965                    if last_off == offset {
9966                        stack.push(("ReceiveMulticast", last_off));
9967                        break;
9968                    }
9969                }
9970                Nl80211Attrs::WiphyFreqOffset(val) => {
9971                    if last_off == offset {
9972                        stack.push(("WiphyFreqOffset", last_off));
9973                        break;
9974                    }
9975                }
9976                Nl80211Attrs::CenterFreq1Offset(val) => {
9977                    if last_off == offset {
9978                        stack.push(("CenterFreq1Offset", last_off));
9979                        break;
9980                    }
9981                }
9982                Nl80211Attrs::ScanFreqKhz(val) => {
9983                    if last_off == offset {
9984                        stack.push(("ScanFreqKhz", last_off));
9985                        break;
9986                    }
9987                }
9988                Nl80211Attrs::He6ghzCapability(val) => {
9989                    if last_off == offset {
9990                        stack.push(("He6ghzCapability", last_off));
9991                        break;
9992                    }
9993                }
9994                Nl80211Attrs::FilsDiscovery(val) => {
9995                    if last_off == offset {
9996                        stack.push(("FilsDiscovery", last_off));
9997                        break;
9998                    }
9999                }
10000                Nl80211Attrs::UnsolBcastProbeResp(val) => {
10001                    if last_off == offset {
10002                        stack.push(("UnsolBcastProbeResp", last_off));
10003                        break;
10004                    }
10005                }
10006                Nl80211Attrs::S1gCapability(val) => {
10007                    if last_off == offset {
10008                        stack.push(("S1gCapability", last_off));
10009                        break;
10010                    }
10011                }
10012                Nl80211Attrs::S1gCapabilityMask(val) => {
10013                    if last_off == offset {
10014                        stack.push(("S1gCapabilityMask", last_off));
10015                        break;
10016                    }
10017                }
10018                Nl80211Attrs::SaePwe(val) => {
10019                    if last_off == offset {
10020                        stack.push(("SaePwe", last_off));
10021                        break;
10022                    }
10023                }
10024                Nl80211Attrs::ReconnectRequested(val) => {
10025                    if last_off == offset {
10026                        stack.push(("ReconnectRequested", last_off));
10027                        break;
10028                    }
10029                }
10030                Nl80211Attrs::SarSpec(val) => {
10031                    (stack, missing) = val.lookup_attr(offset, missing_type);
10032                    if !stack.is_empty() {
10033                        break;
10034                    }
10035                }
10036                Nl80211Attrs::DisableHe(val) => {
10037                    if last_off == offset {
10038                        stack.push(("DisableHe", last_off));
10039                        break;
10040                    }
10041                }
10042                Nl80211Attrs::ObssColorBitmap(val) => {
10043                    if last_off == offset {
10044                        stack.push(("ObssColorBitmap", last_off));
10045                        break;
10046                    }
10047                }
10048                Nl80211Attrs::ColorChangeCount(val) => {
10049                    if last_off == offset {
10050                        stack.push(("ColorChangeCount", last_off));
10051                        break;
10052                    }
10053                }
10054                Nl80211Attrs::ColorChangeColor(val) => {
10055                    if last_off == offset {
10056                        stack.push(("ColorChangeColor", last_off));
10057                        break;
10058                    }
10059                }
10060                Nl80211Attrs::ColorChangeElems(val) => {
10061                    if last_off == offset {
10062                        stack.push(("ColorChangeElems", last_off));
10063                        break;
10064                    }
10065                }
10066                Nl80211Attrs::MbssidConfig(val) => {
10067                    if last_off == offset {
10068                        stack.push(("MbssidConfig", last_off));
10069                        break;
10070                    }
10071                }
10072                Nl80211Attrs::MbssidElems(val) => {
10073                    if last_off == offset {
10074                        stack.push(("MbssidElems", last_off));
10075                        break;
10076                    }
10077                }
10078                Nl80211Attrs::RadarBackground(val) => {
10079                    if last_off == offset {
10080                        stack.push(("RadarBackground", last_off));
10081                        break;
10082                    }
10083                }
10084                Nl80211Attrs::ApSettingsFlags(val) => {
10085                    if last_off == offset {
10086                        stack.push(("ApSettingsFlags", last_off));
10087                        break;
10088                    }
10089                }
10090                Nl80211Attrs::EhtCapability(val) => {
10091                    if last_off == offset {
10092                        stack.push(("EhtCapability", last_off));
10093                        break;
10094                    }
10095                }
10096                Nl80211Attrs::DisableEht(val) => {
10097                    if last_off == offset {
10098                        stack.push(("DisableEht", last_off));
10099                        break;
10100                    }
10101                }
10102                Nl80211Attrs::MloLinks(val) => {
10103                    if last_off == offset {
10104                        stack.push(("MloLinks", last_off));
10105                        break;
10106                    }
10107                }
10108                Nl80211Attrs::MloLinkId(val) => {
10109                    if last_off == offset {
10110                        stack.push(("MloLinkId", last_off));
10111                        break;
10112                    }
10113                }
10114                Nl80211Attrs::MldAddr(val) => {
10115                    if last_off == offset {
10116                        stack.push(("MldAddr", last_off));
10117                        break;
10118                    }
10119                }
10120                Nl80211Attrs::MloSupport(val) => {
10121                    if last_off == offset {
10122                        stack.push(("MloSupport", last_off));
10123                        break;
10124                    }
10125                }
10126                Nl80211Attrs::MaxNumAkmSuites(val) => {
10127                    if last_off == offset {
10128                        stack.push(("MaxNumAkmSuites", last_off));
10129                        break;
10130                    }
10131                }
10132                Nl80211Attrs::EmlCapability(val) => {
10133                    if last_off == offset {
10134                        stack.push(("EmlCapability", last_off));
10135                        break;
10136                    }
10137                }
10138                Nl80211Attrs::MldCapaAndOps(val) => {
10139                    if last_off == offset {
10140                        stack.push(("MldCapaAndOps", last_off));
10141                        break;
10142                    }
10143                }
10144                Nl80211Attrs::TxHwTimestamp(val) => {
10145                    if last_off == offset {
10146                        stack.push(("TxHwTimestamp", last_off));
10147                        break;
10148                    }
10149                }
10150                Nl80211Attrs::RxHwTimestamp(val) => {
10151                    if last_off == offset {
10152                        stack.push(("RxHwTimestamp", last_off));
10153                        break;
10154                    }
10155                }
10156                Nl80211Attrs::TdBitmap(val) => {
10157                    if last_off == offset {
10158                        stack.push(("TdBitmap", last_off));
10159                        break;
10160                    }
10161                }
10162                Nl80211Attrs::PunctBitmap(val) => {
10163                    if last_off == offset {
10164                        stack.push(("PunctBitmap", last_off));
10165                        break;
10166                    }
10167                }
10168                Nl80211Attrs::MaxHwTimestampPeers(val) => {
10169                    if last_off == offset {
10170                        stack.push(("MaxHwTimestampPeers", last_off));
10171                        break;
10172                    }
10173                }
10174                Nl80211Attrs::HwTimestampEnabled(val) => {
10175                    if last_off == offset {
10176                        stack.push(("HwTimestampEnabled", last_off));
10177                        break;
10178                    }
10179                }
10180                Nl80211Attrs::EmaRnrElems(val) => {
10181                    if last_off == offset {
10182                        stack.push(("EmaRnrElems", last_off));
10183                        break;
10184                    }
10185                }
10186                Nl80211Attrs::MloLinkDisabled(val) => {
10187                    if last_off == offset {
10188                        stack.push(("MloLinkDisabled", last_off));
10189                        break;
10190                    }
10191                }
10192                Nl80211Attrs::BssDumpIncludeUseData(val) => {
10193                    if last_off == offset {
10194                        stack.push(("BssDumpIncludeUseData", last_off));
10195                        break;
10196                    }
10197                }
10198                Nl80211Attrs::MloTtlmDlink(val) => {
10199                    if last_off == offset {
10200                        stack.push(("MloTtlmDlink", last_off));
10201                        break;
10202                    }
10203                }
10204                Nl80211Attrs::MloTtlmUlink(val) => {
10205                    if last_off == offset {
10206                        stack.push(("MloTtlmUlink", last_off));
10207                        break;
10208                    }
10209                }
10210                Nl80211Attrs::AssocSppAmsdu(val) => {
10211                    if last_off == offset {
10212                        stack.push(("AssocSppAmsdu", last_off));
10213                        break;
10214                    }
10215                }
10216                Nl80211Attrs::WiphyRadios(val) => {
10217                    if last_off == offset {
10218                        stack.push(("WiphyRadios", last_off));
10219                        break;
10220                    }
10221                }
10222                Nl80211Attrs::WiphyInterfaceCombinations(val) => {
10223                    if last_off == offset {
10224                        stack.push(("WiphyInterfaceCombinations", last_off));
10225                        break;
10226                    }
10227                }
10228                Nl80211Attrs::VifRadioMask(val) => {
10229                    if last_off == offset {
10230                        stack.push(("VifRadioMask", last_off));
10231                        break;
10232                    }
10233                }
10234                _ => {}
10235            };
10236            last_off = cur + attrs.pos;
10237        }
10238        if !stack.is_empty() {
10239            stack.push(("Nl80211Attrs", cur));
10240        }
10241        (stack, missing)
10242    }
10243}
10244#[derive(Clone)]
10245pub enum FrameTypeAttrs {
10246    FrameType(u16),
10247}
10248impl<'a> IterableFrameTypeAttrs<'a> {
10249    pub fn get_frame_type(&self) -> Result<u16, ErrorContext> {
10250        let mut iter = self.clone();
10251        iter.pos = 0;
10252        for attr in iter {
10253            if let FrameTypeAttrs::FrameType(val) = attr? {
10254                return Ok(val);
10255            }
10256        }
10257        Err(ErrorContext::new_missing(
10258            "FrameTypeAttrs",
10259            "FrameType",
10260            self.orig_loc,
10261            self.buf.as_ptr() as usize,
10262        ))
10263    }
10264}
10265impl FrameTypeAttrs {
10266    pub fn new<'a>(buf: &'a [u8]) -> IterableFrameTypeAttrs<'a> {
10267        IterableFrameTypeAttrs::with_loc(buf, buf.as_ptr() as usize)
10268    }
10269    fn attr_from_type(r#type: u16) -> Option<&'static str> {
10270        Nl80211Attrs::attr_from_type(r#type)
10271    }
10272}
10273#[derive(Clone, Copy, Default)]
10274pub struct IterableFrameTypeAttrs<'a> {
10275    buf: &'a [u8],
10276    pos: usize,
10277    orig_loc: usize,
10278}
10279impl<'a> IterableFrameTypeAttrs<'a> {
10280    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10281        Self {
10282            buf,
10283            pos: 0,
10284            orig_loc,
10285        }
10286    }
10287    pub fn get_buf(&self) -> &'a [u8] {
10288        self.buf
10289    }
10290}
10291impl<'a> Iterator for IterableFrameTypeAttrs<'a> {
10292    type Item = Result<FrameTypeAttrs, ErrorContext>;
10293    fn next(&mut self) -> Option<Self::Item> {
10294        let pos = self.pos;
10295        let mut r#type;
10296        loop {
10297            r#type = None;
10298            if self.buf.len() == self.pos {
10299                return None;
10300            }
10301            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
10302                break;
10303            };
10304            r#type = Some(header.r#type);
10305            let res = match header.r#type {
10306                101u16 => FrameTypeAttrs::FrameType({
10307                    let res = parse_u16(next);
10308                    let Some(val) = res else { break };
10309                    val
10310                }),
10311                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
10312                n => continue,
10313            };
10314            return Some(Ok(res));
10315        }
10316        Some(Err(ErrorContext::new(
10317            "FrameTypeAttrs",
10318            r#type.and_then(|t| FrameTypeAttrs::attr_from_type(t)),
10319            self.orig_loc,
10320            self.buf.as_ptr().wrapping_add(pos) as usize,
10321        )))
10322    }
10323}
10324impl std::fmt::Debug for IterableFrameTypeAttrs<'_> {
10325    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10326        let mut fmt = f.debug_struct("FrameTypeAttrs");
10327        for attr in self.clone() {
10328            let attr = match attr {
10329                Ok(a) => a,
10330                Err(err) => {
10331                    fmt.finish()?;
10332                    f.write_str("Err(")?;
10333                    err.fmt(f)?;
10334                    return f.write_str(")");
10335                }
10336            };
10337            match attr {
10338                FrameTypeAttrs::FrameType(val) => fmt.field("FrameType", &val),
10339            };
10340        }
10341        fmt.finish()
10342    }
10343}
10344impl IterableFrameTypeAttrs<'_> {
10345    pub fn lookup_attr(
10346        &self,
10347        offset: usize,
10348        missing_type: Option<u16>,
10349    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
10350        let mut stack = Vec::new();
10351        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
10352        if missing_type.is_some() && cur == offset {
10353            stack.push(("FrameTypeAttrs", offset));
10354            return (
10355                stack,
10356                missing_type.and_then(|t| FrameTypeAttrs::attr_from_type(t)),
10357            );
10358        }
10359        if cur > offset || cur + self.buf.len() < offset {
10360            return (stack, None);
10361        }
10362        let mut attrs = self.clone();
10363        let mut last_off = cur + attrs.pos;
10364        while let Some(attr) = attrs.next() {
10365            let Ok(attr) = attr else { break };
10366            match attr {
10367                FrameTypeAttrs::FrameType(val) => {
10368                    if last_off == offset {
10369                        stack.push(("FrameType", last_off));
10370                        break;
10371                    }
10372                }
10373                _ => {}
10374            };
10375            last_off = cur + attrs.pos;
10376        }
10377        if !stack.is_empty() {
10378            stack.push(("FrameTypeAttrs", cur));
10379        }
10380        (stack, None)
10381    }
10382}
10383#[derive(Clone)]
10384pub enum WiphyBands<'a> {
10385    #[doc = "2\\.4 GHz ISM band"]
10386    _2ghz(IterableBandAttrs<'a>),
10387    #[doc = "around 5 GHz band (4\\.9 \\- 5\\.7 GHz)"]
10388    _5ghz(IterableBandAttrs<'a>),
10389    #[doc = "around 60 GHz band (58\\.32 \\- 69\\.12 GHz)"]
10390    _60ghz(IterableBandAttrs<'a>),
10391    _6ghz(IterableBandAttrs<'a>),
10392    S1ghz(IterableBandAttrs<'a>),
10393    Lc(IterableBandAttrs<'a>),
10394}
10395impl<'a> IterableWiphyBands<'a> {
10396    #[doc = "2\\.4 GHz ISM band"]
10397    pub fn get_2ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10398        let mut iter = self.clone();
10399        iter.pos = 0;
10400        for attr in iter {
10401            if let WiphyBands::_2ghz(val) = attr? {
10402                return Ok(val);
10403            }
10404        }
10405        Err(ErrorContext::new_missing(
10406            "WiphyBands",
10407            "2ghz",
10408            self.orig_loc,
10409            self.buf.as_ptr() as usize,
10410        ))
10411    }
10412    #[doc = "around 5 GHz band (4\\.9 \\- 5\\.7 GHz)"]
10413    pub fn get_5ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10414        let mut iter = self.clone();
10415        iter.pos = 0;
10416        for attr in iter {
10417            if let WiphyBands::_5ghz(val) = attr? {
10418                return Ok(val);
10419            }
10420        }
10421        Err(ErrorContext::new_missing(
10422            "WiphyBands",
10423            "5ghz",
10424            self.orig_loc,
10425            self.buf.as_ptr() as usize,
10426        ))
10427    }
10428    #[doc = "around 60 GHz band (58\\.32 \\- 69\\.12 GHz)"]
10429    pub fn get_60ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10430        let mut iter = self.clone();
10431        iter.pos = 0;
10432        for attr in iter {
10433            if let WiphyBands::_60ghz(val) = attr? {
10434                return Ok(val);
10435            }
10436        }
10437        Err(ErrorContext::new_missing(
10438            "WiphyBands",
10439            "60ghz",
10440            self.orig_loc,
10441            self.buf.as_ptr() as usize,
10442        ))
10443    }
10444    pub fn get_6ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10445        let mut iter = self.clone();
10446        iter.pos = 0;
10447        for attr in iter {
10448            if let WiphyBands::_6ghz(val) = attr? {
10449                return Ok(val);
10450            }
10451        }
10452        Err(ErrorContext::new_missing(
10453            "WiphyBands",
10454            "6ghz",
10455            self.orig_loc,
10456            self.buf.as_ptr() as usize,
10457        ))
10458    }
10459    pub fn get_s1ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10460        let mut iter = self.clone();
10461        iter.pos = 0;
10462        for attr in iter {
10463            if let WiphyBands::S1ghz(val) = attr? {
10464                return Ok(val);
10465            }
10466        }
10467        Err(ErrorContext::new_missing(
10468            "WiphyBands",
10469            "S1ghz",
10470            self.orig_loc,
10471            self.buf.as_ptr() as usize,
10472        ))
10473    }
10474    pub fn get_lc(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10475        let mut iter = self.clone();
10476        iter.pos = 0;
10477        for attr in iter {
10478            if let WiphyBands::Lc(val) = attr? {
10479                return Ok(val);
10480            }
10481        }
10482        Err(ErrorContext::new_missing(
10483            "WiphyBands",
10484            "Lc",
10485            self.orig_loc,
10486            self.buf.as_ptr() as usize,
10487        ))
10488    }
10489}
10490impl WiphyBands<'_> {
10491    pub fn new<'a>(buf: &'a [u8]) -> IterableWiphyBands<'a> {
10492        IterableWiphyBands::with_loc(buf, buf.as_ptr() as usize)
10493    }
10494    fn attr_from_type(r#type: u16) -> Option<&'static str> {
10495        let res = match r#type {
10496            0u16 => "2ghz",
10497            1u16 => "5ghz",
10498            2u16 => "60ghz",
10499            3u16 => "6ghz",
10500            4u16 => "S1ghz",
10501            5u16 => "Lc",
10502            _ => return None,
10503        };
10504        Some(res)
10505    }
10506}
10507#[derive(Clone, Copy, Default)]
10508pub struct IterableWiphyBands<'a> {
10509    buf: &'a [u8],
10510    pos: usize,
10511    orig_loc: usize,
10512}
10513impl<'a> IterableWiphyBands<'a> {
10514    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10515        Self {
10516            buf,
10517            pos: 0,
10518            orig_loc,
10519        }
10520    }
10521    pub fn get_buf(&self) -> &'a [u8] {
10522        self.buf
10523    }
10524}
10525impl<'a> Iterator for IterableWiphyBands<'a> {
10526    type Item = Result<WiphyBands<'a>, ErrorContext>;
10527    fn next(&mut self) -> Option<Self::Item> {
10528        let pos = self.pos;
10529        let mut r#type;
10530        loop {
10531            r#type = None;
10532            if self.buf.len() == self.pos {
10533                return None;
10534            }
10535            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
10536                break;
10537            };
10538            r#type = Some(header.r#type);
10539            let res = match header.r#type {
10540                0u16 => WiphyBands::_2ghz({
10541                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10542                    let Some(val) = res else { break };
10543                    val
10544                }),
10545                1u16 => WiphyBands::_5ghz({
10546                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10547                    let Some(val) = res else { break };
10548                    val
10549                }),
10550                2u16 => WiphyBands::_60ghz({
10551                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10552                    let Some(val) = res else { break };
10553                    val
10554                }),
10555                3u16 => WiphyBands::_6ghz({
10556                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10557                    let Some(val) = res else { break };
10558                    val
10559                }),
10560                4u16 => WiphyBands::S1ghz({
10561                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10562                    let Some(val) = res else { break };
10563                    val
10564                }),
10565                5u16 => WiphyBands::Lc({
10566                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10567                    let Some(val) = res else { break };
10568                    val
10569                }),
10570                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
10571                n => continue,
10572            };
10573            return Some(Ok(res));
10574        }
10575        Some(Err(ErrorContext::new(
10576            "WiphyBands",
10577            r#type.and_then(|t| WiphyBands::attr_from_type(t)),
10578            self.orig_loc,
10579            self.buf.as_ptr().wrapping_add(pos) as usize,
10580        )))
10581    }
10582}
10583impl<'a> std::fmt::Debug for IterableWiphyBands<'_> {
10584    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10585        let mut fmt = f.debug_struct("WiphyBands");
10586        for attr in self.clone() {
10587            let attr = match attr {
10588                Ok(a) => a,
10589                Err(err) => {
10590                    fmt.finish()?;
10591                    f.write_str("Err(")?;
10592                    err.fmt(f)?;
10593                    return f.write_str(")");
10594                }
10595            };
10596            match attr {
10597                WiphyBands::_2ghz(val) => fmt.field("_2ghz", &val),
10598                WiphyBands::_5ghz(val) => fmt.field("_5ghz", &val),
10599                WiphyBands::_60ghz(val) => fmt.field("_60ghz", &val),
10600                WiphyBands::_6ghz(val) => fmt.field("_6ghz", &val),
10601                WiphyBands::S1ghz(val) => fmt.field("S1ghz", &val),
10602                WiphyBands::Lc(val) => fmt.field("Lc", &val),
10603            };
10604        }
10605        fmt.finish()
10606    }
10607}
10608impl IterableWiphyBands<'_> {
10609    pub fn lookup_attr(
10610        &self,
10611        offset: usize,
10612        missing_type: Option<u16>,
10613    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
10614        let mut stack = Vec::new();
10615        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
10616        if missing_type.is_some() && cur == offset {
10617            stack.push(("WiphyBands", offset));
10618            return (
10619                stack,
10620                missing_type.and_then(|t| WiphyBands::attr_from_type(t)),
10621            );
10622        }
10623        if cur > offset || cur + self.buf.len() < offset {
10624            return (stack, None);
10625        }
10626        let mut attrs = self.clone();
10627        let mut last_off = cur + attrs.pos;
10628        let mut missing = None;
10629        while let Some(attr) = attrs.next() {
10630            let Ok(attr) = attr else { break };
10631            match attr {
10632                WiphyBands::_2ghz(val) => {
10633                    (stack, missing) = val.lookup_attr(offset, missing_type);
10634                    if !stack.is_empty() {
10635                        break;
10636                    }
10637                }
10638                WiphyBands::_5ghz(val) => {
10639                    (stack, missing) = val.lookup_attr(offset, missing_type);
10640                    if !stack.is_empty() {
10641                        break;
10642                    }
10643                }
10644                WiphyBands::_60ghz(val) => {
10645                    (stack, missing) = val.lookup_attr(offset, missing_type);
10646                    if !stack.is_empty() {
10647                        break;
10648                    }
10649                }
10650                WiphyBands::_6ghz(val) => {
10651                    (stack, missing) = val.lookup_attr(offset, missing_type);
10652                    if !stack.is_empty() {
10653                        break;
10654                    }
10655                }
10656                WiphyBands::S1ghz(val) => {
10657                    (stack, missing) = val.lookup_attr(offset, missing_type);
10658                    if !stack.is_empty() {
10659                        break;
10660                    }
10661                }
10662                WiphyBands::Lc(val) => {
10663                    (stack, missing) = val.lookup_attr(offset, missing_type);
10664                    if !stack.is_empty() {
10665                        break;
10666                    }
10667                }
10668                _ => {}
10669            };
10670            last_off = cur + attrs.pos;
10671        }
10672        if !stack.is_empty() {
10673            stack.push(("WiphyBands", cur));
10674        }
10675        (stack, missing)
10676    }
10677}
10678#[derive(Clone)]
10679pub enum BandAttrs<'a> {
10680    Freqs(IterableArrayFrequencyAttrs<'a>),
10681    Rates(IterableArrayBitrateAttrs<'a>),
10682    HtMcsSet(&'a [u8]),
10683    HtCapa(u16),
10684    HtAmpduFactor(u8),
10685    HtAmpduDensity(u8),
10686    VhtMcsSet(&'a [u8]),
10687    VhtCapa(u32),
10688    IftypeData(IterableArrayIftypeDataAttrs<'a>),
10689    EdmgChannels(&'a [u8]),
10690    EdmgBwConfig(&'a [u8]),
10691    S1gMcsNssSet(&'a [u8]),
10692    S1gCapa(&'a [u8]),
10693}
10694impl<'a> IterableBandAttrs<'a> {
10695    pub fn get_freqs(
10696        &self,
10697    ) -> Result<
10698        ArrayIterable<IterableArrayFrequencyAttrs<'a>, IterableFrequencyAttrs<'a>>,
10699        ErrorContext,
10700    > {
10701        for attr in self.clone() {
10702            if let BandAttrs::Freqs(val) = attr? {
10703                return Ok(ArrayIterable::new(val));
10704            }
10705        }
10706        Err(ErrorContext::new_missing(
10707            "BandAttrs",
10708            "Freqs",
10709            self.orig_loc,
10710            self.buf.as_ptr() as usize,
10711        ))
10712    }
10713    pub fn get_rates(
10714        &self,
10715    ) -> Result<ArrayIterable<IterableArrayBitrateAttrs<'a>, IterableBitrateAttrs<'a>>, ErrorContext>
10716    {
10717        for attr in self.clone() {
10718            if let BandAttrs::Rates(val) = attr? {
10719                return Ok(ArrayIterable::new(val));
10720            }
10721        }
10722        Err(ErrorContext::new_missing(
10723            "BandAttrs",
10724            "Rates",
10725            self.orig_loc,
10726            self.buf.as_ptr() as usize,
10727        ))
10728    }
10729    pub fn get_ht_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
10730        let mut iter = self.clone();
10731        iter.pos = 0;
10732        for attr in iter {
10733            if let BandAttrs::HtMcsSet(val) = attr? {
10734                return Ok(val);
10735            }
10736        }
10737        Err(ErrorContext::new_missing(
10738            "BandAttrs",
10739            "HtMcsSet",
10740            self.orig_loc,
10741            self.buf.as_ptr() as usize,
10742        ))
10743    }
10744    pub fn get_ht_capa(&self) -> Result<u16, ErrorContext> {
10745        let mut iter = self.clone();
10746        iter.pos = 0;
10747        for attr in iter {
10748            if let BandAttrs::HtCapa(val) = attr? {
10749                return Ok(val);
10750            }
10751        }
10752        Err(ErrorContext::new_missing(
10753            "BandAttrs",
10754            "HtCapa",
10755            self.orig_loc,
10756            self.buf.as_ptr() as usize,
10757        ))
10758    }
10759    pub fn get_ht_ampdu_factor(&self) -> Result<u8, ErrorContext> {
10760        let mut iter = self.clone();
10761        iter.pos = 0;
10762        for attr in iter {
10763            if let BandAttrs::HtAmpduFactor(val) = attr? {
10764                return Ok(val);
10765            }
10766        }
10767        Err(ErrorContext::new_missing(
10768            "BandAttrs",
10769            "HtAmpduFactor",
10770            self.orig_loc,
10771            self.buf.as_ptr() as usize,
10772        ))
10773    }
10774    pub fn get_ht_ampdu_density(&self) -> Result<u8, ErrorContext> {
10775        let mut iter = self.clone();
10776        iter.pos = 0;
10777        for attr in iter {
10778            if let BandAttrs::HtAmpduDensity(val) = attr? {
10779                return Ok(val);
10780            }
10781        }
10782        Err(ErrorContext::new_missing(
10783            "BandAttrs",
10784            "HtAmpduDensity",
10785            self.orig_loc,
10786            self.buf.as_ptr() as usize,
10787        ))
10788    }
10789    pub fn get_vht_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
10790        let mut iter = self.clone();
10791        iter.pos = 0;
10792        for attr in iter {
10793            if let BandAttrs::VhtMcsSet(val) = attr? {
10794                return Ok(val);
10795            }
10796        }
10797        Err(ErrorContext::new_missing(
10798            "BandAttrs",
10799            "VhtMcsSet",
10800            self.orig_loc,
10801            self.buf.as_ptr() as usize,
10802        ))
10803    }
10804    pub fn get_vht_capa(&self) -> Result<u32, ErrorContext> {
10805        let mut iter = self.clone();
10806        iter.pos = 0;
10807        for attr in iter {
10808            if let BandAttrs::VhtCapa(val) = attr? {
10809                return Ok(val);
10810            }
10811        }
10812        Err(ErrorContext::new_missing(
10813            "BandAttrs",
10814            "VhtCapa",
10815            self.orig_loc,
10816            self.buf.as_ptr() as usize,
10817        ))
10818    }
10819    pub fn get_iftype_data(
10820        &self,
10821    ) -> Result<
10822        ArrayIterable<IterableArrayIftypeDataAttrs<'a>, IterableIftypeDataAttrs<'a>>,
10823        ErrorContext,
10824    > {
10825        for attr in self.clone() {
10826            if let BandAttrs::IftypeData(val) = attr? {
10827                return Ok(ArrayIterable::new(val));
10828            }
10829        }
10830        Err(ErrorContext::new_missing(
10831            "BandAttrs",
10832            "IftypeData",
10833            self.orig_loc,
10834            self.buf.as_ptr() as usize,
10835        ))
10836    }
10837    pub fn get_edmg_channels(&self) -> Result<&'a [u8], ErrorContext> {
10838        let mut iter = self.clone();
10839        iter.pos = 0;
10840        for attr in iter {
10841            if let BandAttrs::EdmgChannels(val) = attr? {
10842                return Ok(val);
10843            }
10844        }
10845        Err(ErrorContext::new_missing(
10846            "BandAttrs",
10847            "EdmgChannels",
10848            self.orig_loc,
10849            self.buf.as_ptr() as usize,
10850        ))
10851    }
10852    pub fn get_edmg_bw_config(&self) -> Result<&'a [u8], ErrorContext> {
10853        let mut iter = self.clone();
10854        iter.pos = 0;
10855        for attr in iter {
10856            if let BandAttrs::EdmgBwConfig(val) = attr? {
10857                return Ok(val);
10858            }
10859        }
10860        Err(ErrorContext::new_missing(
10861            "BandAttrs",
10862            "EdmgBwConfig",
10863            self.orig_loc,
10864            self.buf.as_ptr() as usize,
10865        ))
10866    }
10867    pub fn get_s1g_mcs_nss_set(&self) -> Result<&'a [u8], ErrorContext> {
10868        let mut iter = self.clone();
10869        iter.pos = 0;
10870        for attr in iter {
10871            if let BandAttrs::S1gMcsNssSet(val) = attr? {
10872                return Ok(val);
10873            }
10874        }
10875        Err(ErrorContext::new_missing(
10876            "BandAttrs",
10877            "S1gMcsNssSet",
10878            self.orig_loc,
10879            self.buf.as_ptr() as usize,
10880        ))
10881    }
10882    pub fn get_s1g_capa(&self) -> Result<&'a [u8], ErrorContext> {
10883        let mut iter = self.clone();
10884        iter.pos = 0;
10885        for attr in iter {
10886            if let BandAttrs::S1gCapa(val) = attr? {
10887                return Ok(val);
10888            }
10889        }
10890        Err(ErrorContext::new_missing(
10891            "BandAttrs",
10892            "S1gCapa",
10893            self.orig_loc,
10894            self.buf.as_ptr() as usize,
10895        ))
10896    }
10897}
10898impl<'a> FrequencyAttrs<'a> {
10899    pub fn new_array(buf: &[u8]) -> IterableArrayFrequencyAttrs<'_> {
10900        IterableArrayFrequencyAttrs::with_loc(buf, buf.as_ptr() as usize)
10901    }
10902}
10903#[derive(Clone, Copy, Default)]
10904pub struct IterableArrayFrequencyAttrs<'a> {
10905    buf: &'a [u8],
10906    pos: usize,
10907    orig_loc: usize,
10908}
10909impl<'a> IterableArrayFrequencyAttrs<'a> {
10910    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10911        Self {
10912            buf,
10913            pos: 0,
10914            orig_loc,
10915        }
10916    }
10917    pub fn get_buf(&self) -> &'a [u8] {
10918        self.buf
10919    }
10920}
10921impl<'a> Iterator for IterableArrayFrequencyAttrs<'a> {
10922    type Item = Result<IterableFrequencyAttrs<'a>, ErrorContext>;
10923    fn next(&mut self) -> Option<Self::Item> {
10924        if self.buf.len() == self.pos {
10925            return None;
10926        }
10927        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
10928            {
10929                return Some(Ok(IterableFrequencyAttrs::with_loc(next, self.orig_loc)));
10930            }
10931        }
10932        Some(Err(ErrorContext::new(
10933            "FrequencyAttrs",
10934            None,
10935            self.orig_loc,
10936            self.buf.as_ptr().wrapping_add(self.pos) as usize,
10937        )))
10938    }
10939}
10940impl BitrateAttrs {
10941    pub fn new_array(buf: &[u8]) -> IterableArrayBitrateAttrs<'_> {
10942        IterableArrayBitrateAttrs::with_loc(buf, buf.as_ptr() as usize)
10943    }
10944}
10945#[derive(Clone, Copy, Default)]
10946pub struct IterableArrayBitrateAttrs<'a> {
10947    buf: &'a [u8],
10948    pos: usize,
10949    orig_loc: usize,
10950}
10951impl<'a> IterableArrayBitrateAttrs<'a> {
10952    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10953        Self {
10954            buf,
10955            pos: 0,
10956            orig_loc,
10957        }
10958    }
10959    pub fn get_buf(&self) -> &'a [u8] {
10960        self.buf
10961    }
10962}
10963impl<'a> Iterator for IterableArrayBitrateAttrs<'a> {
10964    type Item = Result<IterableBitrateAttrs<'a>, ErrorContext>;
10965    fn next(&mut self) -> Option<Self::Item> {
10966        if self.buf.len() == self.pos {
10967            return None;
10968        }
10969        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
10970            {
10971                return Some(Ok(IterableBitrateAttrs::with_loc(next, self.orig_loc)));
10972            }
10973        }
10974        Some(Err(ErrorContext::new(
10975            "BitrateAttrs",
10976            None,
10977            self.orig_loc,
10978            self.buf.as_ptr().wrapping_add(self.pos) as usize,
10979        )))
10980    }
10981}
10982impl<'a> IftypeDataAttrs<'a> {
10983    pub fn new_array(buf: &[u8]) -> IterableArrayIftypeDataAttrs<'_> {
10984        IterableArrayIftypeDataAttrs::with_loc(buf, buf.as_ptr() as usize)
10985    }
10986}
10987#[derive(Clone, Copy, Default)]
10988pub struct IterableArrayIftypeDataAttrs<'a> {
10989    buf: &'a [u8],
10990    pos: usize,
10991    orig_loc: usize,
10992}
10993impl<'a> IterableArrayIftypeDataAttrs<'a> {
10994    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10995        Self {
10996            buf,
10997            pos: 0,
10998            orig_loc,
10999        }
11000    }
11001    pub fn get_buf(&self) -> &'a [u8] {
11002        self.buf
11003    }
11004}
11005impl<'a> Iterator for IterableArrayIftypeDataAttrs<'a> {
11006    type Item = Result<IterableIftypeDataAttrs<'a>, ErrorContext>;
11007    fn next(&mut self) -> Option<Self::Item> {
11008        if self.buf.len() == self.pos {
11009            return None;
11010        }
11011        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
11012            {
11013                return Some(Ok(IterableIftypeDataAttrs::with_loc(next, self.orig_loc)));
11014            }
11015        }
11016        Some(Err(ErrorContext::new(
11017            "IftypeDataAttrs",
11018            None,
11019            self.orig_loc,
11020            self.buf.as_ptr().wrapping_add(self.pos) as usize,
11021        )))
11022    }
11023}
11024impl BandAttrs<'_> {
11025    pub fn new<'a>(buf: &'a [u8]) -> IterableBandAttrs<'a> {
11026        IterableBandAttrs::with_loc(buf, buf.as_ptr() as usize)
11027    }
11028    fn attr_from_type(r#type: u16) -> Option<&'static str> {
11029        let res = match r#type {
11030            1u16 => "Freqs",
11031            2u16 => "Rates",
11032            3u16 => "HtMcsSet",
11033            4u16 => "HtCapa",
11034            5u16 => "HtAmpduFactor",
11035            6u16 => "HtAmpduDensity",
11036            7u16 => "VhtMcsSet",
11037            8u16 => "VhtCapa",
11038            9u16 => "IftypeData",
11039            10u16 => "EdmgChannels",
11040            11u16 => "EdmgBwConfig",
11041            12u16 => "S1gMcsNssSet",
11042            13u16 => "S1gCapa",
11043            _ => return None,
11044        };
11045        Some(res)
11046    }
11047}
11048#[derive(Clone, Copy, Default)]
11049pub struct IterableBandAttrs<'a> {
11050    buf: &'a [u8],
11051    pos: usize,
11052    orig_loc: usize,
11053}
11054impl<'a> IterableBandAttrs<'a> {
11055    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
11056        Self {
11057            buf,
11058            pos: 0,
11059            orig_loc,
11060        }
11061    }
11062    pub fn get_buf(&self) -> &'a [u8] {
11063        self.buf
11064    }
11065}
11066impl<'a> Iterator for IterableBandAttrs<'a> {
11067    type Item = Result<BandAttrs<'a>, ErrorContext>;
11068    fn next(&mut self) -> Option<Self::Item> {
11069        let pos = self.pos;
11070        let mut r#type;
11071        loop {
11072            r#type = None;
11073            if self.buf.len() == self.pos {
11074                return None;
11075            }
11076            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
11077                break;
11078            };
11079            r#type = Some(header.r#type);
11080            let res = match header.r#type {
11081                1u16 => BandAttrs::Freqs({
11082                    let res = Some(IterableArrayFrequencyAttrs::with_loc(next, self.orig_loc));
11083                    let Some(val) = res else { break };
11084                    val
11085                }),
11086                2u16 => BandAttrs::Rates({
11087                    let res = Some(IterableArrayBitrateAttrs::with_loc(next, self.orig_loc));
11088                    let Some(val) = res else { break };
11089                    val
11090                }),
11091                3u16 => BandAttrs::HtMcsSet({
11092                    let res = Some(next);
11093                    let Some(val) = res else { break };
11094                    val
11095                }),
11096                4u16 => BandAttrs::HtCapa({
11097                    let res = parse_u16(next);
11098                    let Some(val) = res else { break };
11099                    val
11100                }),
11101                5u16 => BandAttrs::HtAmpduFactor({
11102                    let res = parse_u8(next);
11103                    let Some(val) = res else { break };
11104                    val
11105                }),
11106                6u16 => BandAttrs::HtAmpduDensity({
11107                    let res = parse_u8(next);
11108                    let Some(val) = res else { break };
11109                    val
11110                }),
11111                7u16 => BandAttrs::VhtMcsSet({
11112                    let res = Some(next);
11113                    let Some(val) = res else { break };
11114                    val
11115                }),
11116                8u16 => BandAttrs::VhtCapa({
11117                    let res = parse_u32(next);
11118                    let Some(val) = res else { break };
11119                    val
11120                }),
11121                9u16 => BandAttrs::IftypeData({
11122                    let res = Some(IterableArrayIftypeDataAttrs::with_loc(next, self.orig_loc));
11123                    let Some(val) = res else { break };
11124                    val
11125                }),
11126                10u16 => BandAttrs::EdmgChannels({
11127                    let res = Some(next);
11128                    let Some(val) = res else { break };
11129                    val
11130                }),
11131                11u16 => BandAttrs::EdmgBwConfig({
11132                    let res = Some(next);
11133                    let Some(val) = res else { break };
11134                    val
11135                }),
11136                12u16 => BandAttrs::S1gMcsNssSet({
11137                    let res = Some(next);
11138                    let Some(val) = res else { break };
11139                    val
11140                }),
11141                13u16 => BandAttrs::S1gCapa({
11142                    let res = Some(next);
11143                    let Some(val) = res else { break };
11144                    val
11145                }),
11146                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
11147                n => continue,
11148            };
11149            return Some(Ok(res));
11150        }
11151        Some(Err(ErrorContext::new(
11152            "BandAttrs",
11153            r#type.and_then(|t| BandAttrs::attr_from_type(t)),
11154            self.orig_loc,
11155            self.buf.as_ptr().wrapping_add(pos) as usize,
11156        )))
11157    }
11158}
11159impl std::fmt::Debug for IterableArrayFrequencyAttrs<'_> {
11160    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11161        fmt.debug_list()
11162            .entries(self.clone().map(FlattenErrorContext))
11163            .finish()
11164    }
11165}
11166impl std::fmt::Debug for IterableArrayBitrateAttrs<'_> {
11167    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11168        fmt.debug_list()
11169            .entries(self.clone().map(FlattenErrorContext))
11170            .finish()
11171    }
11172}
11173impl std::fmt::Debug for IterableArrayIftypeDataAttrs<'_> {
11174    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11175        fmt.debug_list()
11176            .entries(self.clone().map(FlattenErrorContext))
11177            .finish()
11178    }
11179}
11180impl<'a> std::fmt::Debug for IterableBandAttrs<'_> {
11181    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11182        let mut fmt = f.debug_struct("BandAttrs");
11183        for attr in self.clone() {
11184            let attr = match attr {
11185                Ok(a) => a,
11186                Err(err) => {
11187                    fmt.finish()?;
11188                    f.write_str("Err(")?;
11189                    err.fmt(f)?;
11190                    return f.write_str(")");
11191                }
11192            };
11193            match attr {
11194                BandAttrs::Freqs(val) => fmt.field("Freqs", &val),
11195                BandAttrs::Rates(val) => fmt.field("Rates", &val),
11196                BandAttrs::HtMcsSet(val) => fmt.field("HtMcsSet", &val),
11197                BandAttrs::HtCapa(val) => fmt.field("HtCapa", &val),
11198                BandAttrs::HtAmpduFactor(val) => fmt.field("HtAmpduFactor", &val),
11199                BandAttrs::HtAmpduDensity(val) => fmt.field("HtAmpduDensity", &val),
11200                BandAttrs::VhtMcsSet(val) => fmt.field("VhtMcsSet", &val),
11201                BandAttrs::VhtCapa(val) => fmt.field("VhtCapa", &val),
11202                BandAttrs::IftypeData(val) => fmt.field("IftypeData", &val),
11203                BandAttrs::EdmgChannels(val) => fmt.field("EdmgChannels", &val),
11204                BandAttrs::EdmgBwConfig(val) => fmt.field("EdmgBwConfig", &val),
11205                BandAttrs::S1gMcsNssSet(val) => fmt.field("S1gMcsNssSet", &val),
11206                BandAttrs::S1gCapa(val) => fmt.field("S1gCapa", &val),
11207            };
11208        }
11209        fmt.finish()
11210    }
11211}
11212impl IterableBandAttrs<'_> {
11213    pub fn lookup_attr(
11214        &self,
11215        offset: usize,
11216        missing_type: Option<u16>,
11217    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
11218        let mut stack = Vec::new();
11219        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
11220        if missing_type.is_some() && cur == offset {
11221            stack.push(("BandAttrs", offset));
11222            return (
11223                stack,
11224                missing_type.and_then(|t| BandAttrs::attr_from_type(t)),
11225            );
11226        }
11227        if cur > offset || cur + self.buf.len() < offset {
11228            return (stack, None);
11229        }
11230        let mut attrs = self.clone();
11231        let mut last_off = cur + attrs.pos;
11232        let mut missing = None;
11233        while let Some(attr) = attrs.next() {
11234            let Ok(attr) = attr else { break };
11235            match attr {
11236                BandAttrs::Freqs(val) => {
11237                    for entry in val {
11238                        let Ok(attr) = entry else { break };
11239                        (stack, missing) = attr.lookup_attr(offset, missing_type);
11240                        if !stack.is_empty() {
11241                            break;
11242                        }
11243                    }
11244                    if !stack.is_empty() {
11245                        stack.push(("Freqs", last_off));
11246                        break;
11247                    }
11248                }
11249                BandAttrs::Rates(val) => {
11250                    for entry in val {
11251                        let Ok(attr) = entry else { break };
11252                        (stack, missing) = attr.lookup_attr(offset, missing_type);
11253                        if !stack.is_empty() {
11254                            break;
11255                        }
11256                    }
11257                    if !stack.is_empty() {
11258                        stack.push(("Rates", last_off));
11259                        break;
11260                    }
11261                }
11262                BandAttrs::HtMcsSet(val) => {
11263                    if last_off == offset {
11264                        stack.push(("HtMcsSet", last_off));
11265                        break;
11266                    }
11267                }
11268                BandAttrs::HtCapa(val) => {
11269                    if last_off == offset {
11270                        stack.push(("HtCapa", last_off));
11271                        break;
11272                    }
11273                }
11274                BandAttrs::HtAmpduFactor(val) => {
11275                    if last_off == offset {
11276                        stack.push(("HtAmpduFactor", last_off));
11277                        break;
11278                    }
11279                }
11280                BandAttrs::HtAmpduDensity(val) => {
11281                    if last_off == offset {
11282                        stack.push(("HtAmpduDensity", last_off));
11283                        break;
11284                    }
11285                }
11286                BandAttrs::VhtMcsSet(val) => {
11287                    if last_off == offset {
11288                        stack.push(("VhtMcsSet", last_off));
11289                        break;
11290                    }
11291                }
11292                BandAttrs::VhtCapa(val) => {
11293                    if last_off == offset {
11294                        stack.push(("VhtCapa", last_off));
11295                        break;
11296                    }
11297                }
11298                BandAttrs::IftypeData(val) => {
11299                    for entry in val {
11300                        let Ok(attr) = entry else { break };
11301                        (stack, missing) = attr.lookup_attr(offset, missing_type);
11302                        if !stack.is_empty() {
11303                            break;
11304                        }
11305                    }
11306                    if !stack.is_empty() {
11307                        stack.push(("IftypeData", last_off));
11308                        break;
11309                    }
11310                }
11311                BandAttrs::EdmgChannels(val) => {
11312                    if last_off == offset {
11313                        stack.push(("EdmgChannels", last_off));
11314                        break;
11315                    }
11316                }
11317                BandAttrs::EdmgBwConfig(val) => {
11318                    if last_off == offset {
11319                        stack.push(("EdmgBwConfig", last_off));
11320                        break;
11321                    }
11322                }
11323                BandAttrs::S1gMcsNssSet(val) => {
11324                    if last_off == offset {
11325                        stack.push(("S1gMcsNssSet", last_off));
11326                        break;
11327                    }
11328                }
11329                BandAttrs::S1gCapa(val) => {
11330                    if last_off == offset {
11331                        stack.push(("S1gCapa", last_off));
11332                        break;
11333                    }
11334                }
11335                _ => {}
11336            };
11337            last_off = cur + attrs.pos;
11338        }
11339        if !stack.is_empty() {
11340            stack.push(("BandAttrs", cur));
11341        }
11342        (stack, missing)
11343    }
11344}
11345#[derive(Clone)]
11346pub enum BitrateAttrs {
11347    Rate(u32),
11348    _2ghzShortpreamble(()),
11349}
11350impl<'a> IterableBitrateAttrs<'a> {
11351    pub fn get_rate(&self) -> Result<u32, ErrorContext> {
11352        let mut iter = self.clone();
11353        iter.pos = 0;
11354        for attr in iter {
11355            if let BitrateAttrs::Rate(val) = attr? {
11356                return Ok(val);
11357            }
11358        }
11359        Err(ErrorContext::new_missing(
11360            "BitrateAttrs",
11361            "Rate",
11362            self.orig_loc,
11363            self.buf.as_ptr() as usize,
11364        ))
11365    }
11366    pub fn get_2ghz_shortpreamble(&self) -> Result<(), ErrorContext> {
11367        let mut iter = self.clone();
11368        iter.pos = 0;
11369        for attr in iter {
11370            if let BitrateAttrs::_2ghzShortpreamble(val) = attr? {
11371                return Ok(val);
11372            }
11373        }
11374        Err(ErrorContext::new_missing(
11375            "BitrateAttrs",
11376            "2ghzShortpreamble",
11377            self.orig_loc,
11378            self.buf.as_ptr() as usize,
11379        ))
11380    }
11381}
11382impl BitrateAttrs {
11383    pub fn new<'a>(buf: &'a [u8]) -> IterableBitrateAttrs<'a> {
11384        IterableBitrateAttrs::with_loc(buf, buf.as_ptr() as usize)
11385    }
11386    fn attr_from_type(r#type: u16) -> Option<&'static str> {
11387        let res = match r#type {
11388            1u16 => "Rate",
11389            2u16 => "2ghzShortpreamble",
11390            _ => return None,
11391        };
11392        Some(res)
11393    }
11394}
11395#[derive(Clone, Copy, Default)]
11396pub struct IterableBitrateAttrs<'a> {
11397    buf: &'a [u8],
11398    pos: usize,
11399    orig_loc: usize,
11400}
11401impl<'a> IterableBitrateAttrs<'a> {
11402    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
11403        Self {
11404            buf,
11405            pos: 0,
11406            orig_loc,
11407        }
11408    }
11409    pub fn get_buf(&self) -> &'a [u8] {
11410        self.buf
11411    }
11412}
11413impl<'a> Iterator for IterableBitrateAttrs<'a> {
11414    type Item = Result<BitrateAttrs, ErrorContext>;
11415    fn next(&mut self) -> Option<Self::Item> {
11416        let pos = self.pos;
11417        let mut r#type;
11418        loop {
11419            r#type = None;
11420            if self.buf.len() == self.pos {
11421                return None;
11422            }
11423            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
11424                break;
11425            };
11426            r#type = Some(header.r#type);
11427            let res = match header.r#type {
11428                1u16 => BitrateAttrs::Rate({
11429                    let res = parse_u32(next);
11430                    let Some(val) = res else { break };
11431                    val
11432                }),
11433                2u16 => BitrateAttrs::_2ghzShortpreamble(()),
11434                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
11435                n => continue,
11436            };
11437            return Some(Ok(res));
11438        }
11439        Some(Err(ErrorContext::new(
11440            "BitrateAttrs",
11441            r#type.and_then(|t| BitrateAttrs::attr_from_type(t)),
11442            self.orig_loc,
11443            self.buf.as_ptr().wrapping_add(pos) as usize,
11444        )))
11445    }
11446}
11447impl std::fmt::Debug for IterableBitrateAttrs<'_> {
11448    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11449        let mut fmt = f.debug_struct("BitrateAttrs");
11450        for attr in self.clone() {
11451            let attr = match attr {
11452                Ok(a) => a,
11453                Err(err) => {
11454                    fmt.finish()?;
11455                    f.write_str("Err(")?;
11456                    err.fmt(f)?;
11457                    return f.write_str(")");
11458                }
11459            };
11460            match attr {
11461                BitrateAttrs::Rate(val) => fmt.field("Rate", &val),
11462                BitrateAttrs::_2ghzShortpreamble(val) => fmt.field("_2ghzShortpreamble", &val),
11463            };
11464        }
11465        fmt.finish()
11466    }
11467}
11468impl IterableBitrateAttrs<'_> {
11469    pub fn lookup_attr(
11470        &self,
11471        offset: usize,
11472        missing_type: Option<u16>,
11473    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
11474        let mut stack = Vec::new();
11475        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
11476        if missing_type.is_some() && cur == offset {
11477            stack.push(("BitrateAttrs", offset));
11478            return (
11479                stack,
11480                missing_type.and_then(|t| BitrateAttrs::attr_from_type(t)),
11481            );
11482        }
11483        if cur > offset || cur + self.buf.len() < offset {
11484            return (stack, None);
11485        }
11486        let mut attrs = self.clone();
11487        let mut last_off = cur + attrs.pos;
11488        while let Some(attr) = attrs.next() {
11489            let Ok(attr) = attr else { break };
11490            match attr {
11491                BitrateAttrs::Rate(val) => {
11492                    if last_off == offset {
11493                        stack.push(("Rate", last_off));
11494                        break;
11495                    }
11496                }
11497                BitrateAttrs::_2ghzShortpreamble(val) => {
11498                    if last_off == offset {
11499                        stack.push(("2ghzShortpreamble", last_off));
11500                        break;
11501                    }
11502                }
11503                _ => {}
11504            };
11505            last_off = cur + attrs.pos;
11506        }
11507        if !stack.is_empty() {
11508            stack.push(("BitrateAttrs", cur));
11509        }
11510        (stack, None)
11511    }
11512}
11513#[derive(Clone)]
11514pub enum FrequencyAttrs<'a> {
11515    Freq(u32),
11516    Disabled(()),
11517    NoIr(()),
11518    NoIbss(()),
11519    Radar(()),
11520    MaxTxPower(u32),
11521    DfsState(u32),
11522    DfsTime(&'a [u8]),
11523    NoHt40Minus(&'a [u8]),
11524    NoHt40Plus(&'a [u8]),
11525    No80mhz(&'a [u8]),
11526    No160mhz(&'a [u8]),
11527    DfsCacTime(&'a [u8]),
11528    IndoorOnly(&'a [u8]),
11529    IrConcurrent(&'a [u8]),
11530    No20mhz(&'a [u8]),
11531    No10mhz(&'a [u8]),
11532    Wmm(IterableArrayWmmAttrs<'a>),
11533    NoHe(&'a [u8]),
11534    Offset(u32),
11535    _1mhz(&'a [u8]),
11536    _2mhz(&'a [u8]),
11537    _4mhz(&'a [u8]),
11538    _8mhz(&'a [u8]),
11539    _16mhz(&'a [u8]),
11540    No320mhz(&'a [u8]),
11541    NoEht(&'a [u8]),
11542    Psd(&'a [u8]),
11543    DfsConcurrent(&'a [u8]),
11544    No6ghzVlpClient(&'a [u8]),
11545    No6ghzAfcClient(&'a [u8]),
11546    CanMonitor(&'a [u8]),
11547    Allow6ghzVlpAp(&'a [u8]),
11548}
11549impl<'a> IterableFrequencyAttrs<'a> {
11550    pub fn get_freq(&self) -> Result<u32, ErrorContext> {
11551        let mut iter = self.clone();
11552        iter.pos = 0;
11553        for attr in iter {
11554            if let FrequencyAttrs::Freq(val) = attr? {
11555                return Ok(val);
11556            }
11557        }
11558        Err(ErrorContext::new_missing(
11559            "FrequencyAttrs",
11560            "Freq",
11561            self.orig_loc,
11562            self.buf.as_ptr() as usize,
11563        ))
11564    }
11565    pub fn get_disabled(&self) -> Result<(), ErrorContext> {
11566        let mut iter = self.clone();
11567        iter.pos = 0;
11568        for attr in iter {
11569            if let FrequencyAttrs::Disabled(val) = attr? {
11570                return Ok(val);
11571            }
11572        }
11573        Err(ErrorContext::new_missing(
11574            "FrequencyAttrs",
11575            "Disabled",
11576            self.orig_loc,
11577            self.buf.as_ptr() as usize,
11578        ))
11579    }
11580    pub fn get_no_ir(&self) -> Result<(), ErrorContext> {
11581        let mut iter = self.clone();
11582        iter.pos = 0;
11583        for attr in iter {
11584            if let FrequencyAttrs::NoIr(val) = attr? {
11585                return Ok(val);
11586            }
11587        }
11588        Err(ErrorContext::new_missing(
11589            "FrequencyAttrs",
11590            "NoIr",
11591            self.orig_loc,
11592            self.buf.as_ptr() as usize,
11593        ))
11594    }
11595    pub fn get_no_ibss(&self) -> Result<(), ErrorContext> {
11596        let mut iter = self.clone();
11597        iter.pos = 0;
11598        for attr in iter {
11599            if let FrequencyAttrs::NoIbss(val) = attr? {
11600                return Ok(val);
11601            }
11602        }
11603        Err(ErrorContext::new_missing(
11604            "FrequencyAttrs",
11605            "NoIbss",
11606            self.orig_loc,
11607            self.buf.as_ptr() as usize,
11608        ))
11609    }
11610    pub fn get_radar(&self) -> Result<(), ErrorContext> {
11611        let mut iter = self.clone();
11612        iter.pos = 0;
11613        for attr in iter {
11614            if let FrequencyAttrs::Radar(val) = attr? {
11615                return Ok(val);
11616            }
11617        }
11618        Err(ErrorContext::new_missing(
11619            "FrequencyAttrs",
11620            "Radar",
11621            self.orig_loc,
11622            self.buf.as_ptr() as usize,
11623        ))
11624    }
11625    pub fn get_max_tx_power(&self) -> Result<u32, ErrorContext> {
11626        let mut iter = self.clone();
11627        iter.pos = 0;
11628        for attr in iter {
11629            if let FrequencyAttrs::MaxTxPower(val) = attr? {
11630                return Ok(val);
11631            }
11632        }
11633        Err(ErrorContext::new_missing(
11634            "FrequencyAttrs",
11635            "MaxTxPower",
11636            self.orig_loc,
11637            self.buf.as_ptr() as usize,
11638        ))
11639    }
11640    pub fn get_dfs_state(&self) -> Result<u32, ErrorContext> {
11641        let mut iter = self.clone();
11642        iter.pos = 0;
11643        for attr in iter {
11644            if let FrequencyAttrs::DfsState(val) = attr? {
11645                return Ok(val);
11646            }
11647        }
11648        Err(ErrorContext::new_missing(
11649            "FrequencyAttrs",
11650            "DfsState",
11651            self.orig_loc,
11652            self.buf.as_ptr() as usize,
11653        ))
11654    }
11655    pub fn get_dfs_time(&self) -> Result<&'a [u8], ErrorContext> {
11656        let mut iter = self.clone();
11657        iter.pos = 0;
11658        for attr in iter {
11659            if let FrequencyAttrs::DfsTime(val) = attr? {
11660                return Ok(val);
11661            }
11662        }
11663        Err(ErrorContext::new_missing(
11664            "FrequencyAttrs",
11665            "DfsTime",
11666            self.orig_loc,
11667            self.buf.as_ptr() as usize,
11668        ))
11669    }
11670    pub fn get_no_ht40_minus(&self) -> Result<&'a [u8], ErrorContext> {
11671        let mut iter = self.clone();
11672        iter.pos = 0;
11673        for attr in iter {
11674            if let FrequencyAttrs::NoHt40Minus(val) = attr? {
11675                return Ok(val);
11676            }
11677        }
11678        Err(ErrorContext::new_missing(
11679            "FrequencyAttrs",
11680            "NoHt40Minus",
11681            self.orig_loc,
11682            self.buf.as_ptr() as usize,
11683        ))
11684    }
11685    pub fn get_no_ht40_plus(&self) -> Result<&'a [u8], ErrorContext> {
11686        let mut iter = self.clone();
11687        iter.pos = 0;
11688        for attr in iter {
11689            if let FrequencyAttrs::NoHt40Plus(val) = attr? {
11690                return Ok(val);
11691            }
11692        }
11693        Err(ErrorContext::new_missing(
11694            "FrequencyAttrs",
11695            "NoHt40Plus",
11696            self.orig_loc,
11697            self.buf.as_ptr() as usize,
11698        ))
11699    }
11700    pub fn get_no_80mhz(&self) -> Result<&'a [u8], ErrorContext> {
11701        let mut iter = self.clone();
11702        iter.pos = 0;
11703        for attr in iter {
11704            if let FrequencyAttrs::No80mhz(val) = attr? {
11705                return Ok(val);
11706            }
11707        }
11708        Err(ErrorContext::new_missing(
11709            "FrequencyAttrs",
11710            "No80mhz",
11711            self.orig_loc,
11712            self.buf.as_ptr() as usize,
11713        ))
11714    }
11715    pub fn get_no_160mhz(&self) -> Result<&'a [u8], ErrorContext> {
11716        let mut iter = self.clone();
11717        iter.pos = 0;
11718        for attr in iter {
11719            if let FrequencyAttrs::No160mhz(val) = attr? {
11720                return Ok(val);
11721            }
11722        }
11723        Err(ErrorContext::new_missing(
11724            "FrequencyAttrs",
11725            "No160mhz",
11726            self.orig_loc,
11727            self.buf.as_ptr() as usize,
11728        ))
11729    }
11730    pub fn get_dfs_cac_time(&self) -> Result<&'a [u8], ErrorContext> {
11731        let mut iter = self.clone();
11732        iter.pos = 0;
11733        for attr in iter {
11734            if let FrequencyAttrs::DfsCacTime(val) = attr? {
11735                return Ok(val);
11736            }
11737        }
11738        Err(ErrorContext::new_missing(
11739            "FrequencyAttrs",
11740            "DfsCacTime",
11741            self.orig_loc,
11742            self.buf.as_ptr() as usize,
11743        ))
11744    }
11745    pub fn get_indoor_only(&self) -> Result<&'a [u8], ErrorContext> {
11746        let mut iter = self.clone();
11747        iter.pos = 0;
11748        for attr in iter {
11749            if let FrequencyAttrs::IndoorOnly(val) = attr? {
11750                return Ok(val);
11751            }
11752        }
11753        Err(ErrorContext::new_missing(
11754            "FrequencyAttrs",
11755            "IndoorOnly",
11756            self.orig_loc,
11757            self.buf.as_ptr() as usize,
11758        ))
11759    }
11760    pub fn get_ir_concurrent(&self) -> Result<&'a [u8], ErrorContext> {
11761        let mut iter = self.clone();
11762        iter.pos = 0;
11763        for attr in iter {
11764            if let FrequencyAttrs::IrConcurrent(val) = attr? {
11765                return Ok(val);
11766            }
11767        }
11768        Err(ErrorContext::new_missing(
11769            "FrequencyAttrs",
11770            "IrConcurrent",
11771            self.orig_loc,
11772            self.buf.as_ptr() as usize,
11773        ))
11774    }
11775    pub fn get_no_20mhz(&self) -> Result<&'a [u8], ErrorContext> {
11776        let mut iter = self.clone();
11777        iter.pos = 0;
11778        for attr in iter {
11779            if let FrequencyAttrs::No20mhz(val) = attr? {
11780                return Ok(val);
11781            }
11782        }
11783        Err(ErrorContext::new_missing(
11784            "FrequencyAttrs",
11785            "No20mhz",
11786            self.orig_loc,
11787            self.buf.as_ptr() as usize,
11788        ))
11789    }
11790    pub fn get_no_10mhz(&self) -> Result<&'a [u8], ErrorContext> {
11791        let mut iter = self.clone();
11792        iter.pos = 0;
11793        for attr in iter {
11794            if let FrequencyAttrs::No10mhz(val) = attr? {
11795                return Ok(val);
11796            }
11797        }
11798        Err(ErrorContext::new_missing(
11799            "FrequencyAttrs",
11800            "No10mhz",
11801            self.orig_loc,
11802            self.buf.as_ptr() as usize,
11803        ))
11804    }
11805    pub fn get_wmm(
11806        &self,
11807    ) -> Result<ArrayIterable<IterableArrayWmmAttrs<'a>, IterableWmmAttrs<'a>>, ErrorContext> {
11808        for attr in self.clone() {
11809            if let FrequencyAttrs::Wmm(val) = attr? {
11810                return Ok(ArrayIterable::new(val));
11811            }
11812        }
11813        Err(ErrorContext::new_missing(
11814            "FrequencyAttrs",
11815            "Wmm",
11816            self.orig_loc,
11817            self.buf.as_ptr() as usize,
11818        ))
11819    }
11820    pub fn get_no_he(&self) -> Result<&'a [u8], ErrorContext> {
11821        let mut iter = self.clone();
11822        iter.pos = 0;
11823        for attr in iter {
11824            if let FrequencyAttrs::NoHe(val) = attr? {
11825                return Ok(val);
11826            }
11827        }
11828        Err(ErrorContext::new_missing(
11829            "FrequencyAttrs",
11830            "NoHe",
11831            self.orig_loc,
11832            self.buf.as_ptr() as usize,
11833        ))
11834    }
11835    pub fn get_offset(&self) -> Result<u32, ErrorContext> {
11836        let mut iter = self.clone();
11837        iter.pos = 0;
11838        for attr in iter {
11839            if let FrequencyAttrs::Offset(val) = attr? {
11840                return Ok(val);
11841            }
11842        }
11843        Err(ErrorContext::new_missing(
11844            "FrequencyAttrs",
11845            "Offset",
11846            self.orig_loc,
11847            self.buf.as_ptr() as usize,
11848        ))
11849    }
11850    pub fn get_1mhz(&self) -> Result<&'a [u8], ErrorContext> {
11851        let mut iter = self.clone();
11852        iter.pos = 0;
11853        for attr in iter {
11854            if let FrequencyAttrs::_1mhz(val) = attr? {
11855                return Ok(val);
11856            }
11857        }
11858        Err(ErrorContext::new_missing(
11859            "FrequencyAttrs",
11860            "1mhz",
11861            self.orig_loc,
11862            self.buf.as_ptr() as usize,
11863        ))
11864    }
11865    pub fn get_2mhz(&self) -> Result<&'a [u8], ErrorContext> {
11866        let mut iter = self.clone();
11867        iter.pos = 0;
11868        for attr in iter {
11869            if let FrequencyAttrs::_2mhz(val) = attr? {
11870                return Ok(val);
11871            }
11872        }
11873        Err(ErrorContext::new_missing(
11874            "FrequencyAttrs",
11875            "2mhz",
11876            self.orig_loc,
11877            self.buf.as_ptr() as usize,
11878        ))
11879    }
11880    pub fn get_4mhz(&self) -> Result<&'a [u8], ErrorContext> {
11881        let mut iter = self.clone();
11882        iter.pos = 0;
11883        for attr in iter {
11884            if let FrequencyAttrs::_4mhz(val) = attr? {
11885                return Ok(val);
11886            }
11887        }
11888        Err(ErrorContext::new_missing(
11889            "FrequencyAttrs",
11890            "4mhz",
11891            self.orig_loc,
11892            self.buf.as_ptr() as usize,
11893        ))
11894    }
11895    pub fn get_8mhz(&self) -> Result<&'a [u8], ErrorContext> {
11896        let mut iter = self.clone();
11897        iter.pos = 0;
11898        for attr in iter {
11899            if let FrequencyAttrs::_8mhz(val) = attr? {
11900                return Ok(val);
11901            }
11902        }
11903        Err(ErrorContext::new_missing(
11904            "FrequencyAttrs",
11905            "8mhz",
11906            self.orig_loc,
11907            self.buf.as_ptr() as usize,
11908        ))
11909    }
11910    pub fn get_16mhz(&self) -> Result<&'a [u8], ErrorContext> {
11911        let mut iter = self.clone();
11912        iter.pos = 0;
11913        for attr in iter {
11914            if let FrequencyAttrs::_16mhz(val) = attr? {
11915                return Ok(val);
11916            }
11917        }
11918        Err(ErrorContext::new_missing(
11919            "FrequencyAttrs",
11920            "16mhz",
11921            self.orig_loc,
11922            self.buf.as_ptr() as usize,
11923        ))
11924    }
11925    pub fn get_no_320mhz(&self) -> Result<&'a [u8], ErrorContext> {
11926        let mut iter = self.clone();
11927        iter.pos = 0;
11928        for attr in iter {
11929            if let FrequencyAttrs::No320mhz(val) = attr? {
11930                return Ok(val);
11931            }
11932        }
11933        Err(ErrorContext::new_missing(
11934            "FrequencyAttrs",
11935            "No320mhz",
11936            self.orig_loc,
11937            self.buf.as_ptr() as usize,
11938        ))
11939    }
11940    pub fn get_no_eht(&self) -> Result<&'a [u8], ErrorContext> {
11941        let mut iter = self.clone();
11942        iter.pos = 0;
11943        for attr in iter {
11944            if let FrequencyAttrs::NoEht(val) = attr? {
11945                return Ok(val);
11946            }
11947        }
11948        Err(ErrorContext::new_missing(
11949            "FrequencyAttrs",
11950            "NoEht",
11951            self.orig_loc,
11952            self.buf.as_ptr() as usize,
11953        ))
11954    }
11955    pub fn get_psd(&self) -> Result<&'a [u8], ErrorContext> {
11956        let mut iter = self.clone();
11957        iter.pos = 0;
11958        for attr in iter {
11959            if let FrequencyAttrs::Psd(val) = attr? {
11960                return Ok(val);
11961            }
11962        }
11963        Err(ErrorContext::new_missing(
11964            "FrequencyAttrs",
11965            "Psd",
11966            self.orig_loc,
11967            self.buf.as_ptr() as usize,
11968        ))
11969    }
11970    pub fn get_dfs_concurrent(&self) -> Result<&'a [u8], ErrorContext> {
11971        let mut iter = self.clone();
11972        iter.pos = 0;
11973        for attr in iter {
11974            if let FrequencyAttrs::DfsConcurrent(val) = attr? {
11975                return Ok(val);
11976            }
11977        }
11978        Err(ErrorContext::new_missing(
11979            "FrequencyAttrs",
11980            "DfsConcurrent",
11981            self.orig_loc,
11982            self.buf.as_ptr() as usize,
11983        ))
11984    }
11985    pub fn get_no_6ghz_vlp_client(&self) -> Result<&'a [u8], ErrorContext> {
11986        let mut iter = self.clone();
11987        iter.pos = 0;
11988        for attr in iter {
11989            if let FrequencyAttrs::No6ghzVlpClient(val) = attr? {
11990                return Ok(val);
11991            }
11992        }
11993        Err(ErrorContext::new_missing(
11994            "FrequencyAttrs",
11995            "No6ghzVlpClient",
11996            self.orig_loc,
11997            self.buf.as_ptr() as usize,
11998        ))
11999    }
12000    pub fn get_no_6ghz_afc_client(&self) -> Result<&'a [u8], ErrorContext> {
12001        let mut iter = self.clone();
12002        iter.pos = 0;
12003        for attr in iter {
12004            if let FrequencyAttrs::No6ghzAfcClient(val) = attr? {
12005                return Ok(val);
12006            }
12007        }
12008        Err(ErrorContext::new_missing(
12009            "FrequencyAttrs",
12010            "No6ghzAfcClient",
12011            self.orig_loc,
12012            self.buf.as_ptr() as usize,
12013        ))
12014    }
12015    pub fn get_can_monitor(&self) -> Result<&'a [u8], ErrorContext> {
12016        let mut iter = self.clone();
12017        iter.pos = 0;
12018        for attr in iter {
12019            if let FrequencyAttrs::CanMonitor(val) = attr? {
12020                return Ok(val);
12021            }
12022        }
12023        Err(ErrorContext::new_missing(
12024            "FrequencyAttrs",
12025            "CanMonitor",
12026            self.orig_loc,
12027            self.buf.as_ptr() as usize,
12028        ))
12029    }
12030    pub fn get_allow_6ghz_vlp_ap(&self) -> Result<&'a [u8], ErrorContext> {
12031        let mut iter = self.clone();
12032        iter.pos = 0;
12033        for attr in iter {
12034            if let FrequencyAttrs::Allow6ghzVlpAp(val) = attr? {
12035                return Ok(val);
12036            }
12037        }
12038        Err(ErrorContext::new_missing(
12039            "FrequencyAttrs",
12040            "Allow6ghzVlpAp",
12041            self.orig_loc,
12042            self.buf.as_ptr() as usize,
12043        ))
12044    }
12045}
12046impl WmmAttrs {
12047    pub fn new_array(buf: &[u8]) -> IterableArrayWmmAttrs<'_> {
12048        IterableArrayWmmAttrs::with_loc(buf, buf.as_ptr() as usize)
12049    }
12050}
12051#[derive(Clone, Copy, Default)]
12052pub struct IterableArrayWmmAttrs<'a> {
12053    buf: &'a [u8],
12054    pos: usize,
12055    orig_loc: usize,
12056}
12057impl<'a> IterableArrayWmmAttrs<'a> {
12058    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12059        Self {
12060            buf,
12061            pos: 0,
12062            orig_loc,
12063        }
12064    }
12065    pub fn get_buf(&self) -> &'a [u8] {
12066        self.buf
12067    }
12068}
12069impl<'a> Iterator for IterableArrayWmmAttrs<'a> {
12070    type Item = Result<IterableWmmAttrs<'a>, ErrorContext>;
12071    fn next(&mut self) -> Option<Self::Item> {
12072        if self.buf.len() == self.pos {
12073            return None;
12074        }
12075        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
12076            {
12077                return Some(Ok(IterableWmmAttrs::with_loc(next, self.orig_loc)));
12078            }
12079        }
12080        Some(Err(ErrorContext::new(
12081            "WmmAttrs",
12082            None,
12083            self.orig_loc,
12084            self.buf.as_ptr().wrapping_add(self.pos) as usize,
12085        )))
12086    }
12087}
12088impl FrequencyAttrs<'_> {
12089    pub fn new<'a>(buf: &'a [u8]) -> IterableFrequencyAttrs<'a> {
12090        IterableFrequencyAttrs::with_loc(buf, buf.as_ptr() as usize)
12091    }
12092    fn attr_from_type(r#type: u16) -> Option<&'static str> {
12093        let res = match r#type {
12094            1u16 => "Freq",
12095            2u16 => "Disabled",
12096            3u16 => "NoIr",
12097            4u16 => "NoIbss",
12098            5u16 => "Radar",
12099            6u16 => "MaxTxPower",
12100            7u16 => "DfsState",
12101            8u16 => "DfsTime",
12102            9u16 => "NoHt40Minus",
12103            10u16 => "NoHt40Plus",
12104            11u16 => "No80mhz",
12105            12u16 => "No160mhz",
12106            13u16 => "DfsCacTime",
12107            14u16 => "IndoorOnly",
12108            15u16 => "IrConcurrent",
12109            16u16 => "No20mhz",
12110            17u16 => "No10mhz",
12111            18u16 => "Wmm",
12112            19u16 => "NoHe",
12113            20u16 => "Offset",
12114            21u16 => "1mhz",
12115            22u16 => "2mhz",
12116            23u16 => "4mhz",
12117            24u16 => "8mhz",
12118            25u16 => "16mhz",
12119            26u16 => "No320mhz",
12120            27u16 => "NoEht",
12121            28u16 => "Psd",
12122            29u16 => "DfsConcurrent",
12123            30u16 => "No6ghzVlpClient",
12124            31u16 => "No6ghzAfcClient",
12125            32u16 => "CanMonitor",
12126            33u16 => "Allow6ghzVlpAp",
12127            _ => return None,
12128        };
12129        Some(res)
12130    }
12131}
12132#[derive(Clone, Copy, Default)]
12133pub struct IterableFrequencyAttrs<'a> {
12134    buf: &'a [u8],
12135    pos: usize,
12136    orig_loc: usize,
12137}
12138impl<'a> IterableFrequencyAttrs<'a> {
12139    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12140        Self {
12141            buf,
12142            pos: 0,
12143            orig_loc,
12144        }
12145    }
12146    pub fn get_buf(&self) -> &'a [u8] {
12147        self.buf
12148    }
12149}
12150impl<'a> Iterator for IterableFrequencyAttrs<'a> {
12151    type Item = Result<FrequencyAttrs<'a>, ErrorContext>;
12152    fn next(&mut self) -> Option<Self::Item> {
12153        let pos = self.pos;
12154        let mut r#type;
12155        loop {
12156            r#type = None;
12157            if self.buf.len() == self.pos {
12158                return None;
12159            }
12160            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
12161                break;
12162            };
12163            r#type = Some(header.r#type);
12164            let res = match header.r#type {
12165                1u16 => FrequencyAttrs::Freq({
12166                    let res = parse_u32(next);
12167                    let Some(val) = res else { break };
12168                    val
12169                }),
12170                2u16 => FrequencyAttrs::Disabled(()),
12171                3u16 => FrequencyAttrs::NoIr(()),
12172                4u16 => FrequencyAttrs::NoIbss(()),
12173                5u16 => FrequencyAttrs::Radar(()),
12174                6u16 => FrequencyAttrs::MaxTxPower({
12175                    let res = parse_u32(next);
12176                    let Some(val) = res else { break };
12177                    val
12178                }),
12179                7u16 => FrequencyAttrs::DfsState({
12180                    let res = parse_u32(next);
12181                    let Some(val) = res else { break };
12182                    val
12183                }),
12184                8u16 => FrequencyAttrs::DfsTime({
12185                    let res = Some(next);
12186                    let Some(val) = res else { break };
12187                    val
12188                }),
12189                9u16 => FrequencyAttrs::NoHt40Minus({
12190                    let res = Some(next);
12191                    let Some(val) = res else { break };
12192                    val
12193                }),
12194                10u16 => FrequencyAttrs::NoHt40Plus({
12195                    let res = Some(next);
12196                    let Some(val) = res else { break };
12197                    val
12198                }),
12199                11u16 => FrequencyAttrs::No80mhz({
12200                    let res = Some(next);
12201                    let Some(val) = res else { break };
12202                    val
12203                }),
12204                12u16 => FrequencyAttrs::No160mhz({
12205                    let res = Some(next);
12206                    let Some(val) = res else { break };
12207                    val
12208                }),
12209                13u16 => FrequencyAttrs::DfsCacTime({
12210                    let res = Some(next);
12211                    let Some(val) = res else { break };
12212                    val
12213                }),
12214                14u16 => FrequencyAttrs::IndoorOnly({
12215                    let res = Some(next);
12216                    let Some(val) = res else { break };
12217                    val
12218                }),
12219                15u16 => FrequencyAttrs::IrConcurrent({
12220                    let res = Some(next);
12221                    let Some(val) = res else { break };
12222                    val
12223                }),
12224                16u16 => FrequencyAttrs::No20mhz({
12225                    let res = Some(next);
12226                    let Some(val) = res else { break };
12227                    val
12228                }),
12229                17u16 => FrequencyAttrs::No10mhz({
12230                    let res = Some(next);
12231                    let Some(val) = res else { break };
12232                    val
12233                }),
12234                18u16 => FrequencyAttrs::Wmm({
12235                    let res = Some(IterableArrayWmmAttrs::with_loc(next, self.orig_loc));
12236                    let Some(val) = res else { break };
12237                    val
12238                }),
12239                19u16 => FrequencyAttrs::NoHe({
12240                    let res = Some(next);
12241                    let Some(val) = res else { break };
12242                    val
12243                }),
12244                20u16 => FrequencyAttrs::Offset({
12245                    let res = parse_u32(next);
12246                    let Some(val) = res else { break };
12247                    val
12248                }),
12249                21u16 => FrequencyAttrs::_1mhz({
12250                    let res = Some(next);
12251                    let Some(val) = res else { break };
12252                    val
12253                }),
12254                22u16 => FrequencyAttrs::_2mhz({
12255                    let res = Some(next);
12256                    let Some(val) = res else { break };
12257                    val
12258                }),
12259                23u16 => FrequencyAttrs::_4mhz({
12260                    let res = Some(next);
12261                    let Some(val) = res else { break };
12262                    val
12263                }),
12264                24u16 => FrequencyAttrs::_8mhz({
12265                    let res = Some(next);
12266                    let Some(val) = res else { break };
12267                    val
12268                }),
12269                25u16 => FrequencyAttrs::_16mhz({
12270                    let res = Some(next);
12271                    let Some(val) = res else { break };
12272                    val
12273                }),
12274                26u16 => FrequencyAttrs::No320mhz({
12275                    let res = Some(next);
12276                    let Some(val) = res else { break };
12277                    val
12278                }),
12279                27u16 => FrequencyAttrs::NoEht({
12280                    let res = Some(next);
12281                    let Some(val) = res else { break };
12282                    val
12283                }),
12284                28u16 => FrequencyAttrs::Psd({
12285                    let res = Some(next);
12286                    let Some(val) = res else { break };
12287                    val
12288                }),
12289                29u16 => FrequencyAttrs::DfsConcurrent({
12290                    let res = Some(next);
12291                    let Some(val) = res else { break };
12292                    val
12293                }),
12294                30u16 => FrequencyAttrs::No6ghzVlpClient({
12295                    let res = Some(next);
12296                    let Some(val) = res else { break };
12297                    val
12298                }),
12299                31u16 => FrequencyAttrs::No6ghzAfcClient({
12300                    let res = Some(next);
12301                    let Some(val) = res else { break };
12302                    val
12303                }),
12304                32u16 => FrequencyAttrs::CanMonitor({
12305                    let res = Some(next);
12306                    let Some(val) = res else { break };
12307                    val
12308                }),
12309                33u16 => FrequencyAttrs::Allow6ghzVlpAp({
12310                    let res = Some(next);
12311                    let Some(val) = res else { break };
12312                    val
12313                }),
12314                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
12315                n => continue,
12316            };
12317            return Some(Ok(res));
12318        }
12319        Some(Err(ErrorContext::new(
12320            "FrequencyAttrs",
12321            r#type.and_then(|t| FrequencyAttrs::attr_from_type(t)),
12322            self.orig_loc,
12323            self.buf.as_ptr().wrapping_add(pos) as usize,
12324        )))
12325    }
12326}
12327impl std::fmt::Debug for IterableArrayWmmAttrs<'_> {
12328    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12329        fmt.debug_list()
12330            .entries(self.clone().map(FlattenErrorContext))
12331            .finish()
12332    }
12333}
12334impl<'a> std::fmt::Debug for IterableFrequencyAttrs<'_> {
12335    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12336        let mut fmt = f.debug_struct("FrequencyAttrs");
12337        for attr in self.clone() {
12338            let attr = match attr {
12339                Ok(a) => a,
12340                Err(err) => {
12341                    fmt.finish()?;
12342                    f.write_str("Err(")?;
12343                    err.fmt(f)?;
12344                    return f.write_str(")");
12345                }
12346            };
12347            match attr {
12348                FrequencyAttrs::Freq(val) => fmt.field("Freq", &val),
12349                FrequencyAttrs::Disabled(val) => fmt.field("Disabled", &val),
12350                FrequencyAttrs::NoIr(val) => fmt.field("NoIr", &val),
12351                FrequencyAttrs::NoIbss(val) => fmt.field("NoIbss", &val),
12352                FrequencyAttrs::Radar(val) => fmt.field("Radar", &val),
12353                FrequencyAttrs::MaxTxPower(val) => fmt.field("MaxTxPower", &val),
12354                FrequencyAttrs::DfsState(val) => fmt.field("DfsState", &val),
12355                FrequencyAttrs::DfsTime(val) => fmt.field("DfsTime", &val),
12356                FrequencyAttrs::NoHt40Minus(val) => fmt.field("NoHt40Minus", &val),
12357                FrequencyAttrs::NoHt40Plus(val) => fmt.field("NoHt40Plus", &val),
12358                FrequencyAttrs::No80mhz(val) => fmt.field("No80mhz", &val),
12359                FrequencyAttrs::No160mhz(val) => fmt.field("No160mhz", &val),
12360                FrequencyAttrs::DfsCacTime(val) => fmt.field("DfsCacTime", &val),
12361                FrequencyAttrs::IndoorOnly(val) => fmt.field("IndoorOnly", &val),
12362                FrequencyAttrs::IrConcurrent(val) => fmt.field("IrConcurrent", &val),
12363                FrequencyAttrs::No20mhz(val) => fmt.field("No20mhz", &val),
12364                FrequencyAttrs::No10mhz(val) => fmt.field("No10mhz", &val),
12365                FrequencyAttrs::Wmm(val) => fmt.field("Wmm", &val),
12366                FrequencyAttrs::NoHe(val) => fmt.field("NoHe", &val),
12367                FrequencyAttrs::Offset(val) => fmt.field("Offset", &val),
12368                FrequencyAttrs::_1mhz(val) => fmt.field("_1mhz", &val),
12369                FrequencyAttrs::_2mhz(val) => fmt.field("_2mhz", &val),
12370                FrequencyAttrs::_4mhz(val) => fmt.field("_4mhz", &val),
12371                FrequencyAttrs::_8mhz(val) => fmt.field("_8mhz", &val),
12372                FrequencyAttrs::_16mhz(val) => fmt.field("_16mhz", &val),
12373                FrequencyAttrs::No320mhz(val) => fmt.field("No320mhz", &val),
12374                FrequencyAttrs::NoEht(val) => fmt.field("NoEht", &val),
12375                FrequencyAttrs::Psd(val) => fmt.field("Psd", &val),
12376                FrequencyAttrs::DfsConcurrent(val) => fmt.field("DfsConcurrent", &val),
12377                FrequencyAttrs::No6ghzVlpClient(val) => fmt.field("No6ghzVlpClient", &val),
12378                FrequencyAttrs::No6ghzAfcClient(val) => fmt.field("No6ghzAfcClient", &val),
12379                FrequencyAttrs::CanMonitor(val) => fmt.field("CanMonitor", &val),
12380                FrequencyAttrs::Allow6ghzVlpAp(val) => fmt.field("Allow6ghzVlpAp", &val),
12381            };
12382        }
12383        fmt.finish()
12384    }
12385}
12386impl IterableFrequencyAttrs<'_> {
12387    pub fn lookup_attr(
12388        &self,
12389        offset: usize,
12390        missing_type: Option<u16>,
12391    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
12392        let mut stack = Vec::new();
12393        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
12394        if missing_type.is_some() && cur == offset {
12395            stack.push(("FrequencyAttrs", offset));
12396            return (
12397                stack,
12398                missing_type.and_then(|t| FrequencyAttrs::attr_from_type(t)),
12399            );
12400        }
12401        if cur > offset || cur + self.buf.len() < offset {
12402            return (stack, None);
12403        }
12404        let mut attrs = self.clone();
12405        let mut last_off = cur + attrs.pos;
12406        let mut missing = None;
12407        while let Some(attr) = attrs.next() {
12408            let Ok(attr) = attr else { break };
12409            match attr {
12410                FrequencyAttrs::Freq(val) => {
12411                    if last_off == offset {
12412                        stack.push(("Freq", last_off));
12413                        break;
12414                    }
12415                }
12416                FrequencyAttrs::Disabled(val) => {
12417                    if last_off == offset {
12418                        stack.push(("Disabled", last_off));
12419                        break;
12420                    }
12421                }
12422                FrequencyAttrs::NoIr(val) => {
12423                    if last_off == offset {
12424                        stack.push(("NoIr", last_off));
12425                        break;
12426                    }
12427                }
12428                FrequencyAttrs::NoIbss(val) => {
12429                    if last_off == offset {
12430                        stack.push(("NoIbss", last_off));
12431                        break;
12432                    }
12433                }
12434                FrequencyAttrs::Radar(val) => {
12435                    if last_off == offset {
12436                        stack.push(("Radar", last_off));
12437                        break;
12438                    }
12439                }
12440                FrequencyAttrs::MaxTxPower(val) => {
12441                    if last_off == offset {
12442                        stack.push(("MaxTxPower", last_off));
12443                        break;
12444                    }
12445                }
12446                FrequencyAttrs::DfsState(val) => {
12447                    if last_off == offset {
12448                        stack.push(("DfsState", last_off));
12449                        break;
12450                    }
12451                }
12452                FrequencyAttrs::DfsTime(val) => {
12453                    if last_off == offset {
12454                        stack.push(("DfsTime", last_off));
12455                        break;
12456                    }
12457                }
12458                FrequencyAttrs::NoHt40Minus(val) => {
12459                    if last_off == offset {
12460                        stack.push(("NoHt40Minus", last_off));
12461                        break;
12462                    }
12463                }
12464                FrequencyAttrs::NoHt40Plus(val) => {
12465                    if last_off == offset {
12466                        stack.push(("NoHt40Plus", last_off));
12467                        break;
12468                    }
12469                }
12470                FrequencyAttrs::No80mhz(val) => {
12471                    if last_off == offset {
12472                        stack.push(("No80mhz", last_off));
12473                        break;
12474                    }
12475                }
12476                FrequencyAttrs::No160mhz(val) => {
12477                    if last_off == offset {
12478                        stack.push(("No160mhz", last_off));
12479                        break;
12480                    }
12481                }
12482                FrequencyAttrs::DfsCacTime(val) => {
12483                    if last_off == offset {
12484                        stack.push(("DfsCacTime", last_off));
12485                        break;
12486                    }
12487                }
12488                FrequencyAttrs::IndoorOnly(val) => {
12489                    if last_off == offset {
12490                        stack.push(("IndoorOnly", last_off));
12491                        break;
12492                    }
12493                }
12494                FrequencyAttrs::IrConcurrent(val) => {
12495                    if last_off == offset {
12496                        stack.push(("IrConcurrent", last_off));
12497                        break;
12498                    }
12499                }
12500                FrequencyAttrs::No20mhz(val) => {
12501                    if last_off == offset {
12502                        stack.push(("No20mhz", last_off));
12503                        break;
12504                    }
12505                }
12506                FrequencyAttrs::No10mhz(val) => {
12507                    if last_off == offset {
12508                        stack.push(("No10mhz", last_off));
12509                        break;
12510                    }
12511                }
12512                FrequencyAttrs::Wmm(val) => {
12513                    for entry in val {
12514                        let Ok(attr) = entry else { break };
12515                        (stack, missing) = attr.lookup_attr(offset, missing_type);
12516                        if !stack.is_empty() {
12517                            break;
12518                        }
12519                    }
12520                    if !stack.is_empty() {
12521                        stack.push(("Wmm", last_off));
12522                        break;
12523                    }
12524                }
12525                FrequencyAttrs::NoHe(val) => {
12526                    if last_off == offset {
12527                        stack.push(("NoHe", last_off));
12528                        break;
12529                    }
12530                }
12531                FrequencyAttrs::Offset(val) => {
12532                    if last_off == offset {
12533                        stack.push(("Offset", last_off));
12534                        break;
12535                    }
12536                }
12537                FrequencyAttrs::_1mhz(val) => {
12538                    if last_off == offset {
12539                        stack.push(("1mhz", last_off));
12540                        break;
12541                    }
12542                }
12543                FrequencyAttrs::_2mhz(val) => {
12544                    if last_off == offset {
12545                        stack.push(("2mhz", last_off));
12546                        break;
12547                    }
12548                }
12549                FrequencyAttrs::_4mhz(val) => {
12550                    if last_off == offset {
12551                        stack.push(("4mhz", last_off));
12552                        break;
12553                    }
12554                }
12555                FrequencyAttrs::_8mhz(val) => {
12556                    if last_off == offset {
12557                        stack.push(("8mhz", last_off));
12558                        break;
12559                    }
12560                }
12561                FrequencyAttrs::_16mhz(val) => {
12562                    if last_off == offset {
12563                        stack.push(("16mhz", last_off));
12564                        break;
12565                    }
12566                }
12567                FrequencyAttrs::No320mhz(val) => {
12568                    if last_off == offset {
12569                        stack.push(("No320mhz", last_off));
12570                        break;
12571                    }
12572                }
12573                FrequencyAttrs::NoEht(val) => {
12574                    if last_off == offset {
12575                        stack.push(("NoEht", last_off));
12576                        break;
12577                    }
12578                }
12579                FrequencyAttrs::Psd(val) => {
12580                    if last_off == offset {
12581                        stack.push(("Psd", last_off));
12582                        break;
12583                    }
12584                }
12585                FrequencyAttrs::DfsConcurrent(val) => {
12586                    if last_off == offset {
12587                        stack.push(("DfsConcurrent", last_off));
12588                        break;
12589                    }
12590                }
12591                FrequencyAttrs::No6ghzVlpClient(val) => {
12592                    if last_off == offset {
12593                        stack.push(("No6ghzVlpClient", last_off));
12594                        break;
12595                    }
12596                }
12597                FrequencyAttrs::No6ghzAfcClient(val) => {
12598                    if last_off == offset {
12599                        stack.push(("No6ghzAfcClient", last_off));
12600                        break;
12601                    }
12602                }
12603                FrequencyAttrs::CanMonitor(val) => {
12604                    if last_off == offset {
12605                        stack.push(("CanMonitor", last_off));
12606                        break;
12607                    }
12608                }
12609                FrequencyAttrs::Allow6ghzVlpAp(val) => {
12610                    if last_off == offset {
12611                        stack.push(("Allow6ghzVlpAp", last_off));
12612                        break;
12613                    }
12614                }
12615                _ => {}
12616            };
12617            last_off = cur + attrs.pos;
12618        }
12619        if !stack.is_empty() {
12620            stack.push(("FrequencyAttrs", cur));
12621        }
12622        (stack, missing)
12623    }
12624}
12625#[derive(Clone)]
12626pub enum IfCombinationAttributes<'a> {
12627    Limits(IterableArrayIfaceLimitAttributes<'a>),
12628    Maxnum(u32),
12629    StaApBiMatch(()),
12630    NumChannels(u32),
12631    RadarDetectWidths(u32),
12632    RadarDetectRegions(u32),
12633    BiMinGcd(u32),
12634}
12635impl<'a> IterableIfCombinationAttributes<'a> {
12636    pub fn get_limits(
12637        &self,
12638    ) -> Result<
12639        ArrayIterable<IterableArrayIfaceLimitAttributes<'a>, IterableIfaceLimitAttributes<'a>>,
12640        ErrorContext,
12641    > {
12642        for attr in self.clone() {
12643            if let IfCombinationAttributes::Limits(val) = attr? {
12644                return Ok(ArrayIterable::new(val));
12645            }
12646        }
12647        Err(ErrorContext::new_missing(
12648            "IfCombinationAttributes",
12649            "Limits",
12650            self.orig_loc,
12651            self.buf.as_ptr() as usize,
12652        ))
12653    }
12654    pub fn get_maxnum(&self) -> Result<u32, ErrorContext> {
12655        let mut iter = self.clone();
12656        iter.pos = 0;
12657        for attr in iter {
12658            if let IfCombinationAttributes::Maxnum(val) = attr? {
12659                return Ok(val);
12660            }
12661        }
12662        Err(ErrorContext::new_missing(
12663            "IfCombinationAttributes",
12664            "Maxnum",
12665            self.orig_loc,
12666            self.buf.as_ptr() as usize,
12667        ))
12668    }
12669    pub fn get_sta_ap_bi_match(&self) -> Result<(), ErrorContext> {
12670        let mut iter = self.clone();
12671        iter.pos = 0;
12672        for attr in iter {
12673            if let IfCombinationAttributes::StaApBiMatch(val) = attr? {
12674                return Ok(val);
12675            }
12676        }
12677        Err(ErrorContext::new_missing(
12678            "IfCombinationAttributes",
12679            "StaApBiMatch",
12680            self.orig_loc,
12681            self.buf.as_ptr() as usize,
12682        ))
12683    }
12684    pub fn get_num_channels(&self) -> Result<u32, ErrorContext> {
12685        let mut iter = self.clone();
12686        iter.pos = 0;
12687        for attr in iter {
12688            if let IfCombinationAttributes::NumChannels(val) = attr? {
12689                return Ok(val);
12690            }
12691        }
12692        Err(ErrorContext::new_missing(
12693            "IfCombinationAttributes",
12694            "NumChannels",
12695            self.orig_loc,
12696            self.buf.as_ptr() as usize,
12697        ))
12698    }
12699    pub fn get_radar_detect_widths(&self) -> Result<u32, ErrorContext> {
12700        let mut iter = self.clone();
12701        iter.pos = 0;
12702        for attr in iter {
12703            if let IfCombinationAttributes::RadarDetectWidths(val) = attr? {
12704                return Ok(val);
12705            }
12706        }
12707        Err(ErrorContext::new_missing(
12708            "IfCombinationAttributes",
12709            "RadarDetectWidths",
12710            self.orig_loc,
12711            self.buf.as_ptr() as usize,
12712        ))
12713    }
12714    pub fn get_radar_detect_regions(&self) -> Result<u32, ErrorContext> {
12715        let mut iter = self.clone();
12716        iter.pos = 0;
12717        for attr in iter {
12718            if let IfCombinationAttributes::RadarDetectRegions(val) = attr? {
12719                return Ok(val);
12720            }
12721        }
12722        Err(ErrorContext::new_missing(
12723            "IfCombinationAttributes",
12724            "RadarDetectRegions",
12725            self.orig_loc,
12726            self.buf.as_ptr() as usize,
12727        ))
12728    }
12729    pub fn get_bi_min_gcd(&self) -> Result<u32, ErrorContext> {
12730        let mut iter = self.clone();
12731        iter.pos = 0;
12732        for attr in iter {
12733            if let IfCombinationAttributes::BiMinGcd(val) = attr? {
12734                return Ok(val);
12735            }
12736        }
12737        Err(ErrorContext::new_missing(
12738            "IfCombinationAttributes",
12739            "BiMinGcd",
12740            self.orig_loc,
12741            self.buf.as_ptr() as usize,
12742        ))
12743    }
12744}
12745impl<'a> IfaceLimitAttributes<'a> {
12746    pub fn new_array(buf: &[u8]) -> IterableArrayIfaceLimitAttributes<'_> {
12747        IterableArrayIfaceLimitAttributes::with_loc(buf, buf.as_ptr() as usize)
12748    }
12749}
12750#[derive(Clone, Copy, Default)]
12751pub struct IterableArrayIfaceLimitAttributes<'a> {
12752    buf: &'a [u8],
12753    pos: usize,
12754    orig_loc: usize,
12755}
12756impl<'a> IterableArrayIfaceLimitAttributes<'a> {
12757    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12758        Self {
12759            buf,
12760            pos: 0,
12761            orig_loc,
12762        }
12763    }
12764    pub fn get_buf(&self) -> &'a [u8] {
12765        self.buf
12766    }
12767}
12768impl<'a> Iterator for IterableArrayIfaceLimitAttributes<'a> {
12769    type Item = Result<IterableIfaceLimitAttributes<'a>, ErrorContext>;
12770    fn next(&mut self) -> Option<Self::Item> {
12771        if self.buf.len() == self.pos {
12772            return None;
12773        }
12774        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
12775            {
12776                return Some(Ok(IterableIfaceLimitAttributes::with_loc(
12777                    next,
12778                    self.orig_loc,
12779                )));
12780            }
12781        }
12782        Some(Err(ErrorContext::new(
12783            "IfaceLimitAttributes",
12784            None,
12785            self.orig_loc,
12786            self.buf.as_ptr().wrapping_add(self.pos) as usize,
12787        )))
12788    }
12789}
12790impl IfCombinationAttributes<'_> {
12791    pub fn new<'a>(buf: &'a [u8]) -> IterableIfCombinationAttributes<'a> {
12792        IterableIfCombinationAttributes::with_loc(buf, buf.as_ptr() as usize)
12793    }
12794    fn attr_from_type(r#type: u16) -> Option<&'static str> {
12795        let res = match r#type {
12796            1u16 => "Limits",
12797            2u16 => "Maxnum",
12798            3u16 => "StaApBiMatch",
12799            4u16 => "NumChannels",
12800            5u16 => "RadarDetectWidths",
12801            6u16 => "RadarDetectRegions",
12802            7u16 => "BiMinGcd",
12803            _ => return None,
12804        };
12805        Some(res)
12806    }
12807}
12808#[derive(Clone, Copy, Default)]
12809pub struct IterableIfCombinationAttributes<'a> {
12810    buf: &'a [u8],
12811    pos: usize,
12812    orig_loc: usize,
12813}
12814impl<'a> IterableIfCombinationAttributes<'a> {
12815    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12816        Self {
12817            buf,
12818            pos: 0,
12819            orig_loc,
12820        }
12821    }
12822    pub fn get_buf(&self) -> &'a [u8] {
12823        self.buf
12824    }
12825}
12826impl<'a> Iterator for IterableIfCombinationAttributes<'a> {
12827    type Item = Result<IfCombinationAttributes<'a>, ErrorContext>;
12828    fn next(&mut self) -> Option<Self::Item> {
12829        let pos = self.pos;
12830        let mut r#type;
12831        loop {
12832            r#type = None;
12833            if self.buf.len() == self.pos {
12834                return None;
12835            }
12836            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
12837                break;
12838            };
12839            r#type = Some(header.r#type);
12840            let res = match header.r#type {
12841                1u16 => IfCombinationAttributes::Limits({
12842                    let res = Some(IterableArrayIfaceLimitAttributes::with_loc(
12843                        next,
12844                        self.orig_loc,
12845                    ));
12846                    let Some(val) = res else { break };
12847                    val
12848                }),
12849                2u16 => IfCombinationAttributes::Maxnum({
12850                    let res = parse_u32(next);
12851                    let Some(val) = res else { break };
12852                    val
12853                }),
12854                3u16 => IfCombinationAttributes::StaApBiMatch(()),
12855                4u16 => IfCombinationAttributes::NumChannels({
12856                    let res = parse_u32(next);
12857                    let Some(val) = res else { break };
12858                    val
12859                }),
12860                5u16 => IfCombinationAttributes::RadarDetectWidths({
12861                    let res = parse_u32(next);
12862                    let Some(val) = res else { break };
12863                    val
12864                }),
12865                6u16 => IfCombinationAttributes::RadarDetectRegions({
12866                    let res = parse_u32(next);
12867                    let Some(val) = res else { break };
12868                    val
12869                }),
12870                7u16 => IfCombinationAttributes::BiMinGcd({
12871                    let res = parse_u32(next);
12872                    let Some(val) = res else { break };
12873                    val
12874                }),
12875                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
12876                n => continue,
12877            };
12878            return Some(Ok(res));
12879        }
12880        Some(Err(ErrorContext::new(
12881            "IfCombinationAttributes",
12882            r#type.and_then(|t| IfCombinationAttributes::attr_from_type(t)),
12883            self.orig_loc,
12884            self.buf.as_ptr().wrapping_add(pos) as usize,
12885        )))
12886    }
12887}
12888impl std::fmt::Debug for IterableArrayIfaceLimitAttributes<'_> {
12889    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12890        fmt.debug_list()
12891            .entries(self.clone().map(FlattenErrorContext))
12892            .finish()
12893    }
12894}
12895impl<'a> std::fmt::Debug for IterableIfCombinationAttributes<'_> {
12896    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12897        let mut fmt = f.debug_struct("IfCombinationAttributes");
12898        for attr in self.clone() {
12899            let attr = match attr {
12900                Ok(a) => a,
12901                Err(err) => {
12902                    fmt.finish()?;
12903                    f.write_str("Err(")?;
12904                    err.fmt(f)?;
12905                    return f.write_str(")");
12906                }
12907            };
12908            match attr {
12909                IfCombinationAttributes::Limits(val) => fmt.field("Limits", &val),
12910                IfCombinationAttributes::Maxnum(val) => fmt.field("Maxnum", &val),
12911                IfCombinationAttributes::StaApBiMatch(val) => fmt.field("StaApBiMatch", &val),
12912                IfCombinationAttributes::NumChannels(val) => fmt.field("NumChannels", &val),
12913                IfCombinationAttributes::RadarDetectWidths(val) => {
12914                    fmt.field("RadarDetectWidths", &val)
12915                }
12916                IfCombinationAttributes::RadarDetectRegions(val) => {
12917                    fmt.field("RadarDetectRegions", &val)
12918                }
12919                IfCombinationAttributes::BiMinGcd(val) => fmt.field("BiMinGcd", &val),
12920            };
12921        }
12922        fmt.finish()
12923    }
12924}
12925impl IterableIfCombinationAttributes<'_> {
12926    pub fn lookup_attr(
12927        &self,
12928        offset: usize,
12929        missing_type: Option<u16>,
12930    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
12931        let mut stack = Vec::new();
12932        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
12933        if missing_type.is_some() && cur == offset {
12934            stack.push(("IfCombinationAttributes", offset));
12935            return (
12936                stack,
12937                missing_type.and_then(|t| IfCombinationAttributes::attr_from_type(t)),
12938            );
12939        }
12940        if cur > offset || cur + self.buf.len() < offset {
12941            return (stack, None);
12942        }
12943        let mut attrs = self.clone();
12944        let mut last_off = cur + attrs.pos;
12945        let mut missing = None;
12946        while let Some(attr) = attrs.next() {
12947            let Ok(attr) = attr else { break };
12948            match attr {
12949                IfCombinationAttributes::Limits(val) => {
12950                    for entry in val {
12951                        let Ok(attr) = entry else { break };
12952                        (stack, missing) = attr.lookup_attr(offset, missing_type);
12953                        if !stack.is_empty() {
12954                            break;
12955                        }
12956                    }
12957                    if !stack.is_empty() {
12958                        stack.push(("Limits", last_off));
12959                        break;
12960                    }
12961                }
12962                IfCombinationAttributes::Maxnum(val) => {
12963                    if last_off == offset {
12964                        stack.push(("Maxnum", last_off));
12965                        break;
12966                    }
12967                }
12968                IfCombinationAttributes::StaApBiMatch(val) => {
12969                    if last_off == offset {
12970                        stack.push(("StaApBiMatch", last_off));
12971                        break;
12972                    }
12973                }
12974                IfCombinationAttributes::NumChannels(val) => {
12975                    if last_off == offset {
12976                        stack.push(("NumChannels", last_off));
12977                        break;
12978                    }
12979                }
12980                IfCombinationAttributes::RadarDetectWidths(val) => {
12981                    if last_off == offset {
12982                        stack.push(("RadarDetectWidths", last_off));
12983                        break;
12984                    }
12985                }
12986                IfCombinationAttributes::RadarDetectRegions(val) => {
12987                    if last_off == offset {
12988                        stack.push(("RadarDetectRegions", last_off));
12989                        break;
12990                    }
12991                }
12992                IfCombinationAttributes::BiMinGcd(val) => {
12993                    if last_off == offset {
12994                        stack.push(("BiMinGcd", last_off));
12995                        break;
12996                    }
12997                }
12998                _ => {}
12999            };
13000            last_off = cur + attrs.pos;
13001        }
13002        if !stack.is_empty() {
13003            stack.push(("IfCombinationAttributes", cur));
13004        }
13005        (stack, missing)
13006    }
13007}
13008#[derive(Clone)]
13009pub enum IfaceLimitAttributes<'a> {
13010    Max(u32),
13011    Types(IterableSupportedIftypes<'a>),
13012}
13013impl<'a> IterableIfaceLimitAttributes<'a> {
13014    pub fn get_max(&self) -> Result<u32, ErrorContext> {
13015        let mut iter = self.clone();
13016        iter.pos = 0;
13017        for attr in iter {
13018            if let IfaceLimitAttributes::Max(val) = attr? {
13019                return Ok(val);
13020            }
13021        }
13022        Err(ErrorContext::new_missing(
13023            "IfaceLimitAttributes",
13024            "Max",
13025            self.orig_loc,
13026            self.buf.as_ptr() as usize,
13027        ))
13028    }
13029    pub fn get_types(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
13030        let mut iter = self.clone();
13031        iter.pos = 0;
13032        for attr in iter {
13033            if let IfaceLimitAttributes::Types(val) = attr? {
13034                return Ok(val);
13035            }
13036        }
13037        Err(ErrorContext::new_missing(
13038            "IfaceLimitAttributes",
13039            "Types",
13040            self.orig_loc,
13041            self.buf.as_ptr() as usize,
13042        ))
13043    }
13044}
13045impl IfaceLimitAttributes<'_> {
13046    pub fn new<'a>(buf: &'a [u8]) -> IterableIfaceLimitAttributes<'a> {
13047        IterableIfaceLimitAttributes::with_loc(buf, buf.as_ptr() as usize)
13048    }
13049    fn attr_from_type(r#type: u16) -> Option<&'static str> {
13050        let res = match r#type {
13051            1u16 => "Max",
13052            2u16 => "Types",
13053            _ => return None,
13054        };
13055        Some(res)
13056    }
13057}
13058#[derive(Clone, Copy, Default)]
13059pub struct IterableIfaceLimitAttributes<'a> {
13060    buf: &'a [u8],
13061    pos: usize,
13062    orig_loc: usize,
13063}
13064impl<'a> IterableIfaceLimitAttributes<'a> {
13065    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13066        Self {
13067            buf,
13068            pos: 0,
13069            orig_loc,
13070        }
13071    }
13072    pub fn get_buf(&self) -> &'a [u8] {
13073        self.buf
13074    }
13075}
13076impl<'a> Iterator for IterableIfaceLimitAttributes<'a> {
13077    type Item = Result<IfaceLimitAttributes<'a>, ErrorContext>;
13078    fn next(&mut self) -> Option<Self::Item> {
13079        let pos = self.pos;
13080        let mut r#type;
13081        loop {
13082            r#type = None;
13083            if self.buf.len() == self.pos {
13084                return None;
13085            }
13086            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13087                break;
13088            };
13089            r#type = Some(header.r#type);
13090            let res = match header.r#type {
13091                1u16 => IfaceLimitAttributes::Max({
13092                    let res = parse_u32(next);
13093                    let Some(val) = res else { break };
13094                    val
13095                }),
13096                2u16 => IfaceLimitAttributes::Types({
13097                    let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
13098                    let Some(val) = res else { break };
13099                    val
13100                }),
13101                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13102                n => continue,
13103            };
13104            return Some(Ok(res));
13105        }
13106        Some(Err(ErrorContext::new(
13107            "IfaceLimitAttributes",
13108            r#type.and_then(|t| IfaceLimitAttributes::attr_from_type(t)),
13109            self.orig_loc,
13110            self.buf.as_ptr().wrapping_add(pos) as usize,
13111        )))
13112    }
13113}
13114impl<'a> std::fmt::Debug for IterableIfaceLimitAttributes<'_> {
13115    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13116        let mut fmt = f.debug_struct("IfaceLimitAttributes");
13117        for attr in self.clone() {
13118            let attr = match attr {
13119                Ok(a) => a,
13120                Err(err) => {
13121                    fmt.finish()?;
13122                    f.write_str("Err(")?;
13123                    err.fmt(f)?;
13124                    return f.write_str(")");
13125                }
13126            };
13127            match attr {
13128                IfaceLimitAttributes::Max(val) => fmt.field("Max", &val),
13129                IfaceLimitAttributes::Types(val) => fmt.field("Types", &val),
13130            };
13131        }
13132        fmt.finish()
13133    }
13134}
13135impl IterableIfaceLimitAttributes<'_> {
13136    pub fn lookup_attr(
13137        &self,
13138        offset: usize,
13139        missing_type: Option<u16>,
13140    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
13141        let mut stack = Vec::new();
13142        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
13143        if missing_type.is_some() && cur == offset {
13144            stack.push(("IfaceLimitAttributes", offset));
13145            return (
13146                stack,
13147                missing_type.and_then(|t| IfaceLimitAttributes::attr_from_type(t)),
13148            );
13149        }
13150        if cur > offset || cur + self.buf.len() < offset {
13151            return (stack, None);
13152        }
13153        let mut attrs = self.clone();
13154        let mut last_off = cur + attrs.pos;
13155        let mut missing = None;
13156        while let Some(attr) = attrs.next() {
13157            let Ok(attr) = attr else { break };
13158            match attr {
13159                IfaceLimitAttributes::Max(val) => {
13160                    if last_off == offset {
13161                        stack.push(("Max", last_off));
13162                        break;
13163                    }
13164                }
13165                IfaceLimitAttributes::Types(val) => {
13166                    (stack, missing) = val.lookup_attr(offset, missing_type);
13167                    if !stack.is_empty() {
13168                        break;
13169                    }
13170                }
13171                _ => {}
13172            };
13173            last_off = cur + attrs.pos;
13174        }
13175        if !stack.is_empty() {
13176            stack.push(("IfaceLimitAttributes", cur));
13177        }
13178        (stack, missing)
13179    }
13180}
13181#[derive(Clone)]
13182pub enum IftypeDataAttrs<'a> {
13183    Iftypes(&'a [u8]),
13184    HeCapMac(&'a [u8]),
13185    HeCapPhy(&'a [u8]),
13186    HeCapMcsSet(&'a [u8]),
13187    HeCapPpe(&'a [u8]),
13188    He6ghzCapa(&'a [u8]),
13189    VendorElems(&'a [u8]),
13190    EhtCapMac(&'a [u8]),
13191    EhtCapPhy(&'a [u8]),
13192    EhtCapMcsSet(&'a [u8]),
13193    EhtCapPpe(&'a [u8]),
13194}
13195impl<'a> IterableIftypeDataAttrs<'a> {
13196    pub fn get_iftypes(&self) -> Result<&'a [u8], ErrorContext> {
13197        let mut iter = self.clone();
13198        iter.pos = 0;
13199        for attr in iter {
13200            if let IftypeDataAttrs::Iftypes(val) = attr? {
13201                return Ok(val);
13202            }
13203        }
13204        Err(ErrorContext::new_missing(
13205            "IftypeDataAttrs",
13206            "Iftypes",
13207            self.orig_loc,
13208            self.buf.as_ptr() as usize,
13209        ))
13210    }
13211    pub fn get_he_cap_mac(&self) -> Result<&'a [u8], ErrorContext> {
13212        let mut iter = self.clone();
13213        iter.pos = 0;
13214        for attr in iter {
13215            if let IftypeDataAttrs::HeCapMac(val) = attr? {
13216                return Ok(val);
13217            }
13218        }
13219        Err(ErrorContext::new_missing(
13220            "IftypeDataAttrs",
13221            "HeCapMac",
13222            self.orig_loc,
13223            self.buf.as_ptr() as usize,
13224        ))
13225    }
13226    pub fn get_he_cap_phy(&self) -> Result<&'a [u8], ErrorContext> {
13227        let mut iter = self.clone();
13228        iter.pos = 0;
13229        for attr in iter {
13230            if let IftypeDataAttrs::HeCapPhy(val) = attr? {
13231                return Ok(val);
13232            }
13233        }
13234        Err(ErrorContext::new_missing(
13235            "IftypeDataAttrs",
13236            "HeCapPhy",
13237            self.orig_loc,
13238            self.buf.as_ptr() as usize,
13239        ))
13240    }
13241    pub fn get_he_cap_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
13242        let mut iter = self.clone();
13243        iter.pos = 0;
13244        for attr in iter {
13245            if let IftypeDataAttrs::HeCapMcsSet(val) = attr? {
13246                return Ok(val);
13247            }
13248        }
13249        Err(ErrorContext::new_missing(
13250            "IftypeDataAttrs",
13251            "HeCapMcsSet",
13252            self.orig_loc,
13253            self.buf.as_ptr() as usize,
13254        ))
13255    }
13256    pub fn get_he_cap_ppe(&self) -> Result<&'a [u8], ErrorContext> {
13257        let mut iter = self.clone();
13258        iter.pos = 0;
13259        for attr in iter {
13260            if let IftypeDataAttrs::HeCapPpe(val) = attr? {
13261                return Ok(val);
13262            }
13263        }
13264        Err(ErrorContext::new_missing(
13265            "IftypeDataAttrs",
13266            "HeCapPpe",
13267            self.orig_loc,
13268            self.buf.as_ptr() as usize,
13269        ))
13270    }
13271    pub fn get_he_6ghz_capa(&self) -> Result<&'a [u8], ErrorContext> {
13272        let mut iter = self.clone();
13273        iter.pos = 0;
13274        for attr in iter {
13275            if let IftypeDataAttrs::He6ghzCapa(val) = attr? {
13276                return Ok(val);
13277            }
13278        }
13279        Err(ErrorContext::new_missing(
13280            "IftypeDataAttrs",
13281            "He6ghzCapa",
13282            self.orig_loc,
13283            self.buf.as_ptr() as usize,
13284        ))
13285    }
13286    pub fn get_vendor_elems(&self) -> Result<&'a [u8], ErrorContext> {
13287        let mut iter = self.clone();
13288        iter.pos = 0;
13289        for attr in iter {
13290            if let IftypeDataAttrs::VendorElems(val) = attr? {
13291                return Ok(val);
13292            }
13293        }
13294        Err(ErrorContext::new_missing(
13295            "IftypeDataAttrs",
13296            "VendorElems",
13297            self.orig_loc,
13298            self.buf.as_ptr() as usize,
13299        ))
13300    }
13301    pub fn get_eht_cap_mac(&self) -> Result<&'a [u8], ErrorContext> {
13302        let mut iter = self.clone();
13303        iter.pos = 0;
13304        for attr in iter {
13305            if let IftypeDataAttrs::EhtCapMac(val) = attr? {
13306                return Ok(val);
13307            }
13308        }
13309        Err(ErrorContext::new_missing(
13310            "IftypeDataAttrs",
13311            "EhtCapMac",
13312            self.orig_loc,
13313            self.buf.as_ptr() as usize,
13314        ))
13315    }
13316    pub fn get_eht_cap_phy(&self) -> Result<&'a [u8], ErrorContext> {
13317        let mut iter = self.clone();
13318        iter.pos = 0;
13319        for attr in iter {
13320            if let IftypeDataAttrs::EhtCapPhy(val) = attr? {
13321                return Ok(val);
13322            }
13323        }
13324        Err(ErrorContext::new_missing(
13325            "IftypeDataAttrs",
13326            "EhtCapPhy",
13327            self.orig_loc,
13328            self.buf.as_ptr() as usize,
13329        ))
13330    }
13331    pub fn get_eht_cap_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
13332        let mut iter = self.clone();
13333        iter.pos = 0;
13334        for attr in iter {
13335            if let IftypeDataAttrs::EhtCapMcsSet(val) = attr? {
13336                return Ok(val);
13337            }
13338        }
13339        Err(ErrorContext::new_missing(
13340            "IftypeDataAttrs",
13341            "EhtCapMcsSet",
13342            self.orig_loc,
13343            self.buf.as_ptr() as usize,
13344        ))
13345    }
13346    pub fn get_eht_cap_ppe(&self) -> Result<&'a [u8], ErrorContext> {
13347        let mut iter = self.clone();
13348        iter.pos = 0;
13349        for attr in iter {
13350            if let IftypeDataAttrs::EhtCapPpe(val) = attr? {
13351                return Ok(val);
13352            }
13353        }
13354        Err(ErrorContext::new_missing(
13355            "IftypeDataAttrs",
13356            "EhtCapPpe",
13357            self.orig_loc,
13358            self.buf.as_ptr() as usize,
13359        ))
13360    }
13361}
13362impl IftypeDataAttrs<'_> {
13363    pub fn new<'a>(buf: &'a [u8]) -> IterableIftypeDataAttrs<'a> {
13364        IterableIftypeDataAttrs::with_loc(buf, buf.as_ptr() as usize)
13365    }
13366    fn attr_from_type(r#type: u16) -> Option<&'static str> {
13367        let res = match r#type {
13368            1u16 => "Iftypes",
13369            2u16 => "HeCapMac",
13370            3u16 => "HeCapPhy",
13371            4u16 => "HeCapMcsSet",
13372            5u16 => "HeCapPpe",
13373            6u16 => "He6ghzCapa",
13374            7u16 => "VendorElems",
13375            8u16 => "EhtCapMac",
13376            9u16 => "EhtCapPhy",
13377            10u16 => "EhtCapMcsSet",
13378            11u16 => "EhtCapPpe",
13379            _ => return None,
13380        };
13381        Some(res)
13382    }
13383}
13384#[derive(Clone, Copy, Default)]
13385pub struct IterableIftypeDataAttrs<'a> {
13386    buf: &'a [u8],
13387    pos: usize,
13388    orig_loc: usize,
13389}
13390impl<'a> IterableIftypeDataAttrs<'a> {
13391    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13392        Self {
13393            buf,
13394            pos: 0,
13395            orig_loc,
13396        }
13397    }
13398    pub fn get_buf(&self) -> &'a [u8] {
13399        self.buf
13400    }
13401}
13402impl<'a> Iterator for IterableIftypeDataAttrs<'a> {
13403    type Item = Result<IftypeDataAttrs<'a>, ErrorContext>;
13404    fn next(&mut self) -> Option<Self::Item> {
13405        let pos = self.pos;
13406        let mut r#type;
13407        loop {
13408            r#type = None;
13409            if self.buf.len() == self.pos {
13410                return None;
13411            }
13412            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13413                break;
13414            };
13415            r#type = Some(header.r#type);
13416            let res = match header.r#type {
13417                1u16 => IftypeDataAttrs::Iftypes({
13418                    let res = Some(next);
13419                    let Some(val) = res else { break };
13420                    val
13421                }),
13422                2u16 => IftypeDataAttrs::HeCapMac({
13423                    let res = Some(next);
13424                    let Some(val) = res else { break };
13425                    val
13426                }),
13427                3u16 => IftypeDataAttrs::HeCapPhy({
13428                    let res = Some(next);
13429                    let Some(val) = res else { break };
13430                    val
13431                }),
13432                4u16 => IftypeDataAttrs::HeCapMcsSet({
13433                    let res = Some(next);
13434                    let Some(val) = res else { break };
13435                    val
13436                }),
13437                5u16 => IftypeDataAttrs::HeCapPpe({
13438                    let res = Some(next);
13439                    let Some(val) = res else { break };
13440                    val
13441                }),
13442                6u16 => IftypeDataAttrs::He6ghzCapa({
13443                    let res = Some(next);
13444                    let Some(val) = res else { break };
13445                    val
13446                }),
13447                7u16 => IftypeDataAttrs::VendorElems({
13448                    let res = Some(next);
13449                    let Some(val) = res else { break };
13450                    val
13451                }),
13452                8u16 => IftypeDataAttrs::EhtCapMac({
13453                    let res = Some(next);
13454                    let Some(val) = res else { break };
13455                    val
13456                }),
13457                9u16 => IftypeDataAttrs::EhtCapPhy({
13458                    let res = Some(next);
13459                    let Some(val) = res else { break };
13460                    val
13461                }),
13462                10u16 => IftypeDataAttrs::EhtCapMcsSet({
13463                    let res = Some(next);
13464                    let Some(val) = res else { break };
13465                    val
13466                }),
13467                11u16 => IftypeDataAttrs::EhtCapPpe({
13468                    let res = Some(next);
13469                    let Some(val) = res else { break };
13470                    val
13471                }),
13472                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13473                n => continue,
13474            };
13475            return Some(Ok(res));
13476        }
13477        Some(Err(ErrorContext::new(
13478            "IftypeDataAttrs",
13479            r#type.and_then(|t| IftypeDataAttrs::attr_from_type(t)),
13480            self.orig_loc,
13481            self.buf.as_ptr().wrapping_add(pos) as usize,
13482        )))
13483    }
13484}
13485impl<'a> std::fmt::Debug for IterableIftypeDataAttrs<'_> {
13486    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13487        let mut fmt = f.debug_struct("IftypeDataAttrs");
13488        for attr in self.clone() {
13489            let attr = match attr {
13490                Ok(a) => a,
13491                Err(err) => {
13492                    fmt.finish()?;
13493                    f.write_str("Err(")?;
13494                    err.fmt(f)?;
13495                    return f.write_str(")");
13496                }
13497            };
13498            match attr {
13499                IftypeDataAttrs::Iftypes(val) => fmt.field("Iftypes", &val),
13500                IftypeDataAttrs::HeCapMac(val) => fmt.field("HeCapMac", &val),
13501                IftypeDataAttrs::HeCapPhy(val) => fmt.field("HeCapPhy", &val),
13502                IftypeDataAttrs::HeCapMcsSet(val) => fmt.field("HeCapMcsSet", &val),
13503                IftypeDataAttrs::HeCapPpe(val) => fmt.field("HeCapPpe", &val),
13504                IftypeDataAttrs::He6ghzCapa(val) => fmt.field("He6ghzCapa", &val),
13505                IftypeDataAttrs::VendorElems(val) => fmt.field("VendorElems", &val),
13506                IftypeDataAttrs::EhtCapMac(val) => fmt.field("EhtCapMac", &val),
13507                IftypeDataAttrs::EhtCapPhy(val) => fmt.field("EhtCapPhy", &val),
13508                IftypeDataAttrs::EhtCapMcsSet(val) => fmt.field("EhtCapMcsSet", &val),
13509                IftypeDataAttrs::EhtCapPpe(val) => fmt.field("EhtCapPpe", &val),
13510            };
13511        }
13512        fmt.finish()
13513    }
13514}
13515impl IterableIftypeDataAttrs<'_> {
13516    pub fn lookup_attr(
13517        &self,
13518        offset: usize,
13519        missing_type: Option<u16>,
13520    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
13521        let mut stack = Vec::new();
13522        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
13523        if missing_type.is_some() && cur == offset {
13524            stack.push(("IftypeDataAttrs", offset));
13525            return (
13526                stack,
13527                missing_type.and_then(|t| IftypeDataAttrs::attr_from_type(t)),
13528            );
13529        }
13530        if cur > offset || cur + self.buf.len() < offset {
13531            return (stack, None);
13532        }
13533        let mut attrs = self.clone();
13534        let mut last_off = cur + attrs.pos;
13535        while let Some(attr) = attrs.next() {
13536            let Ok(attr) = attr else { break };
13537            match attr {
13538                IftypeDataAttrs::Iftypes(val) => {
13539                    if last_off == offset {
13540                        stack.push(("Iftypes", last_off));
13541                        break;
13542                    }
13543                }
13544                IftypeDataAttrs::HeCapMac(val) => {
13545                    if last_off == offset {
13546                        stack.push(("HeCapMac", last_off));
13547                        break;
13548                    }
13549                }
13550                IftypeDataAttrs::HeCapPhy(val) => {
13551                    if last_off == offset {
13552                        stack.push(("HeCapPhy", last_off));
13553                        break;
13554                    }
13555                }
13556                IftypeDataAttrs::HeCapMcsSet(val) => {
13557                    if last_off == offset {
13558                        stack.push(("HeCapMcsSet", last_off));
13559                        break;
13560                    }
13561                }
13562                IftypeDataAttrs::HeCapPpe(val) => {
13563                    if last_off == offset {
13564                        stack.push(("HeCapPpe", last_off));
13565                        break;
13566                    }
13567                }
13568                IftypeDataAttrs::He6ghzCapa(val) => {
13569                    if last_off == offset {
13570                        stack.push(("He6ghzCapa", last_off));
13571                        break;
13572                    }
13573                }
13574                IftypeDataAttrs::VendorElems(val) => {
13575                    if last_off == offset {
13576                        stack.push(("VendorElems", last_off));
13577                        break;
13578                    }
13579                }
13580                IftypeDataAttrs::EhtCapMac(val) => {
13581                    if last_off == offset {
13582                        stack.push(("EhtCapMac", last_off));
13583                        break;
13584                    }
13585                }
13586                IftypeDataAttrs::EhtCapPhy(val) => {
13587                    if last_off == offset {
13588                        stack.push(("EhtCapPhy", last_off));
13589                        break;
13590                    }
13591                }
13592                IftypeDataAttrs::EhtCapMcsSet(val) => {
13593                    if last_off == offset {
13594                        stack.push(("EhtCapMcsSet", last_off));
13595                        break;
13596                    }
13597                }
13598                IftypeDataAttrs::EhtCapPpe(val) => {
13599                    if last_off == offset {
13600                        stack.push(("EhtCapPpe", last_off));
13601                        break;
13602                    }
13603                }
13604                _ => {}
13605            };
13606            last_off = cur + attrs.pos;
13607        }
13608        if !stack.is_empty() {
13609            stack.push(("IftypeDataAttrs", cur));
13610        }
13611        (stack, None)
13612    }
13613}
13614#[derive(Clone)]
13615pub enum IftypeAttrs<'a> {
13616    Unspecified(IterableFrameTypeAttrs<'a>),
13617    Adhoc(IterableFrameTypeAttrs<'a>),
13618    Station(IterableFrameTypeAttrs<'a>),
13619    Ap(IterableFrameTypeAttrs<'a>),
13620    ApVlan(IterableFrameTypeAttrs<'a>),
13621    Wds(IterableFrameTypeAttrs<'a>),
13622    Monitor(IterableFrameTypeAttrs<'a>),
13623    MeshPoint(IterableFrameTypeAttrs<'a>),
13624    P2pClient(IterableFrameTypeAttrs<'a>),
13625    P2pGo(IterableFrameTypeAttrs<'a>),
13626    P2pDevice(IterableFrameTypeAttrs<'a>),
13627    Ocb(IterableFrameTypeAttrs<'a>),
13628    Nan(IterableFrameTypeAttrs<'a>),
13629}
13630impl<'a> IterableIftypeAttrs<'a> {
13631    pub fn get_unspecified(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13632        let mut iter = self.clone();
13633        iter.pos = 0;
13634        for attr in iter {
13635            if let IftypeAttrs::Unspecified(val) = attr? {
13636                return Ok(val);
13637            }
13638        }
13639        Err(ErrorContext::new_missing(
13640            "IftypeAttrs",
13641            "Unspecified",
13642            self.orig_loc,
13643            self.buf.as_ptr() as usize,
13644        ))
13645    }
13646    pub fn get_adhoc(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13647        let mut iter = self.clone();
13648        iter.pos = 0;
13649        for attr in iter {
13650            if let IftypeAttrs::Adhoc(val) = attr? {
13651                return Ok(val);
13652            }
13653        }
13654        Err(ErrorContext::new_missing(
13655            "IftypeAttrs",
13656            "Adhoc",
13657            self.orig_loc,
13658            self.buf.as_ptr() as usize,
13659        ))
13660    }
13661    pub fn get_station(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13662        let mut iter = self.clone();
13663        iter.pos = 0;
13664        for attr in iter {
13665            if let IftypeAttrs::Station(val) = attr? {
13666                return Ok(val);
13667            }
13668        }
13669        Err(ErrorContext::new_missing(
13670            "IftypeAttrs",
13671            "Station",
13672            self.orig_loc,
13673            self.buf.as_ptr() as usize,
13674        ))
13675    }
13676    pub fn get_ap(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13677        let mut iter = self.clone();
13678        iter.pos = 0;
13679        for attr in iter {
13680            if let IftypeAttrs::Ap(val) = attr? {
13681                return Ok(val);
13682            }
13683        }
13684        Err(ErrorContext::new_missing(
13685            "IftypeAttrs",
13686            "Ap",
13687            self.orig_loc,
13688            self.buf.as_ptr() as usize,
13689        ))
13690    }
13691    pub fn get_ap_vlan(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13692        let mut iter = self.clone();
13693        iter.pos = 0;
13694        for attr in iter {
13695            if let IftypeAttrs::ApVlan(val) = attr? {
13696                return Ok(val);
13697            }
13698        }
13699        Err(ErrorContext::new_missing(
13700            "IftypeAttrs",
13701            "ApVlan",
13702            self.orig_loc,
13703            self.buf.as_ptr() as usize,
13704        ))
13705    }
13706    pub fn get_wds(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13707        let mut iter = self.clone();
13708        iter.pos = 0;
13709        for attr in iter {
13710            if let IftypeAttrs::Wds(val) = attr? {
13711                return Ok(val);
13712            }
13713        }
13714        Err(ErrorContext::new_missing(
13715            "IftypeAttrs",
13716            "Wds",
13717            self.orig_loc,
13718            self.buf.as_ptr() as usize,
13719        ))
13720    }
13721    pub fn get_monitor(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13722        let mut iter = self.clone();
13723        iter.pos = 0;
13724        for attr in iter {
13725            if let IftypeAttrs::Monitor(val) = attr? {
13726                return Ok(val);
13727            }
13728        }
13729        Err(ErrorContext::new_missing(
13730            "IftypeAttrs",
13731            "Monitor",
13732            self.orig_loc,
13733            self.buf.as_ptr() as usize,
13734        ))
13735    }
13736    pub fn get_mesh_point(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13737        let mut iter = self.clone();
13738        iter.pos = 0;
13739        for attr in iter {
13740            if let IftypeAttrs::MeshPoint(val) = attr? {
13741                return Ok(val);
13742            }
13743        }
13744        Err(ErrorContext::new_missing(
13745            "IftypeAttrs",
13746            "MeshPoint",
13747            self.orig_loc,
13748            self.buf.as_ptr() as usize,
13749        ))
13750    }
13751    pub fn get_p2p_client(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13752        let mut iter = self.clone();
13753        iter.pos = 0;
13754        for attr in iter {
13755            if let IftypeAttrs::P2pClient(val) = attr? {
13756                return Ok(val);
13757            }
13758        }
13759        Err(ErrorContext::new_missing(
13760            "IftypeAttrs",
13761            "P2pClient",
13762            self.orig_loc,
13763            self.buf.as_ptr() as usize,
13764        ))
13765    }
13766    pub fn get_p2p_go(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13767        let mut iter = self.clone();
13768        iter.pos = 0;
13769        for attr in iter {
13770            if let IftypeAttrs::P2pGo(val) = attr? {
13771                return Ok(val);
13772            }
13773        }
13774        Err(ErrorContext::new_missing(
13775            "IftypeAttrs",
13776            "P2pGo",
13777            self.orig_loc,
13778            self.buf.as_ptr() as usize,
13779        ))
13780    }
13781    pub fn get_p2p_device(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13782        let mut iter = self.clone();
13783        iter.pos = 0;
13784        for attr in iter {
13785            if let IftypeAttrs::P2pDevice(val) = attr? {
13786                return Ok(val);
13787            }
13788        }
13789        Err(ErrorContext::new_missing(
13790            "IftypeAttrs",
13791            "P2pDevice",
13792            self.orig_loc,
13793            self.buf.as_ptr() as usize,
13794        ))
13795    }
13796    pub fn get_ocb(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13797        let mut iter = self.clone();
13798        iter.pos = 0;
13799        for attr in iter {
13800            if let IftypeAttrs::Ocb(val) = attr? {
13801                return Ok(val);
13802            }
13803        }
13804        Err(ErrorContext::new_missing(
13805            "IftypeAttrs",
13806            "Ocb",
13807            self.orig_loc,
13808            self.buf.as_ptr() as usize,
13809        ))
13810    }
13811    pub fn get_nan(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13812        let mut iter = self.clone();
13813        iter.pos = 0;
13814        for attr in iter {
13815            if let IftypeAttrs::Nan(val) = attr? {
13816                return Ok(val);
13817            }
13818        }
13819        Err(ErrorContext::new_missing(
13820            "IftypeAttrs",
13821            "Nan",
13822            self.orig_loc,
13823            self.buf.as_ptr() as usize,
13824        ))
13825    }
13826}
13827impl IftypeAttrs<'_> {
13828    pub fn new<'a>(buf: &'a [u8]) -> IterableIftypeAttrs<'a> {
13829        IterableIftypeAttrs::with_loc(buf, buf.as_ptr() as usize)
13830    }
13831    fn attr_from_type(r#type: u16) -> Option<&'static str> {
13832        let res = match r#type {
13833            0u16 => "Unspecified",
13834            1u16 => "Adhoc",
13835            2u16 => "Station",
13836            3u16 => "Ap",
13837            4u16 => "ApVlan",
13838            5u16 => "Wds",
13839            6u16 => "Monitor",
13840            7u16 => "MeshPoint",
13841            8u16 => "P2pClient",
13842            9u16 => "P2pGo",
13843            10u16 => "P2pDevice",
13844            11u16 => "Ocb",
13845            12u16 => "Nan",
13846            _ => return None,
13847        };
13848        Some(res)
13849    }
13850}
13851#[derive(Clone, Copy, Default)]
13852pub struct IterableIftypeAttrs<'a> {
13853    buf: &'a [u8],
13854    pos: usize,
13855    orig_loc: usize,
13856}
13857impl<'a> IterableIftypeAttrs<'a> {
13858    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13859        Self {
13860            buf,
13861            pos: 0,
13862            orig_loc,
13863        }
13864    }
13865    pub fn get_buf(&self) -> &'a [u8] {
13866        self.buf
13867    }
13868}
13869impl<'a> Iterator for IterableIftypeAttrs<'a> {
13870    type Item = Result<IftypeAttrs<'a>, ErrorContext>;
13871    fn next(&mut self) -> Option<Self::Item> {
13872        let pos = self.pos;
13873        let mut r#type;
13874        loop {
13875            r#type = None;
13876            if self.buf.len() == self.pos {
13877                return None;
13878            }
13879            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13880                break;
13881            };
13882            r#type = Some(header.r#type);
13883            let res = match header.r#type {
13884                0u16 => IftypeAttrs::Unspecified({
13885                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13886                    let Some(val) = res else { break };
13887                    val
13888                }),
13889                1u16 => IftypeAttrs::Adhoc({
13890                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13891                    let Some(val) = res else { break };
13892                    val
13893                }),
13894                2u16 => IftypeAttrs::Station({
13895                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13896                    let Some(val) = res else { break };
13897                    val
13898                }),
13899                3u16 => IftypeAttrs::Ap({
13900                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13901                    let Some(val) = res else { break };
13902                    val
13903                }),
13904                4u16 => IftypeAttrs::ApVlan({
13905                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13906                    let Some(val) = res else { break };
13907                    val
13908                }),
13909                5u16 => IftypeAttrs::Wds({
13910                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13911                    let Some(val) = res else { break };
13912                    val
13913                }),
13914                6u16 => IftypeAttrs::Monitor({
13915                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13916                    let Some(val) = res else { break };
13917                    val
13918                }),
13919                7u16 => IftypeAttrs::MeshPoint({
13920                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13921                    let Some(val) = res else { break };
13922                    val
13923                }),
13924                8u16 => IftypeAttrs::P2pClient({
13925                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13926                    let Some(val) = res else { break };
13927                    val
13928                }),
13929                9u16 => IftypeAttrs::P2pGo({
13930                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13931                    let Some(val) = res else { break };
13932                    val
13933                }),
13934                10u16 => IftypeAttrs::P2pDevice({
13935                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13936                    let Some(val) = res else { break };
13937                    val
13938                }),
13939                11u16 => IftypeAttrs::Ocb({
13940                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13941                    let Some(val) = res else { break };
13942                    val
13943                }),
13944                12u16 => IftypeAttrs::Nan({
13945                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13946                    let Some(val) = res else { break };
13947                    val
13948                }),
13949                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13950                n => continue,
13951            };
13952            return Some(Ok(res));
13953        }
13954        Some(Err(ErrorContext::new(
13955            "IftypeAttrs",
13956            r#type.and_then(|t| IftypeAttrs::attr_from_type(t)),
13957            self.orig_loc,
13958            self.buf.as_ptr().wrapping_add(pos) as usize,
13959        )))
13960    }
13961}
13962impl<'a> std::fmt::Debug for IterableIftypeAttrs<'_> {
13963    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13964        let mut fmt = f.debug_struct("IftypeAttrs");
13965        for attr in self.clone() {
13966            let attr = match attr {
13967                Ok(a) => a,
13968                Err(err) => {
13969                    fmt.finish()?;
13970                    f.write_str("Err(")?;
13971                    err.fmt(f)?;
13972                    return f.write_str(")");
13973                }
13974            };
13975            match attr {
13976                IftypeAttrs::Unspecified(val) => fmt.field("Unspecified", &val),
13977                IftypeAttrs::Adhoc(val) => fmt.field("Adhoc", &val),
13978                IftypeAttrs::Station(val) => fmt.field("Station", &val),
13979                IftypeAttrs::Ap(val) => fmt.field("Ap", &val),
13980                IftypeAttrs::ApVlan(val) => fmt.field("ApVlan", &val),
13981                IftypeAttrs::Wds(val) => fmt.field("Wds", &val),
13982                IftypeAttrs::Monitor(val) => fmt.field("Monitor", &val),
13983                IftypeAttrs::MeshPoint(val) => fmt.field("MeshPoint", &val),
13984                IftypeAttrs::P2pClient(val) => fmt.field("P2pClient", &val),
13985                IftypeAttrs::P2pGo(val) => fmt.field("P2pGo", &val),
13986                IftypeAttrs::P2pDevice(val) => fmt.field("P2pDevice", &val),
13987                IftypeAttrs::Ocb(val) => fmt.field("Ocb", &val),
13988                IftypeAttrs::Nan(val) => fmt.field("Nan", &val),
13989            };
13990        }
13991        fmt.finish()
13992    }
13993}
13994impl IterableIftypeAttrs<'_> {
13995    pub fn lookup_attr(
13996        &self,
13997        offset: usize,
13998        missing_type: Option<u16>,
13999    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14000        let mut stack = Vec::new();
14001        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14002        if missing_type.is_some() && cur == offset {
14003            stack.push(("IftypeAttrs", offset));
14004            return (
14005                stack,
14006                missing_type.and_then(|t| IftypeAttrs::attr_from_type(t)),
14007            );
14008        }
14009        if cur > offset || cur + self.buf.len() < offset {
14010            return (stack, None);
14011        }
14012        let mut attrs = self.clone();
14013        let mut last_off = cur + attrs.pos;
14014        let mut missing = None;
14015        while let Some(attr) = attrs.next() {
14016            let Ok(attr) = attr else { break };
14017            match attr {
14018                IftypeAttrs::Unspecified(val) => {
14019                    (stack, missing) = val.lookup_attr(offset, missing_type);
14020                    if !stack.is_empty() {
14021                        break;
14022                    }
14023                }
14024                IftypeAttrs::Adhoc(val) => {
14025                    (stack, missing) = val.lookup_attr(offset, missing_type);
14026                    if !stack.is_empty() {
14027                        break;
14028                    }
14029                }
14030                IftypeAttrs::Station(val) => {
14031                    (stack, missing) = val.lookup_attr(offset, missing_type);
14032                    if !stack.is_empty() {
14033                        break;
14034                    }
14035                }
14036                IftypeAttrs::Ap(val) => {
14037                    (stack, missing) = val.lookup_attr(offset, missing_type);
14038                    if !stack.is_empty() {
14039                        break;
14040                    }
14041                }
14042                IftypeAttrs::ApVlan(val) => {
14043                    (stack, missing) = val.lookup_attr(offset, missing_type);
14044                    if !stack.is_empty() {
14045                        break;
14046                    }
14047                }
14048                IftypeAttrs::Wds(val) => {
14049                    (stack, missing) = val.lookup_attr(offset, missing_type);
14050                    if !stack.is_empty() {
14051                        break;
14052                    }
14053                }
14054                IftypeAttrs::Monitor(val) => {
14055                    (stack, missing) = val.lookup_attr(offset, missing_type);
14056                    if !stack.is_empty() {
14057                        break;
14058                    }
14059                }
14060                IftypeAttrs::MeshPoint(val) => {
14061                    (stack, missing) = val.lookup_attr(offset, missing_type);
14062                    if !stack.is_empty() {
14063                        break;
14064                    }
14065                }
14066                IftypeAttrs::P2pClient(val) => {
14067                    (stack, missing) = val.lookup_attr(offset, missing_type);
14068                    if !stack.is_empty() {
14069                        break;
14070                    }
14071                }
14072                IftypeAttrs::P2pGo(val) => {
14073                    (stack, missing) = val.lookup_attr(offset, missing_type);
14074                    if !stack.is_empty() {
14075                        break;
14076                    }
14077                }
14078                IftypeAttrs::P2pDevice(val) => {
14079                    (stack, missing) = val.lookup_attr(offset, missing_type);
14080                    if !stack.is_empty() {
14081                        break;
14082                    }
14083                }
14084                IftypeAttrs::Ocb(val) => {
14085                    (stack, missing) = val.lookup_attr(offset, missing_type);
14086                    if !stack.is_empty() {
14087                        break;
14088                    }
14089                }
14090                IftypeAttrs::Nan(val) => {
14091                    (stack, missing) = val.lookup_attr(offset, missing_type);
14092                    if !stack.is_empty() {
14093                        break;
14094                    }
14095                }
14096                _ => {}
14097            };
14098            last_off = cur + attrs.pos;
14099        }
14100        if !stack.is_empty() {
14101            stack.push(("IftypeAttrs", cur));
14102        }
14103        (stack, missing)
14104    }
14105}
14106#[derive(Clone)]
14107pub enum SarAttributes<'a> {
14108    Type(u32),
14109    Specs(IterableArraySarSpecs<'a>),
14110}
14111impl<'a> IterableSarAttributes<'a> {
14112    pub fn get_type(&self) -> Result<u32, ErrorContext> {
14113        let mut iter = self.clone();
14114        iter.pos = 0;
14115        for attr in iter {
14116            if let SarAttributes::Type(val) = attr? {
14117                return Ok(val);
14118            }
14119        }
14120        Err(ErrorContext::new_missing(
14121            "SarAttributes",
14122            "Type",
14123            self.orig_loc,
14124            self.buf.as_ptr() as usize,
14125        ))
14126    }
14127    pub fn get_specs(
14128        &self,
14129    ) -> Result<ArrayIterable<IterableArraySarSpecs<'a>, IterableSarSpecs<'a>>, ErrorContext> {
14130        for attr in self.clone() {
14131            if let SarAttributes::Specs(val) = attr? {
14132                return Ok(ArrayIterable::new(val));
14133            }
14134        }
14135        Err(ErrorContext::new_missing(
14136            "SarAttributes",
14137            "Specs",
14138            self.orig_loc,
14139            self.buf.as_ptr() as usize,
14140        ))
14141    }
14142}
14143impl SarSpecs {
14144    pub fn new_array(buf: &[u8]) -> IterableArraySarSpecs<'_> {
14145        IterableArraySarSpecs::with_loc(buf, buf.as_ptr() as usize)
14146    }
14147}
14148#[derive(Clone, Copy, Default)]
14149pub struct IterableArraySarSpecs<'a> {
14150    buf: &'a [u8],
14151    pos: usize,
14152    orig_loc: usize,
14153}
14154impl<'a> IterableArraySarSpecs<'a> {
14155    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14156        Self {
14157            buf,
14158            pos: 0,
14159            orig_loc,
14160        }
14161    }
14162    pub fn get_buf(&self) -> &'a [u8] {
14163        self.buf
14164    }
14165}
14166impl<'a> Iterator for IterableArraySarSpecs<'a> {
14167    type Item = Result<IterableSarSpecs<'a>, ErrorContext>;
14168    fn next(&mut self) -> Option<Self::Item> {
14169        if self.buf.len() == self.pos {
14170            return None;
14171        }
14172        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
14173            {
14174                return Some(Ok(IterableSarSpecs::with_loc(next, self.orig_loc)));
14175            }
14176        }
14177        Some(Err(ErrorContext::new(
14178            "SarSpecs",
14179            None,
14180            self.orig_loc,
14181            self.buf.as_ptr().wrapping_add(self.pos) as usize,
14182        )))
14183    }
14184}
14185impl SarAttributes<'_> {
14186    pub fn new<'a>(buf: &'a [u8]) -> IterableSarAttributes<'a> {
14187        IterableSarAttributes::with_loc(buf, buf.as_ptr() as usize)
14188    }
14189    fn attr_from_type(r#type: u16) -> Option<&'static str> {
14190        let res = match r#type {
14191            1u16 => "Type",
14192            2u16 => "Specs",
14193            _ => return None,
14194        };
14195        Some(res)
14196    }
14197}
14198#[derive(Clone, Copy, Default)]
14199pub struct IterableSarAttributes<'a> {
14200    buf: &'a [u8],
14201    pos: usize,
14202    orig_loc: usize,
14203}
14204impl<'a> IterableSarAttributes<'a> {
14205    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14206        Self {
14207            buf,
14208            pos: 0,
14209            orig_loc,
14210        }
14211    }
14212    pub fn get_buf(&self) -> &'a [u8] {
14213        self.buf
14214    }
14215}
14216impl<'a> Iterator for IterableSarAttributes<'a> {
14217    type Item = Result<SarAttributes<'a>, ErrorContext>;
14218    fn next(&mut self) -> Option<Self::Item> {
14219        let pos = self.pos;
14220        let mut r#type;
14221        loop {
14222            r#type = None;
14223            if self.buf.len() == self.pos {
14224                return None;
14225            }
14226            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14227                break;
14228            };
14229            r#type = Some(header.r#type);
14230            let res = match header.r#type {
14231                1u16 => SarAttributes::Type({
14232                    let res = parse_u32(next);
14233                    let Some(val) = res else { break };
14234                    val
14235                }),
14236                2u16 => SarAttributes::Specs({
14237                    let res = Some(IterableArraySarSpecs::with_loc(next, self.orig_loc));
14238                    let Some(val) = res else { break };
14239                    val
14240                }),
14241                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14242                n => continue,
14243            };
14244            return Some(Ok(res));
14245        }
14246        Some(Err(ErrorContext::new(
14247            "SarAttributes",
14248            r#type.and_then(|t| SarAttributes::attr_from_type(t)),
14249            self.orig_loc,
14250            self.buf.as_ptr().wrapping_add(pos) as usize,
14251        )))
14252    }
14253}
14254impl std::fmt::Debug for IterableArraySarSpecs<'_> {
14255    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14256        fmt.debug_list()
14257            .entries(self.clone().map(FlattenErrorContext))
14258            .finish()
14259    }
14260}
14261impl<'a> std::fmt::Debug for IterableSarAttributes<'_> {
14262    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14263        let mut fmt = f.debug_struct("SarAttributes");
14264        for attr in self.clone() {
14265            let attr = match attr {
14266                Ok(a) => a,
14267                Err(err) => {
14268                    fmt.finish()?;
14269                    f.write_str("Err(")?;
14270                    err.fmt(f)?;
14271                    return f.write_str(")");
14272                }
14273            };
14274            match attr {
14275                SarAttributes::Type(val) => fmt.field("Type", &val),
14276                SarAttributes::Specs(val) => fmt.field("Specs", &val),
14277            };
14278        }
14279        fmt.finish()
14280    }
14281}
14282impl IterableSarAttributes<'_> {
14283    pub fn lookup_attr(
14284        &self,
14285        offset: usize,
14286        missing_type: Option<u16>,
14287    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14288        let mut stack = Vec::new();
14289        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14290        if missing_type.is_some() && cur == offset {
14291            stack.push(("SarAttributes", offset));
14292            return (
14293                stack,
14294                missing_type.and_then(|t| SarAttributes::attr_from_type(t)),
14295            );
14296        }
14297        if cur > offset || cur + self.buf.len() < offset {
14298            return (stack, None);
14299        }
14300        let mut attrs = self.clone();
14301        let mut last_off = cur + attrs.pos;
14302        let mut missing = None;
14303        while let Some(attr) = attrs.next() {
14304            let Ok(attr) = attr else { break };
14305            match attr {
14306                SarAttributes::Type(val) => {
14307                    if last_off == offset {
14308                        stack.push(("Type", last_off));
14309                        break;
14310                    }
14311                }
14312                SarAttributes::Specs(val) => {
14313                    for entry in val {
14314                        let Ok(attr) = entry else { break };
14315                        (stack, missing) = attr.lookup_attr(offset, missing_type);
14316                        if !stack.is_empty() {
14317                            break;
14318                        }
14319                    }
14320                    if !stack.is_empty() {
14321                        stack.push(("Specs", last_off));
14322                        break;
14323                    }
14324                }
14325                _ => {}
14326            };
14327            last_off = cur + attrs.pos;
14328        }
14329        if !stack.is_empty() {
14330            stack.push(("SarAttributes", cur));
14331        }
14332        (stack, missing)
14333    }
14334}
14335#[derive(Clone)]
14336pub enum SarSpecs {
14337    Power(i32),
14338    RangeIndex(u32),
14339    StartFreq(u32),
14340    EndFreq(u32),
14341}
14342impl<'a> IterableSarSpecs<'a> {
14343    pub fn get_power(&self) -> Result<i32, ErrorContext> {
14344        let mut iter = self.clone();
14345        iter.pos = 0;
14346        for attr in iter {
14347            if let SarSpecs::Power(val) = attr? {
14348                return Ok(val);
14349            }
14350        }
14351        Err(ErrorContext::new_missing(
14352            "SarSpecs",
14353            "Power",
14354            self.orig_loc,
14355            self.buf.as_ptr() as usize,
14356        ))
14357    }
14358    pub fn get_range_index(&self) -> Result<u32, ErrorContext> {
14359        let mut iter = self.clone();
14360        iter.pos = 0;
14361        for attr in iter {
14362            if let SarSpecs::RangeIndex(val) = attr? {
14363                return Ok(val);
14364            }
14365        }
14366        Err(ErrorContext::new_missing(
14367            "SarSpecs",
14368            "RangeIndex",
14369            self.orig_loc,
14370            self.buf.as_ptr() as usize,
14371        ))
14372    }
14373    pub fn get_start_freq(&self) -> Result<u32, ErrorContext> {
14374        let mut iter = self.clone();
14375        iter.pos = 0;
14376        for attr in iter {
14377            if let SarSpecs::StartFreq(val) = attr? {
14378                return Ok(val);
14379            }
14380        }
14381        Err(ErrorContext::new_missing(
14382            "SarSpecs",
14383            "StartFreq",
14384            self.orig_loc,
14385            self.buf.as_ptr() as usize,
14386        ))
14387    }
14388    pub fn get_end_freq(&self) -> Result<u32, ErrorContext> {
14389        let mut iter = self.clone();
14390        iter.pos = 0;
14391        for attr in iter {
14392            if let SarSpecs::EndFreq(val) = attr? {
14393                return Ok(val);
14394            }
14395        }
14396        Err(ErrorContext::new_missing(
14397            "SarSpecs",
14398            "EndFreq",
14399            self.orig_loc,
14400            self.buf.as_ptr() as usize,
14401        ))
14402    }
14403}
14404impl SarSpecs {
14405    pub fn new<'a>(buf: &'a [u8]) -> IterableSarSpecs<'a> {
14406        IterableSarSpecs::with_loc(buf, buf.as_ptr() as usize)
14407    }
14408    fn attr_from_type(r#type: u16) -> Option<&'static str> {
14409        let res = match r#type {
14410            1u16 => "Power",
14411            2u16 => "RangeIndex",
14412            3u16 => "StartFreq",
14413            4u16 => "EndFreq",
14414            _ => return None,
14415        };
14416        Some(res)
14417    }
14418}
14419#[derive(Clone, Copy, Default)]
14420pub struct IterableSarSpecs<'a> {
14421    buf: &'a [u8],
14422    pos: usize,
14423    orig_loc: usize,
14424}
14425impl<'a> IterableSarSpecs<'a> {
14426    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14427        Self {
14428            buf,
14429            pos: 0,
14430            orig_loc,
14431        }
14432    }
14433    pub fn get_buf(&self) -> &'a [u8] {
14434        self.buf
14435    }
14436}
14437impl<'a> Iterator for IterableSarSpecs<'a> {
14438    type Item = Result<SarSpecs, ErrorContext>;
14439    fn next(&mut self) -> Option<Self::Item> {
14440        let pos = self.pos;
14441        let mut r#type;
14442        loop {
14443            r#type = None;
14444            if self.buf.len() == self.pos {
14445                return None;
14446            }
14447            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14448                break;
14449            };
14450            r#type = Some(header.r#type);
14451            let res = match header.r#type {
14452                1u16 => SarSpecs::Power({
14453                    let res = parse_i32(next);
14454                    let Some(val) = res else { break };
14455                    val
14456                }),
14457                2u16 => SarSpecs::RangeIndex({
14458                    let res = parse_u32(next);
14459                    let Some(val) = res else { break };
14460                    val
14461                }),
14462                3u16 => SarSpecs::StartFreq({
14463                    let res = parse_u32(next);
14464                    let Some(val) = res else { break };
14465                    val
14466                }),
14467                4u16 => SarSpecs::EndFreq({
14468                    let res = parse_u32(next);
14469                    let Some(val) = res else { break };
14470                    val
14471                }),
14472                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14473                n => continue,
14474            };
14475            return Some(Ok(res));
14476        }
14477        Some(Err(ErrorContext::new(
14478            "SarSpecs",
14479            r#type.and_then(|t| SarSpecs::attr_from_type(t)),
14480            self.orig_loc,
14481            self.buf.as_ptr().wrapping_add(pos) as usize,
14482        )))
14483    }
14484}
14485impl std::fmt::Debug for IterableSarSpecs<'_> {
14486    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14487        let mut fmt = f.debug_struct("SarSpecs");
14488        for attr in self.clone() {
14489            let attr = match attr {
14490                Ok(a) => a,
14491                Err(err) => {
14492                    fmt.finish()?;
14493                    f.write_str("Err(")?;
14494                    err.fmt(f)?;
14495                    return f.write_str(")");
14496                }
14497            };
14498            match attr {
14499                SarSpecs::Power(val) => fmt.field("Power", &val),
14500                SarSpecs::RangeIndex(val) => fmt.field("RangeIndex", &val),
14501                SarSpecs::StartFreq(val) => fmt.field("StartFreq", &val),
14502                SarSpecs::EndFreq(val) => fmt.field("EndFreq", &val),
14503            };
14504        }
14505        fmt.finish()
14506    }
14507}
14508impl IterableSarSpecs<'_> {
14509    pub fn lookup_attr(
14510        &self,
14511        offset: usize,
14512        missing_type: Option<u16>,
14513    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14514        let mut stack = Vec::new();
14515        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14516        if missing_type.is_some() && cur == offset {
14517            stack.push(("SarSpecs", offset));
14518            return (
14519                stack,
14520                missing_type.and_then(|t| SarSpecs::attr_from_type(t)),
14521            );
14522        }
14523        if cur > offset || cur + self.buf.len() < offset {
14524            return (stack, None);
14525        }
14526        let mut attrs = self.clone();
14527        let mut last_off = cur + attrs.pos;
14528        while let Some(attr) = attrs.next() {
14529            let Ok(attr) = attr else { break };
14530            match attr {
14531                SarSpecs::Power(val) => {
14532                    if last_off == offset {
14533                        stack.push(("Power", last_off));
14534                        break;
14535                    }
14536                }
14537                SarSpecs::RangeIndex(val) => {
14538                    if last_off == offset {
14539                        stack.push(("RangeIndex", last_off));
14540                        break;
14541                    }
14542                }
14543                SarSpecs::StartFreq(val) => {
14544                    if last_off == offset {
14545                        stack.push(("StartFreq", last_off));
14546                        break;
14547                    }
14548                }
14549                SarSpecs::EndFreq(val) => {
14550                    if last_off == offset {
14551                        stack.push(("EndFreq", last_off));
14552                        break;
14553                    }
14554                }
14555                _ => {}
14556            };
14557            last_off = cur + attrs.pos;
14558        }
14559        if !stack.is_empty() {
14560            stack.push(("SarSpecs", cur));
14561        }
14562        (stack, None)
14563    }
14564}
14565#[derive(Clone)]
14566pub enum SupportedIftypes {
14567    Adhoc(()),
14568    Station(()),
14569    Ap(()),
14570    ApVlan(()),
14571    Wds(()),
14572    Monitor(()),
14573    MeshPoint(()),
14574    P2pClient(()),
14575    P2pGo(()),
14576    P2pDevice(()),
14577    Ocb(()),
14578    Nan(()),
14579}
14580impl<'a> IterableSupportedIftypes<'a> {
14581    pub fn get_adhoc(&self) -> Result<(), ErrorContext> {
14582        let mut iter = self.clone();
14583        iter.pos = 0;
14584        for attr in iter {
14585            if let SupportedIftypes::Adhoc(val) = attr? {
14586                return Ok(val);
14587            }
14588        }
14589        Err(ErrorContext::new_missing(
14590            "SupportedIftypes",
14591            "Adhoc",
14592            self.orig_loc,
14593            self.buf.as_ptr() as usize,
14594        ))
14595    }
14596    pub fn get_station(&self) -> Result<(), ErrorContext> {
14597        let mut iter = self.clone();
14598        iter.pos = 0;
14599        for attr in iter {
14600            if let SupportedIftypes::Station(val) = attr? {
14601                return Ok(val);
14602            }
14603        }
14604        Err(ErrorContext::new_missing(
14605            "SupportedIftypes",
14606            "Station",
14607            self.orig_loc,
14608            self.buf.as_ptr() as usize,
14609        ))
14610    }
14611    pub fn get_ap(&self) -> Result<(), ErrorContext> {
14612        let mut iter = self.clone();
14613        iter.pos = 0;
14614        for attr in iter {
14615            if let SupportedIftypes::Ap(val) = attr? {
14616                return Ok(val);
14617            }
14618        }
14619        Err(ErrorContext::new_missing(
14620            "SupportedIftypes",
14621            "Ap",
14622            self.orig_loc,
14623            self.buf.as_ptr() as usize,
14624        ))
14625    }
14626    pub fn get_ap_vlan(&self) -> Result<(), ErrorContext> {
14627        let mut iter = self.clone();
14628        iter.pos = 0;
14629        for attr in iter {
14630            if let SupportedIftypes::ApVlan(val) = attr? {
14631                return Ok(val);
14632            }
14633        }
14634        Err(ErrorContext::new_missing(
14635            "SupportedIftypes",
14636            "ApVlan",
14637            self.orig_loc,
14638            self.buf.as_ptr() as usize,
14639        ))
14640    }
14641    pub fn get_wds(&self) -> Result<(), ErrorContext> {
14642        let mut iter = self.clone();
14643        iter.pos = 0;
14644        for attr in iter {
14645            if let SupportedIftypes::Wds(val) = attr? {
14646                return Ok(val);
14647            }
14648        }
14649        Err(ErrorContext::new_missing(
14650            "SupportedIftypes",
14651            "Wds",
14652            self.orig_loc,
14653            self.buf.as_ptr() as usize,
14654        ))
14655    }
14656    pub fn get_monitor(&self) -> Result<(), ErrorContext> {
14657        let mut iter = self.clone();
14658        iter.pos = 0;
14659        for attr in iter {
14660            if let SupportedIftypes::Monitor(val) = attr? {
14661                return Ok(val);
14662            }
14663        }
14664        Err(ErrorContext::new_missing(
14665            "SupportedIftypes",
14666            "Monitor",
14667            self.orig_loc,
14668            self.buf.as_ptr() as usize,
14669        ))
14670    }
14671    pub fn get_mesh_point(&self) -> Result<(), ErrorContext> {
14672        let mut iter = self.clone();
14673        iter.pos = 0;
14674        for attr in iter {
14675            if let SupportedIftypes::MeshPoint(val) = attr? {
14676                return Ok(val);
14677            }
14678        }
14679        Err(ErrorContext::new_missing(
14680            "SupportedIftypes",
14681            "MeshPoint",
14682            self.orig_loc,
14683            self.buf.as_ptr() as usize,
14684        ))
14685    }
14686    pub fn get_p2p_client(&self) -> Result<(), ErrorContext> {
14687        let mut iter = self.clone();
14688        iter.pos = 0;
14689        for attr in iter {
14690            if let SupportedIftypes::P2pClient(val) = attr? {
14691                return Ok(val);
14692            }
14693        }
14694        Err(ErrorContext::new_missing(
14695            "SupportedIftypes",
14696            "P2pClient",
14697            self.orig_loc,
14698            self.buf.as_ptr() as usize,
14699        ))
14700    }
14701    pub fn get_p2p_go(&self) -> Result<(), ErrorContext> {
14702        let mut iter = self.clone();
14703        iter.pos = 0;
14704        for attr in iter {
14705            if let SupportedIftypes::P2pGo(val) = attr? {
14706                return Ok(val);
14707            }
14708        }
14709        Err(ErrorContext::new_missing(
14710            "SupportedIftypes",
14711            "P2pGo",
14712            self.orig_loc,
14713            self.buf.as_ptr() as usize,
14714        ))
14715    }
14716    pub fn get_p2p_device(&self) -> Result<(), ErrorContext> {
14717        let mut iter = self.clone();
14718        iter.pos = 0;
14719        for attr in iter {
14720            if let SupportedIftypes::P2pDevice(val) = attr? {
14721                return Ok(val);
14722            }
14723        }
14724        Err(ErrorContext::new_missing(
14725            "SupportedIftypes",
14726            "P2pDevice",
14727            self.orig_loc,
14728            self.buf.as_ptr() as usize,
14729        ))
14730    }
14731    pub fn get_ocb(&self) -> Result<(), ErrorContext> {
14732        let mut iter = self.clone();
14733        iter.pos = 0;
14734        for attr in iter {
14735            if let SupportedIftypes::Ocb(val) = attr? {
14736                return Ok(val);
14737            }
14738        }
14739        Err(ErrorContext::new_missing(
14740            "SupportedIftypes",
14741            "Ocb",
14742            self.orig_loc,
14743            self.buf.as_ptr() as usize,
14744        ))
14745    }
14746    pub fn get_nan(&self) -> Result<(), ErrorContext> {
14747        let mut iter = self.clone();
14748        iter.pos = 0;
14749        for attr in iter {
14750            if let SupportedIftypes::Nan(val) = attr? {
14751                return Ok(val);
14752            }
14753        }
14754        Err(ErrorContext::new_missing(
14755            "SupportedIftypes",
14756            "Nan",
14757            self.orig_loc,
14758            self.buf.as_ptr() as usize,
14759        ))
14760    }
14761}
14762impl SupportedIftypes {
14763    pub fn new<'a>(buf: &'a [u8]) -> IterableSupportedIftypes<'a> {
14764        IterableSupportedIftypes::with_loc(buf, buf.as_ptr() as usize)
14765    }
14766    fn attr_from_type(r#type: u16) -> Option<&'static str> {
14767        let res = match r#type {
14768            1u16 => "Adhoc",
14769            2u16 => "Station",
14770            3u16 => "Ap",
14771            4u16 => "ApVlan",
14772            5u16 => "Wds",
14773            6u16 => "Monitor",
14774            7u16 => "MeshPoint",
14775            8u16 => "P2pClient",
14776            9u16 => "P2pGo",
14777            10u16 => "P2pDevice",
14778            11u16 => "Ocb",
14779            12u16 => "Nan",
14780            _ => return None,
14781        };
14782        Some(res)
14783    }
14784}
14785#[derive(Clone, Copy, Default)]
14786pub struct IterableSupportedIftypes<'a> {
14787    buf: &'a [u8],
14788    pos: usize,
14789    orig_loc: usize,
14790}
14791impl<'a> IterableSupportedIftypes<'a> {
14792    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14793        Self {
14794            buf,
14795            pos: 0,
14796            orig_loc,
14797        }
14798    }
14799    pub fn get_buf(&self) -> &'a [u8] {
14800        self.buf
14801    }
14802}
14803impl<'a> Iterator for IterableSupportedIftypes<'a> {
14804    type Item = Result<SupportedIftypes, ErrorContext>;
14805    fn next(&mut self) -> Option<Self::Item> {
14806        let pos = self.pos;
14807        let mut r#type;
14808        loop {
14809            r#type = None;
14810            if self.buf.len() == self.pos {
14811                return None;
14812            }
14813            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14814                break;
14815            };
14816            r#type = Some(header.r#type);
14817            let res = match header.r#type {
14818                1u16 => SupportedIftypes::Adhoc(()),
14819                2u16 => SupportedIftypes::Station(()),
14820                3u16 => SupportedIftypes::Ap(()),
14821                4u16 => SupportedIftypes::ApVlan(()),
14822                5u16 => SupportedIftypes::Wds(()),
14823                6u16 => SupportedIftypes::Monitor(()),
14824                7u16 => SupportedIftypes::MeshPoint(()),
14825                8u16 => SupportedIftypes::P2pClient(()),
14826                9u16 => SupportedIftypes::P2pGo(()),
14827                10u16 => SupportedIftypes::P2pDevice(()),
14828                11u16 => SupportedIftypes::Ocb(()),
14829                12u16 => SupportedIftypes::Nan(()),
14830                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14831                n => continue,
14832            };
14833            return Some(Ok(res));
14834        }
14835        Some(Err(ErrorContext::new(
14836            "SupportedIftypes",
14837            r#type.and_then(|t| SupportedIftypes::attr_from_type(t)),
14838            self.orig_loc,
14839            self.buf.as_ptr().wrapping_add(pos) as usize,
14840        )))
14841    }
14842}
14843impl std::fmt::Debug for IterableSupportedIftypes<'_> {
14844    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14845        let mut fmt = f.debug_struct("SupportedIftypes");
14846        for attr in self.clone() {
14847            let attr = match attr {
14848                Ok(a) => a,
14849                Err(err) => {
14850                    fmt.finish()?;
14851                    f.write_str("Err(")?;
14852                    err.fmt(f)?;
14853                    return f.write_str(")");
14854                }
14855            };
14856            match attr {
14857                SupportedIftypes::Adhoc(val) => fmt.field("Adhoc", &val),
14858                SupportedIftypes::Station(val) => fmt.field("Station", &val),
14859                SupportedIftypes::Ap(val) => fmt.field("Ap", &val),
14860                SupportedIftypes::ApVlan(val) => fmt.field("ApVlan", &val),
14861                SupportedIftypes::Wds(val) => fmt.field("Wds", &val),
14862                SupportedIftypes::Monitor(val) => fmt.field("Monitor", &val),
14863                SupportedIftypes::MeshPoint(val) => fmt.field("MeshPoint", &val),
14864                SupportedIftypes::P2pClient(val) => fmt.field("P2pClient", &val),
14865                SupportedIftypes::P2pGo(val) => fmt.field("P2pGo", &val),
14866                SupportedIftypes::P2pDevice(val) => fmt.field("P2pDevice", &val),
14867                SupportedIftypes::Ocb(val) => fmt.field("Ocb", &val),
14868                SupportedIftypes::Nan(val) => fmt.field("Nan", &val),
14869            };
14870        }
14871        fmt.finish()
14872    }
14873}
14874impl IterableSupportedIftypes<'_> {
14875    pub fn lookup_attr(
14876        &self,
14877        offset: usize,
14878        missing_type: Option<u16>,
14879    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14880        let mut stack = Vec::new();
14881        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14882        if missing_type.is_some() && cur == offset {
14883            stack.push(("SupportedIftypes", offset));
14884            return (
14885                stack,
14886                missing_type.and_then(|t| SupportedIftypes::attr_from_type(t)),
14887            );
14888        }
14889        if cur > offset || cur + self.buf.len() < offset {
14890            return (stack, None);
14891        }
14892        let mut attrs = self.clone();
14893        let mut last_off = cur + attrs.pos;
14894        while let Some(attr) = attrs.next() {
14895            let Ok(attr) = attr else { break };
14896            match attr {
14897                SupportedIftypes::Adhoc(val) => {
14898                    if last_off == offset {
14899                        stack.push(("Adhoc", last_off));
14900                        break;
14901                    }
14902                }
14903                SupportedIftypes::Station(val) => {
14904                    if last_off == offset {
14905                        stack.push(("Station", last_off));
14906                        break;
14907                    }
14908                }
14909                SupportedIftypes::Ap(val) => {
14910                    if last_off == offset {
14911                        stack.push(("Ap", last_off));
14912                        break;
14913                    }
14914                }
14915                SupportedIftypes::ApVlan(val) => {
14916                    if last_off == offset {
14917                        stack.push(("ApVlan", last_off));
14918                        break;
14919                    }
14920                }
14921                SupportedIftypes::Wds(val) => {
14922                    if last_off == offset {
14923                        stack.push(("Wds", last_off));
14924                        break;
14925                    }
14926                }
14927                SupportedIftypes::Monitor(val) => {
14928                    if last_off == offset {
14929                        stack.push(("Monitor", last_off));
14930                        break;
14931                    }
14932                }
14933                SupportedIftypes::MeshPoint(val) => {
14934                    if last_off == offset {
14935                        stack.push(("MeshPoint", last_off));
14936                        break;
14937                    }
14938                }
14939                SupportedIftypes::P2pClient(val) => {
14940                    if last_off == offset {
14941                        stack.push(("P2pClient", last_off));
14942                        break;
14943                    }
14944                }
14945                SupportedIftypes::P2pGo(val) => {
14946                    if last_off == offset {
14947                        stack.push(("P2pGo", last_off));
14948                        break;
14949                    }
14950                }
14951                SupportedIftypes::P2pDevice(val) => {
14952                    if last_off == offset {
14953                        stack.push(("P2pDevice", last_off));
14954                        break;
14955                    }
14956                }
14957                SupportedIftypes::Ocb(val) => {
14958                    if last_off == offset {
14959                        stack.push(("Ocb", last_off));
14960                        break;
14961                    }
14962                }
14963                SupportedIftypes::Nan(val) => {
14964                    if last_off == offset {
14965                        stack.push(("Nan", last_off));
14966                        break;
14967                    }
14968                }
14969                _ => {}
14970            };
14971            last_off = cur + attrs.pos;
14972        }
14973        if !stack.is_empty() {
14974            stack.push(("SupportedIftypes", cur));
14975        }
14976        (stack, None)
14977    }
14978}
14979#[derive(Clone)]
14980pub enum TxqStatsAttrs {
14981    BacklogBytes(u32),
14982    BacklogPackets(u32),
14983    Flows(u32),
14984    Drops(u32),
14985    EcnMarks(u32),
14986    Overlimit(u32),
14987    Overmemory(u32),
14988    Collisions(u32),
14989    TxBytes(u32),
14990    TxPackets(u32),
14991    MaxFlows(u32),
14992}
14993impl<'a> IterableTxqStatsAttrs<'a> {
14994    pub fn get_backlog_bytes(&self) -> Result<u32, ErrorContext> {
14995        let mut iter = self.clone();
14996        iter.pos = 0;
14997        for attr in iter {
14998            if let TxqStatsAttrs::BacklogBytes(val) = attr? {
14999                return Ok(val);
15000            }
15001        }
15002        Err(ErrorContext::new_missing(
15003            "TxqStatsAttrs",
15004            "BacklogBytes",
15005            self.orig_loc,
15006            self.buf.as_ptr() as usize,
15007        ))
15008    }
15009    pub fn get_backlog_packets(&self) -> Result<u32, ErrorContext> {
15010        let mut iter = self.clone();
15011        iter.pos = 0;
15012        for attr in iter {
15013            if let TxqStatsAttrs::BacklogPackets(val) = attr? {
15014                return Ok(val);
15015            }
15016        }
15017        Err(ErrorContext::new_missing(
15018            "TxqStatsAttrs",
15019            "BacklogPackets",
15020            self.orig_loc,
15021            self.buf.as_ptr() as usize,
15022        ))
15023    }
15024    pub fn get_flows(&self) -> Result<u32, ErrorContext> {
15025        let mut iter = self.clone();
15026        iter.pos = 0;
15027        for attr in iter {
15028            if let TxqStatsAttrs::Flows(val) = attr? {
15029                return Ok(val);
15030            }
15031        }
15032        Err(ErrorContext::new_missing(
15033            "TxqStatsAttrs",
15034            "Flows",
15035            self.orig_loc,
15036            self.buf.as_ptr() as usize,
15037        ))
15038    }
15039    pub fn get_drops(&self) -> Result<u32, ErrorContext> {
15040        let mut iter = self.clone();
15041        iter.pos = 0;
15042        for attr in iter {
15043            if let TxqStatsAttrs::Drops(val) = attr? {
15044                return Ok(val);
15045            }
15046        }
15047        Err(ErrorContext::new_missing(
15048            "TxqStatsAttrs",
15049            "Drops",
15050            self.orig_loc,
15051            self.buf.as_ptr() as usize,
15052        ))
15053    }
15054    pub fn get_ecn_marks(&self) -> Result<u32, ErrorContext> {
15055        let mut iter = self.clone();
15056        iter.pos = 0;
15057        for attr in iter {
15058            if let TxqStatsAttrs::EcnMarks(val) = attr? {
15059                return Ok(val);
15060            }
15061        }
15062        Err(ErrorContext::new_missing(
15063            "TxqStatsAttrs",
15064            "EcnMarks",
15065            self.orig_loc,
15066            self.buf.as_ptr() as usize,
15067        ))
15068    }
15069    pub fn get_overlimit(&self) -> Result<u32, ErrorContext> {
15070        let mut iter = self.clone();
15071        iter.pos = 0;
15072        for attr in iter {
15073            if let TxqStatsAttrs::Overlimit(val) = attr? {
15074                return Ok(val);
15075            }
15076        }
15077        Err(ErrorContext::new_missing(
15078            "TxqStatsAttrs",
15079            "Overlimit",
15080            self.orig_loc,
15081            self.buf.as_ptr() as usize,
15082        ))
15083    }
15084    pub fn get_overmemory(&self) -> Result<u32, ErrorContext> {
15085        let mut iter = self.clone();
15086        iter.pos = 0;
15087        for attr in iter {
15088            if let TxqStatsAttrs::Overmemory(val) = attr? {
15089                return Ok(val);
15090            }
15091        }
15092        Err(ErrorContext::new_missing(
15093            "TxqStatsAttrs",
15094            "Overmemory",
15095            self.orig_loc,
15096            self.buf.as_ptr() as usize,
15097        ))
15098    }
15099    pub fn get_collisions(&self) -> Result<u32, ErrorContext> {
15100        let mut iter = self.clone();
15101        iter.pos = 0;
15102        for attr in iter {
15103            if let TxqStatsAttrs::Collisions(val) = attr? {
15104                return Ok(val);
15105            }
15106        }
15107        Err(ErrorContext::new_missing(
15108            "TxqStatsAttrs",
15109            "Collisions",
15110            self.orig_loc,
15111            self.buf.as_ptr() as usize,
15112        ))
15113    }
15114    pub fn get_tx_bytes(&self) -> Result<u32, ErrorContext> {
15115        let mut iter = self.clone();
15116        iter.pos = 0;
15117        for attr in iter {
15118            if let TxqStatsAttrs::TxBytes(val) = attr? {
15119                return Ok(val);
15120            }
15121        }
15122        Err(ErrorContext::new_missing(
15123            "TxqStatsAttrs",
15124            "TxBytes",
15125            self.orig_loc,
15126            self.buf.as_ptr() as usize,
15127        ))
15128    }
15129    pub fn get_tx_packets(&self) -> Result<u32, ErrorContext> {
15130        let mut iter = self.clone();
15131        iter.pos = 0;
15132        for attr in iter {
15133            if let TxqStatsAttrs::TxPackets(val) = attr? {
15134                return Ok(val);
15135            }
15136        }
15137        Err(ErrorContext::new_missing(
15138            "TxqStatsAttrs",
15139            "TxPackets",
15140            self.orig_loc,
15141            self.buf.as_ptr() as usize,
15142        ))
15143    }
15144    pub fn get_max_flows(&self) -> Result<u32, ErrorContext> {
15145        let mut iter = self.clone();
15146        iter.pos = 0;
15147        for attr in iter {
15148            if let TxqStatsAttrs::MaxFlows(val) = attr? {
15149                return Ok(val);
15150            }
15151        }
15152        Err(ErrorContext::new_missing(
15153            "TxqStatsAttrs",
15154            "MaxFlows",
15155            self.orig_loc,
15156            self.buf.as_ptr() as usize,
15157        ))
15158    }
15159}
15160impl TxqStatsAttrs {
15161    pub fn new<'a>(buf: &'a [u8]) -> IterableTxqStatsAttrs<'a> {
15162        IterableTxqStatsAttrs::with_loc(buf, buf.as_ptr() as usize)
15163    }
15164    fn attr_from_type(r#type: u16) -> Option<&'static str> {
15165        let res = match r#type {
15166            1u16 => "BacklogBytes",
15167            2u16 => "BacklogPackets",
15168            3u16 => "Flows",
15169            4u16 => "Drops",
15170            5u16 => "EcnMarks",
15171            6u16 => "Overlimit",
15172            7u16 => "Overmemory",
15173            8u16 => "Collisions",
15174            9u16 => "TxBytes",
15175            10u16 => "TxPackets",
15176            11u16 => "MaxFlows",
15177            _ => return None,
15178        };
15179        Some(res)
15180    }
15181}
15182#[derive(Clone, Copy, Default)]
15183pub struct IterableTxqStatsAttrs<'a> {
15184    buf: &'a [u8],
15185    pos: usize,
15186    orig_loc: usize,
15187}
15188impl<'a> IterableTxqStatsAttrs<'a> {
15189    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
15190        Self {
15191            buf,
15192            pos: 0,
15193            orig_loc,
15194        }
15195    }
15196    pub fn get_buf(&self) -> &'a [u8] {
15197        self.buf
15198    }
15199}
15200impl<'a> Iterator for IterableTxqStatsAttrs<'a> {
15201    type Item = Result<TxqStatsAttrs, ErrorContext>;
15202    fn next(&mut self) -> Option<Self::Item> {
15203        let pos = self.pos;
15204        let mut r#type;
15205        loop {
15206            r#type = None;
15207            if self.buf.len() == self.pos {
15208                return None;
15209            }
15210            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
15211                break;
15212            };
15213            r#type = Some(header.r#type);
15214            let res = match header.r#type {
15215                1u16 => TxqStatsAttrs::BacklogBytes({
15216                    let res = parse_u32(next);
15217                    let Some(val) = res else { break };
15218                    val
15219                }),
15220                2u16 => TxqStatsAttrs::BacklogPackets({
15221                    let res = parse_u32(next);
15222                    let Some(val) = res else { break };
15223                    val
15224                }),
15225                3u16 => TxqStatsAttrs::Flows({
15226                    let res = parse_u32(next);
15227                    let Some(val) = res else { break };
15228                    val
15229                }),
15230                4u16 => TxqStatsAttrs::Drops({
15231                    let res = parse_u32(next);
15232                    let Some(val) = res else { break };
15233                    val
15234                }),
15235                5u16 => TxqStatsAttrs::EcnMarks({
15236                    let res = parse_u32(next);
15237                    let Some(val) = res else { break };
15238                    val
15239                }),
15240                6u16 => TxqStatsAttrs::Overlimit({
15241                    let res = parse_u32(next);
15242                    let Some(val) = res else { break };
15243                    val
15244                }),
15245                7u16 => TxqStatsAttrs::Overmemory({
15246                    let res = parse_u32(next);
15247                    let Some(val) = res else { break };
15248                    val
15249                }),
15250                8u16 => TxqStatsAttrs::Collisions({
15251                    let res = parse_u32(next);
15252                    let Some(val) = res else { break };
15253                    val
15254                }),
15255                9u16 => TxqStatsAttrs::TxBytes({
15256                    let res = parse_u32(next);
15257                    let Some(val) = res else { break };
15258                    val
15259                }),
15260                10u16 => TxqStatsAttrs::TxPackets({
15261                    let res = parse_u32(next);
15262                    let Some(val) = res else { break };
15263                    val
15264                }),
15265                11u16 => TxqStatsAttrs::MaxFlows({
15266                    let res = parse_u32(next);
15267                    let Some(val) = res else { break };
15268                    val
15269                }),
15270                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
15271                n => continue,
15272            };
15273            return Some(Ok(res));
15274        }
15275        Some(Err(ErrorContext::new(
15276            "TxqStatsAttrs",
15277            r#type.and_then(|t| TxqStatsAttrs::attr_from_type(t)),
15278            self.orig_loc,
15279            self.buf.as_ptr().wrapping_add(pos) as usize,
15280        )))
15281    }
15282}
15283impl std::fmt::Debug for IterableTxqStatsAttrs<'_> {
15284    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15285        let mut fmt = f.debug_struct("TxqStatsAttrs");
15286        for attr in self.clone() {
15287            let attr = match attr {
15288                Ok(a) => a,
15289                Err(err) => {
15290                    fmt.finish()?;
15291                    f.write_str("Err(")?;
15292                    err.fmt(f)?;
15293                    return f.write_str(")");
15294                }
15295            };
15296            match attr {
15297                TxqStatsAttrs::BacklogBytes(val) => fmt.field("BacklogBytes", &val),
15298                TxqStatsAttrs::BacklogPackets(val) => fmt.field("BacklogPackets", &val),
15299                TxqStatsAttrs::Flows(val) => fmt.field("Flows", &val),
15300                TxqStatsAttrs::Drops(val) => fmt.field("Drops", &val),
15301                TxqStatsAttrs::EcnMarks(val) => fmt.field("EcnMarks", &val),
15302                TxqStatsAttrs::Overlimit(val) => fmt.field("Overlimit", &val),
15303                TxqStatsAttrs::Overmemory(val) => fmt.field("Overmemory", &val),
15304                TxqStatsAttrs::Collisions(val) => fmt.field("Collisions", &val),
15305                TxqStatsAttrs::TxBytes(val) => fmt.field("TxBytes", &val),
15306                TxqStatsAttrs::TxPackets(val) => fmt.field("TxPackets", &val),
15307                TxqStatsAttrs::MaxFlows(val) => fmt.field("MaxFlows", &val),
15308            };
15309        }
15310        fmt.finish()
15311    }
15312}
15313impl IterableTxqStatsAttrs<'_> {
15314    pub fn lookup_attr(
15315        &self,
15316        offset: usize,
15317        missing_type: Option<u16>,
15318    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
15319        let mut stack = Vec::new();
15320        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
15321        if missing_type.is_some() && cur == offset {
15322            stack.push(("TxqStatsAttrs", offset));
15323            return (
15324                stack,
15325                missing_type.and_then(|t| TxqStatsAttrs::attr_from_type(t)),
15326            );
15327        }
15328        if cur > offset || cur + self.buf.len() < offset {
15329            return (stack, None);
15330        }
15331        let mut attrs = self.clone();
15332        let mut last_off = cur + attrs.pos;
15333        while let Some(attr) = attrs.next() {
15334            let Ok(attr) = attr else { break };
15335            match attr {
15336                TxqStatsAttrs::BacklogBytes(val) => {
15337                    if last_off == offset {
15338                        stack.push(("BacklogBytes", last_off));
15339                        break;
15340                    }
15341                }
15342                TxqStatsAttrs::BacklogPackets(val) => {
15343                    if last_off == offset {
15344                        stack.push(("BacklogPackets", last_off));
15345                        break;
15346                    }
15347                }
15348                TxqStatsAttrs::Flows(val) => {
15349                    if last_off == offset {
15350                        stack.push(("Flows", last_off));
15351                        break;
15352                    }
15353                }
15354                TxqStatsAttrs::Drops(val) => {
15355                    if last_off == offset {
15356                        stack.push(("Drops", last_off));
15357                        break;
15358                    }
15359                }
15360                TxqStatsAttrs::EcnMarks(val) => {
15361                    if last_off == offset {
15362                        stack.push(("EcnMarks", last_off));
15363                        break;
15364                    }
15365                }
15366                TxqStatsAttrs::Overlimit(val) => {
15367                    if last_off == offset {
15368                        stack.push(("Overlimit", last_off));
15369                        break;
15370                    }
15371                }
15372                TxqStatsAttrs::Overmemory(val) => {
15373                    if last_off == offset {
15374                        stack.push(("Overmemory", last_off));
15375                        break;
15376                    }
15377                }
15378                TxqStatsAttrs::Collisions(val) => {
15379                    if last_off == offset {
15380                        stack.push(("Collisions", last_off));
15381                        break;
15382                    }
15383                }
15384                TxqStatsAttrs::TxBytes(val) => {
15385                    if last_off == offset {
15386                        stack.push(("TxBytes", last_off));
15387                        break;
15388                    }
15389                }
15390                TxqStatsAttrs::TxPackets(val) => {
15391                    if last_off == offset {
15392                        stack.push(("TxPackets", last_off));
15393                        break;
15394                    }
15395                }
15396                TxqStatsAttrs::MaxFlows(val) => {
15397                    if last_off == offset {
15398                        stack.push(("MaxFlows", last_off));
15399                        break;
15400                    }
15401                }
15402                _ => {}
15403            };
15404            last_off = cur + attrs.pos;
15405        }
15406        if !stack.is_empty() {
15407            stack.push(("TxqStatsAttrs", cur));
15408        }
15409        (stack, None)
15410    }
15411}
15412#[derive(Clone)]
15413pub enum WmmAttrs {
15414    CwMin(u16),
15415    CwMax(u16),
15416    Aifsn(u8),
15417    Txop(u16),
15418}
15419impl<'a> IterableWmmAttrs<'a> {
15420    pub fn get_cw_min(&self) -> Result<u16, ErrorContext> {
15421        let mut iter = self.clone();
15422        iter.pos = 0;
15423        for attr in iter {
15424            if let WmmAttrs::CwMin(val) = attr? {
15425                return Ok(val);
15426            }
15427        }
15428        Err(ErrorContext::new_missing(
15429            "WmmAttrs",
15430            "CwMin",
15431            self.orig_loc,
15432            self.buf.as_ptr() as usize,
15433        ))
15434    }
15435    pub fn get_cw_max(&self) -> Result<u16, ErrorContext> {
15436        let mut iter = self.clone();
15437        iter.pos = 0;
15438        for attr in iter {
15439            if let WmmAttrs::CwMax(val) = attr? {
15440                return Ok(val);
15441            }
15442        }
15443        Err(ErrorContext::new_missing(
15444            "WmmAttrs",
15445            "CwMax",
15446            self.orig_loc,
15447            self.buf.as_ptr() as usize,
15448        ))
15449    }
15450    pub fn get_aifsn(&self) -> Result<u8, ErrorContext> {
15451        let mut iter = self.clone();
15452        iter.pos = 0;
15453        for attr in iter {
15454            if let WmmAttrs::Aifsn(val) = attr? {
15455                return Ok(val);
15456            }
15457        }
15458        Err(ErrorContext::new_missing(
15459            "WmmAttrs",
15460            "Aifsn",
15461            self.orig_loc,
15462            self.buf.as_ptr() as usize,
15463        ))
15464    }
15465    pub fn get_txop(&self) -> Result<u16, ErrorContext> {
15466        let mut iter = self.clone();
15467        iter.pos = 0;
15468        for attr in iter {
15469            if let WmmAttrs::Txop(val) = attr? {
15470                return Ok(val);
15471            }
15472        }
15473        Err(ErrorContext::new_missing(
15474            "WmmAttrs",
15475            "Txop",
15476            self.orig_loc,
15477            self.buf.as_ptr() as usize,
15478        ))
15479    }
15480}
15481impl WmmAttrs {
15482    pub fn new<'a>(buf: &'a [u8]) -> IterableWmmAttrs<'a> {
15483        IterableWmmAttrs::with_loc(buf, buf.as_ptr() as usize)
15484    }
15485    fn attr_from_type(r#type: u16) -> Option<&'static str> {
15486        let res = match r#type {
15487            1u16 => "CwMin",
15488            2u16 => "CwMax",
15489            3u16 => "Aifsn",
15490            4u16 => "Txop",
15491            _ => return None,
15492        };
15493        Some(res)
15494    }
15495}
15496#[derive(Clone, Copy, Default)]
15497pub struct IterableWmmAttrs<'a> {
15498    buf: &'a [u8],
15499    pos: usize,
15500    orig_loc: usize,
15501}
15502impl<'a> IterableWmmAttrs<'a> {
15503    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
15504        Self {
15505            buf,
15506            pos: 0,
15507            orig_loc,
15508        }
15509    }
15510    pub fn get_buf(&self) -> &'a [u8] {
15511        self.buf
15512    }
15513}
15514impl<'a> Iterator for IterableWmmAttrs<'a> {
15515    type Item = Result<WmmAttrs, ErrorContext>;
15516    fn next(&mut self) -> Option<Self::Item> {
15517        let pos = self.pos;
15518        let mut r#type;
15519        loop {
15520            r#type = None;
15521            if self.buf.len() == self.pos {
15522                return None;
15523            }
15524            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
15525                break;
15526            };
15527            r#type = Some(header.r#type);
15528            let res = match header.r#type {
15529                1u16 => WmmAttrs::CwMin({
15530                    let res = parse_u16(next);
15531                    let Some(val) = res else { break };
15532                    val
15533                }),
15534                2u16 => WmmAttrs::CwMax({
15535                    let res = parse_u16(next);
15536                    let Some(val) = res else { break };
15537                    val
15538                }),
15539                3u16 => WmmAttrs::Aifsn({
15540                    let res = parse_u8(next);
15541                    let Some(val) = res else { break };
15542                    val
15543                }),
15544                4u16 => WmmAttrs::Txop({
15545                    let res = parse_u16(next);
15546                    let Some(val) = res else { break };
15547                    val
15548                }),
15549                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
15550                n => continue,
15551            };
15552            return Some(Ok(res));
15553        }
15554        Some(Err(ErrorContext::new(
15555            "WmmAttrs",
15556            r#type.and_then(|t| WmmAttrs::attr_from_type(t)),
15557            self.orig_loc,
15558            self.buf.as_ptr().wrapping_add(pos) as usize,
15559        )))
15560    }
15561}
15562impl std::fmt::Debug for IterableWmmAttrs<'_> {
15563    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15564        let mut fmt = f.debug_struct("WmmAttrs");
15565        for attr in self.clone() {
15566            let attr = match attr {
15567                Ok(a) => a,
15568                Err(err) => {
15569                    fmt.finish()?;
15570                    f.write_str("Err(")?;
15571                    err.fmt(f)?;
15572                    return f.write_str(")");
15573                }
15574            };
15575            match attr {
15576                WmmAttrs::CwMin(val) => fmt.field("CwMin", &val),
15577                WmmAttrs::CwMax(val) => fmt.field("CwMax", &val),
15578                WmmAttrs::Aifsn(val) => fmt.field("Aifsn", &val),
15579                WmmAttrs::Txop(val) => fmt.field("Txop", &val),
15580            };
15581        }
15582        fmt.finish()
15583    }
15584}
15585impl IterableWmmAttrs<'_> {
15586    pub fn lookup_attr(
15587        &self,
15588        offset: usize,
15589        missing_type: Option<u16>,
15590    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
15591        let mut stack = Vec::new();
15592        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
15593        if missing_type.is_some() && cur == offset {
15594            stack.push(("WmmAttrs", offset));
15595            return (
15596                stack,
15597                missing_type.and_then(|t| WmmAttrs::attr_from_type(t)),
15598            );
15599        }
15600        if cur > offset || cur + self.buf.len() < offset {
15601            return (stack, None);
15602        }
15603        let mut attrs = self.clone();
15604        let mut last_off = cur + attrs.pos;
15605        while let Some(attr) = attrs.next() {
15606            let Ok(attr) = attr else { break };
15607            match attr {
15608                WmmAttrs::CwMin(val) => {
15609                    if last_off == offset {
15610                        stack.push(("CwMin", last_off));
15611                        break;
15612                    }
15613                }
15614                WmmAttrs::CwMax(val) => {
15615                    if last_off == offset {
15616                        stack.push(("CwMax", last_off));
15617                        break;
15618                    }
15619                }
15620                WmmAttrs::Aifsn(val) => {
15621                    if last_off == offset {
15622                        stack.push(("Aifsn", last_off));
15623                        break;
15624                    }
15625                }
15626                WmmAttrs::Txop(val) => {
15627                    if last_off == offset {
15628                        stack.push(("Txop", last_off));
15629                        break;
15630                    }
15631                }
15632                _ => {}
15633            };
15634            last_off = cur + attrs.pos;
15635        }
15636        if !stack.is_empty() {
15637            stack.push(("WmmAttrs", cur));
15638        }
15639        (stack, None)
15640    }
15641}
15642#[derive(Clone)]
15643pub enum WowlanTriggersAttrs {
15644    Any(()),
15645    Disconnect(()),
15646    MagicPkt(()),
15647    PktPattern(()),
15648    GtkRekeySupported(()),
15649    GtkRekeyFailure(()),
15650    EapIdentRequest(()),
15651    _4wayHandshake(()),
15652    RfkillRelease(()),
15653    WakeupPkt80211(()),
15654    WakeupPkt80211Len(()),
15655    WakeupPkt8023(()),
15656    WakeupPkt8023Len(()),
15657    TcpConnection(()),
15658    WakeupTcpMatch(()),
15659    WakeupTcpConnlost(()),
15660    WakeupTcpNomoretokens(()),
15661    NetDetect(()),
15662    NetDetectResults(()),
15663    UnprotectedDeauthDisassoc(()),
15664}
15665impl<'a> IterableWowlanTriggersAttrs<'a> {
15666    pub fn get_any(&self) -> Result<(), ErrorContext> {
15667        let mut iter = self.clone();
15668        iter.pos = 0;
15669        for attr in iter {
15670            if let WowlanTriggersAttrs::Any(val) = attr? {
15671                return Ok(val);
15672            }
15673        }
15674        Err(ErrorContext::new_missing(
15675            "WowlanTriggersAttrs",
15676            "Any",
15677            self.orig_loc,
15678            self.buf.as_ptr() as usize,
15679        ))
15680    }
15681    pub fn get_disconnect(&self) -> Result<(), ErrorContext> {
15682        let mut iter = self.clone();
15683        iter.pos = 0;
15684        for attr in iter {
15685            if let WowlanTriggersAttrs::Disconnect(val) = attr? {
15686                return Ok(val);
15687            }
15688        }
15689        Err(ErrorContext::new_missing(
15690            "WowlanTriggersAttrs",
15691            "Disconnect",
15692            self.orig_loc,
15693            self.buf.as_ptr() as usize,
15694        ))
15695    }
15696    pub fn get_magic_pkt(&self) -> Result<(), ErrorContext> {
15697        let mut iter = self.clone();
15698        iter.pos = 0;
15699        for attr in iter {
15700            if let WowlanTriggersAttrs::MagicPkt(val) = attr? {
15701                return Ok(val);
15702            }
15703        }
15704        Err(ErrorContext::new_missing(
15705            "WowlanTriggersAttrs",
15706            "MagicPkt",
15707            self.orig_loc,
15708            self.buf.as_ptr() as usize,
15709        ))
15710    }
15711    pub fn get_pkt_pattern(&self) -> Result<(), ErrorContext> {
15712        let mut iter = self.clone();
15713        iter.pos = 0;
15714        for attr in iter {
15715            if let WowlanTriggersAttrs::PktPattern(val) = attr? {
15716                return Ok(val);
15717            }
15718        }
15719        Err(ErrorContext::new_missing(
15720            "WowlanTriggersAttrs",
15721            "PktPattern",
15722            self.orig_loc,
15723            self.buf.as_ptr() as usize,
15724        ))
15725    }
15726    pub fn get_gtk_rekey_supported(&self) -> Result<(), ErrorContext> {
15727        let mut iter = self.clone();
15728        iter.pos = 0;
15729        for attr in iter {
15730            if let WowlanTriggersAttrs::GtkRekeySupported(val) = attr? {
15731                return Ok(val);
15732            }
15733        }
15734        Err(ErrorContext::new_missing(
15735            "WowlanTriggersAttrs",
15736            "GtkRekeySupported",
15737            self.orig_loc,
15738            self.buf.as_ptr() as usize,
15739        ))
15740    }
15741    pub fn get_gtk_rekey_failure(&self) -> Result<(), ErrorContext> {
15742        let mut iter = self.clone();
15743        iter.pos = 0;
15744        for attr in iter {
15745            if let WowlanTriggersAttrs::GtkRekeyFailure(val) = attr? {
15746                return Ok(val);
15747            }
15748        }
15749        Err(ErrorContext::new_missing(
15750            "WowlanTriggersAttrs",
15751            "GtkRekeyFailure",
15752            self.orig_loc,
15753            self.buf.as_ptr() as usize,
15754        ))
15755    }
15756    pub fn get_eap_ident_request(&self) -> Result<(), ErrorContext> {
15757        let mut iter = self.clone();
15758        iter.pos = 0;
15759        for attr in iter {
15760            if let WowlanTriggersAttrs::EapIdentRequest(val) = attr? {
15761                return Ok(val);
15762            }
15763        }
15764        Err(ErrorContext::new_missing(
15765            "WowlanTriggersAttrs",
15766            "EapIdentRequest",
15767            self.orig_loc,
15768            self.buf.as_ptr() as usize,
15769        ))
15770    }
15771    pub fn get_4way_handshake(&self) -> Result<(), ErrorContext> {
15772        let mut iter = self.clone();
15773        iter.pos = 0;
15774        for attr in iter {
15775            if let WowlanTriggersAttrs::_4wayHandshake(val) = attr? {
15776                return Ok(val);
15777            }
15778        }
15779        Err(ErrorContext::new_missing(
15780            "WowlanTriggersAttrs",
15781            "4wayHandshake",
15782            self.orig_loc,
15783            self.buf.as_ptr() as usize,
15784        ))
15785    }
15786    pub fn get_rfkill_release(&self) -> Result<(), ErrorContext> {
15787        let mut iter = self.clone();
15788        iter.pos = 0;
15789        for attr in iter {
15790            if let WowlanTriggersAttrs::RfkillRelease(val) = attr? {
15791                return Ok(val);
15792            }
15793        }
15794        Err(ErrorContext::new_missing(
15795            "WowlanTriggersAttrs",
15796            "RfkillRelease",
15797            self.orig_loc,
15798            self.buf.as_ptr() as usize,
15799        ))
15800    }
15801    pub fn get_wakeup_pkt_80211(&self) -> Result<(), ErrorContext> {
15802        let mut iter = self.clone();
15803        iter.pos = 0;
15804        for attr in iter {
15805            if let WowlanTriggersAttrs::WakeupPkt80211(val) = attr? {
15806                return Ok(val);
15807            }
15808        }
15809        Err(ErrorContext::new_missing(
15810            "WowlanTriggersAttrs",
15811            "WakeupPkt80211",
15812            self.orig_loc,
15813            self.buf.as_ptr() as usize,
15814        ))
15815    }
15816    pub fn get_wakeup_pkt_80211_len(&self) -> Result<(), ErrorContext> {
15817        let mut iter = self.clone();
15818        iter.pos = 0;
15819        for attr in iter {
15820            if let WowlanTriggersAttrs::WakeupPkt80211Len(val) = attr? {
15821                return Ok(val);
15822            }
15823        }
15824        Err(ErrorContext::new_missing(
15825            "WowlanTriggersAttrs",
15826            "WakeupPkt80211Len",
15827            self.orig_loc,
15828            self.buf.as_ptr() as usize,
15829        ))
15830    }
15831    pub fn get_wakeup_pkt_8023(&self) -> Result<(), ErrorContext> {
15832        let mut iter = self.clone();
15833        iter.pos = 0;
15834        for attr in iter {
15835            if let WowlanTriggersAttrs::WakeupPkt8023(val) = attr? {
15836                return Ok(val);
15837            }
15838        }
15839        Err(ErrorContext::new_missing(
15840            "WowlanTriggersAttrs",
15841            "WakeupPkt8023",
15842            self.orig_loc,
15843            self.buf.as_ptr() as usize,
15844        ))
15845    }
15846    pub fn get_wakeup_pkt_8023_len(&self) -> Result<(), ErrorContext> {
15847        let mut iter = self.clone();
15848        iter.pos = 0;
15849        for attr in iter {
15850            if let WowlanTriggersAttrs::WakeupPkt8023Len(val) = attr? {
15851                return Ok(val);
15852            }
15853        }
15854        Err(ErrorContext::new_missing(
15855            "WowlanTriggersAttrs",
15856            "WakeupPkt8023Len",
15857            self.orig_loc,
15858            self.buf.as_ptr() as usize,
15859        ))
15860    }
15861    pub fn get_tcp_connection(&self) -> Result<(), ErrorContext> {
15862        let mut iter = self.clone();
15863        iter.pos = 0;
15864        for attr in iter {
15865            if let WowlanTriggersAttrs::TcpConnection(val) = attr? {
15866                return Ok(val);
15867            }
15868        }
15869        Err(ErrorContext::new_missing(
15870            "WowlanTriggersAttrs",
15871            "TcpConnection",
15872            self.orig_loc,
15873            self.buf.as_ptr() as usize,
15874        ))
15875    }
15876    pub fn get_wakeup_tcp_match(&self) -> Result<(), ErrorContext> {
15877        let mut iter = self.clone();
15878        iter.pos = 0;
15879        for attr in iter {
15880            if let WowlanTriggersAttrs::WakeupTcpMatch(val) = attr? {
15881                return Ok(val);
15882            }
15883        }
15884        Err(ErrorContext::new_missing(
15885            "WowlanTriggersAttrs",
15886            "WakeupTcpMatch",
15887            self.orig_loc,
15888            self.buf.as_ptr() as usize,
15889        ))
15890    }
15891    pub fn get_wakeup_tcp_connlost(&self) -> Result<(), ErrorContext> {
15892        let mut iter = self.clone();
15893        iter.pos = 0;
15894        for attr in iter {
15895            if let WowlanTriggersAttrs::WakeupTcpConnlost(val) = attr? {
15896                return Ok(val);
15897            }
15898        }
15899        Err(ErrorContext::new_missing(
15900            "WowlanTriggersAttrs",
15901            "WakeupTcpConnlost",
15902            self.orig_loc,
15903            self.buf.as_ptr() as usize,
15904        ))
15905    }
15906    pub fn get_wakeup_tcp_nomoretokens(&self) -> Result<(), ErrorContext> {
15907        let mut iter = self.clone();
15908        iter.pos = 0;
15909        for attr in iter {
15910            if let WowlanTriggersAttrs::WakeupTcpNomoretokens(val) = attr? {
15911                return Ok(val);
15912            }
15913        }
15914        Err(ErrorContext::new_missing(
15915            "WowlanTriggersAttrs",
15916            "WakeupTcpNomoretokens",
15917            self.orig_loc,
15918            self.buf.as_ptr() as usize,
15919        ))
15920    }
15921    pub fn get_net_detect(&self) -> Result<(), ErrorContext> {
15922        let mut iter = self.clone();
15923        iter.pos = 0;
15924        for attr in iter {
15925            if let WowlanTriggersAttrs::NetDetect(val) = attr? {
15926                return Ok(val);
15927            }
15928        }
15929        Err(ErrorContext::new_missing(
15930            "WowlanTriggersAttrs",
15931            "NetDetect",
15932            self.orig_loc,
15933            self.buf.as_ptr() as usize,
15934        ))
15935    }
15936    pub fn get_net_detect_results(&self) -> Result<(), ErrorContext> {
15937        let mut iter = self.clone();
15938        iter.pos = 0;
15939        for attr in iter {
15940            if let WowlanTriggersAttrs::NetDetectResults(val) = attr? {
15941                return Ok(val);
15942            }
15943        }
15944        Err(ErrorContext::new_missing(
15945            "WowlanTriggersAttrs",
15946            "NetDetectResults",
15947            self.orig_loc,
15948            self.buf.as_ptr() as usize,
15949        ))
15950    }
15951    pub fn get_unprotected_deauth_disassoc(&self) -> Result<(), ErrorContext> {
15952        let mut iter = self.clone();
15953        iter.pos = 0;
15954        for attr in iter {
15955            if let WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) = attr? {
15956                return Ok(val);
15957            }
15958        }
15959        Err(ErrorContext::new_missing(
15960            "WowlanTriggersAttrs",
15961            "UnprotectedDeauthDisassoc",
15962            self.orig_loc,
15963            self.buf.as_ptr() as usize,
15964        ))
15965    }
15966}
15967impl WowlanTriggersAttrs {
15968    pub fn new<'a>(buf: &'a [u8]) -> IterableWowlanTriggersAttrs<'a> {
15969        IterableWowlanTriggersAttrs::with_loc(buf, buf.as_ptr() as usize)
15970    }
15971    fn attr_from_type(r#type: u16) -> Option<&'static str> {
15972        let res = match r#type {
15973            1u16 => "Any",
15974            2u16 => "Disconnect",
15975            3u16 => "MagicPkt",
15976            4u16 => "PktPattern",
15977            5u16 => "GtkRekeySupported",
15978            6u16 => "GtkRekeyFailure",
15979            7u16 => "EapIdentRequest",
15980            8u16 => "4wayHandshake",
15981            9u16 => "RfkillRelease",
15982            10u16 => "WakeupPkt80211",
15983            11u16 => "WakeupPkt80211Len",
15984            12u16 => "WakeupPkt8023",
15985            13u16 => "WakeupPkt8023Len",
15986            14u16 => "TcpConnection",
15987            15u16 => "WakeupTcpMatch",
15988            16u16 => "WakeupTcpConnlost",
15989            17u16 => "WakeupTcpNomoretokens",
15990            18u16 => "NetDetect",
15991            19u16 => "NetDetectResults",
15992            20u16 => "UnprotectedDeauthDisassoc",
15993            _ => return None,
15994        };
15995        Some(res)
15996    }
15997}
15998#[derive(Clone, Copy, Default)]
15999pub struct IterableWowlanTriggersAttrs<'a> {
16000    buf: &'a [u8],
16001    pos: usize,
16002    orig_loc: usize,
16003}
16004impl<'a> IterableWowlanTriggersAttrs<'a> {
16005    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
16006        Self {
16007            buf,
16008            pos: 0,
16009            orig_loc,
16010        }
16011    }
16012    pub fn get_buf(&self) -> &'a [u8] {
16013        self.buf
16014    }
16015}
16016impl<'a> Iterator for IterableWowlanTriggersAttrs<'a> {
16017    type Item = Result<WowlanTriggersAttrs, ErrorContext>;
16018    fn next(&mut self) -> Option<Self::Item> {
16019        let pos = self.pos;
16020        let mut r#type;
16021        loop {
16022            r#type = None;
16023            if self.buf.len() == self.pos {
16024                return None;
16025            }
16026            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
16027                break;
16028            };
16029            r#type = Some(header.r#type);
16030            let res = match header.r#type {
16031                1u16 => WowlanTriggersAttrs::Any(()),
16032                2u16 => WowlanTriggersAttrs::Disconnect(()),
16033                3u16 => WowlanTriggersAttrs::MagicPkt(()),
16034                4u16 => WowlanTriggersAttrs::PktPattern(()),
16035                5u16 => WowlanTriggersAttrs::GtkRekeySupported(()),
16036                6u16 => WowlanTriggersAttrs::GtkRekeyFailure(()),
16037                7u16 => WowlanTriggersAttrs::EapIdentRequest(()),
16038                8u16 => WowlanTriggersAttrs::_4wayHandshake(()),
16039                9u16 => WowlanTriggersAttrs::RfkillRelease(()),
16040                10u16 => WowlanTriggersAttrs::WakeupPkt80211(()),
16041                11u16 => WowlanTriggersAttrs::WakeupPkt80211Len(()),
16042                12u16 => WowlanTriggersAttrs::WakeupPkt8023(()),
16043                13u16 => WowlanTriggersAttrs::WakeupPkt8023Len(()),
16044                14u16 => WowlanTriggersAttrs::TcpConnection(()),
16045                15u16 => WowlanTriggersAttrs::WakeupTcpMatch(()),
16046                16u16 => WowlanTriggersAttrs::WakeupTcpConnlost(()),
16047                17u16 => WowlanTriggersAttrs::WakeupTcpNomoretokens(()),
16048                18u16 => WowlanTriggersAttrs::NetDetect(()),
16049                19u16 => WowlanTriggersAttrs::NetDetectResults(()),
16050                20u16 => WowlanTriggersAttrs::UnprotectedDeauthDisassoc(()),
16051                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
16052                n => continue,
16053            };
16054            return Some(Ok(res));
16055        }
16056        Some(Err(ErrorContext::new(
16057            "WowlanTriggersAttrs",
16058            r#type.and_then(|t| WowlanTriggersAttrs::attr_from_type(t)),
16059            self.orig_loc,
16060            self.buf.as_ptr().wrapping_add(pos) as usize,
16061        )))
16062    }
16063}
16064impl std::fmt::Debug for IterableWowlanTriggersAttrs<'_> {
16065    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16066        let mut fmt = f.debug_struct("WowlanTriggersAttrs");
16067        for attr in self.clone() {
16068            let attr = match attr {
16069                Ok(a) => a,
16070                Err(err) => {
16071                    fmt.finish()?;
16072                    f.write_str("Err(")?;
16073                    err.fmt(f)?;
16074                    return f.write_str(")");
16075                }
16076            };
16077            match attr {
16078                WowlanTriggersAttrs::Any(val) => fmt.field("Any", &val),
16079                WowlanTriggersAttrs::Disconnect(val) => fmt.field("Disconnect", &val),
16080                WowlanTriggersAttrs::MagicPkt(val) => fmt.field("MagicPkt", &val),
16081                WowlanTriggersAttrs::PktPattern(val) => fmt.field("PktPattern", &val),
16082                WowlanTriggersAttrs::GtkRekeySupported(val) => fmt.field("GtkRekeySupported", &val),
16083                WowlanTriggersAttrs::GtkRekeyFailure(val) => fmt.field("GtkRekeyFailure", &val),
16084                WowlanTriggersAttrs::EapIdentRequest(val) => fmt.field("EapIdentRequest", &val),
16085                WowlanTriggersAttrs::_4wayHandshake(val) => fmt.field("_4wayHandshake", &val),
16086                WowlanTriggersAttrs::RfkillRelease(val) => fmt.field("RfkillRelease", &val),
16087                WowlanTriggersAttrs::WakeupPkt80211(val) => fmt.field("WakeupPkt80211", &val),
16088                WowlanTriggersAttrs::WakeupPkt80211Len(val) => fmt.field("WakeupPkt80211Len", &val),
16089                WowlanTriggersAttrs::WakeupPkt8023(val) => fmt.field("WakeupPkt8023", &val),
16090                WowlanTriggersAttrs::WakeupPkt8023Len(val) => fmt.field("WakeupPkt8023Len", &val),
16091                WowlanTriggersAttrs::TcpConnection(val) => fmt.field("TcpConnection", &val),
16092                WowlanTriggersAttrs::WakeupTcpMatch(val) => fmt.field("WakeupTcpMatch", &val),
16093                WowlanTriggersAttrs::WakeupTcpConnlost(val) => fmt.field("WakeupTcpConnlost", &val),
16094                WowlanTriggersAttrs::WakeupTcpNomoretokens(val) => {
16095                    fmt.field("WakeupTcpNomoretokens", &val)
16096                }
16097                WowlanTriggersAttrs::NetDetect(val) => fmt.field("NetDetect", &val),
16098                WowlanTriggersAttrs::NetDetectResults(val) => fmt.field("NetDetectResults", &val),
16099                WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) => {
16100                    fmt.field("UnprotectedDeauthDisassoc", &val)
16101                }
16102            };
16103        }
16104        fmt.finish()
16105    }
16106}
16107impl IterableWowlanTriggersAttrs<'_> {
16108    pub fn lookup_attr(
16109        &self,
16110        offset: usize,
16111        missing_type: Option<u16>,
16112    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
16113        let mut stack = Vec::new();
16114        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
16115        if missing_type.is_some() && cur == offset {
16116            stack.push(("WowlanTriggersAttrs", offset));
16117            return (
16118                stack,
16119                missing_type.and_then(|t| WowlanTriggersAttrs::attr_from_type(t)),
16120            );
16121        }
16122        if cur > offset || cur + self.buf.len() < offset {
16123            return (stack, None);
16124        }
16125        let mut attrs = self.clone();
16126        let mut last_off = cur + attrs.pos;
16127        while let Some(attr) = attrs.next() {
16128            let Ok(attr) = attr else { break };
16129            match attr {
16130                WowlanTriggersAttrs::Any(val) => {
16131                    if last_off == offset {
16132                        stack.push(("Any", last_off));
16133                        break;
16134                    }
16135                }
16136                WowlanTriggersAttrs::Disconnect(val) => {
16137                    if last_off == offset {
16138                        stack.push(("Disconnect", last_off));
16139                        break;
16140                    }
16141                }
16142                WowlanTriggersAttrs::MagicPkt(val) => {
16143                    if last_off == offset {
16144                        stack.push(("MagicPkt", last_off));
16145                        break;
16146                    }
16147                }
16148                WowlanTriggersAttrs::PktPattern(val) => {
16149                    if last_off == offset {
16150                        stack.push(("PktPattern", last_off));
16151                        break;
16152                    }
16153                }
16154                WowlanTriggersAttrs::GtkRekeySupported(val) => {
16155                    if last_off == offset {
16156                        stack.push(("GtkRekeySupported", last_off));
16157                        break;
16158                    }
16159                }
16160                WowlanTriggersAttrs::GtkRekeyFailure(val) => {
16161                    if last_off == offset {
16162                        stack.push(("GtkRekeyFailure", last_off));
16163                        break;
16164                    }
16165                }
16166                WowlanTriggersAttrs::EapIdentRequest(val) => {
16167                    if last_off == offset {
16168                        stack.push(("EapIdentRequest", last_off));
16169                        break;
16170                    }
16171                }
16172                WowlanTriggersAttrs::_4wayHandshake(val) => {
16173                    if last_off == offset {
16174                        stack.push(("4wayHandshake", last_off));
16175                        break;
16176                    }
16177                }
16178                WowlanTriggersAttrs::RfkillRelease(val) => {
16179                    if last_off == offset {
16180                        stack.push(("RfkillRelease", last_off));
16181                        break;
16182                    }
16183                }
16184                WowlanTriggersAttrs::WakeupPkt80211(val) => {
16185                    if last_off == offset {
16186                        stack.push(("WakeupPkt80211", last_off));
16187                        break;
16188                    }
16189                }
16190                WowlanTriggersAttrs::WakeupPkt80211Len(val) => {
16191                    if last_off == offset {
16192                        stack.push(("WakeupPkt80211Len", last_off));
16193                        break;
16194                    }
16195                }
16196                WowlanTriggersAttrs::WakeupPkt8023(val) => {
16197                    if last_off == offset {
16198                        stack.push(("WakeupPkt8023", last_off));
16199                        break;
16200                    }
16201                }
16202                WowlanTriggersAttrs::WakeupPkt8023Len(val) => {
16203                    if last_off == offset {
16204                        stack.push(("WakeupPkt8023Len", last_off));
16205                        break;
16206                    }
16207                }
16208                WowlanTriggersAttrs::TcpConnection(val) => {
16209                    if last_off == offset {
16210                        stack.push(("TcpConnection", last_off));
16211                        break;
16212                    }
16213                }
16214                WowlanTriggersAttrs::WakeupTcpMatch(val) => {
16215                    if last_off == offset {
16216                        stack.push(("WakeupTcpMatch", last_off));
16217                        break;
16218                    }
16219                }
16220                WowlanTriggersAttrs::WakeupTcpConnlost(val) => {
16221                    if last_off == offset {
16222                        stack.push(("WakeupTcpConnlost", last_off));
16223                        break;
16224                    }
16225                }
16226                WowlanTriggersAttrs::WakeupTcpNomoretokens(val) => {
16227                    if last_off == offset {
16228                        stack.push(("WakeupTcpNomoretokens", last_off));
16229                        break;
16230                    }
16231                }
16232                WowlanTriggersAttrs::NetDetect(val) => {
16233                    if last_off == offset {
16234                        stack.push(("NetDetect", last_off));
16235                        break;
16236                    }
16237                }
16238                WowlanTriggersAttrs::NetDetectResults(val) => {
16239                    if last_off == offset {
16240                        stack.push(("NetDetectResults", last_off));
16241                        break;
16242                    }
16243                }
16244                WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) => {
16245                    if last_off == offset {
16246                        stack.push(("UnprotectedDeauthDisassoc", last_off));
16247                        break;
16248                    }
16249                }
16250                _ => {}
16251            };
16252            last_off = cur + attrs.pos;
16253        }
16254        if !stack.is_empty() {
16255            stack.push(("WowlanTriggersAttrs", cur));
16256        }
16257        (stack, None)
16258    }
16259}
16260pub struct PushNl80211Attrs<Prev: Rec> {
16261    pub(crate) prev: Option<Prev>,
16262    pub(crate) header_offset: Option<usize>,
16263}
16264impl<Prev: Rec> Rec for PushNl80211Attrs<Prev> {
16265    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
16266        self.prev.as_mut().unwrap().as_rec_mut()
16267    }
16268    fn as_rec(&self) -> &Vec<u8> {
16269        self.prev.as_ref().unwrap().as_rec()
16270    }
16271}
16272pub struct PushArrayU32<Prev: Rec> {
16273    pub(crate) prev: Option<Prev>,
16274    pub(crate) header_offset: Option<usize>,
16275    pub(crate) counter: u16,
16276}
16277impl<Prev: Rec> Rec for PushArrayU32<Prev> {
16278    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
16279        self.prev.as_mut().unwrap().as_rec_mut()
16280    }
16281    fn as_rec(&self) -> &Vec<u8> {
16282        self.prev.as_ref().unwrap().as_rec()
16283    }
16284}
16285impl<Prev: Rec> PushArrayU32<Prev> {
16286    pub fn new(prev: Prev) -> Self {
16287        Self {
16288            prev: Some(prev),
16289            header_offset: None,
16290            counter: 0,
16291        }
16292    }
16293    pub fn end_array(mut self) -> Prev {
16294        let mut prev = self.prev.take().unwrap();
16295        if let Some(header_offset) = &self.header_offset {
16296            finalize_nested_header(prev.as_rec_mut(), *header_offset);
16297        }
16298        prev
16299    }
16300    pub fn entry(mut self, value: u32) -> Self {
16301        let index = self.counter;
16302        self.counter += 1;
16303        push_header(self.as_rec_mut(), index, 4 as u16);
16304        self.as_rec_mut().extend(value.to_ne_bytes());
16305        self
16306    }
16307}
16308impl<Prev: Rec> Drop for PushArrayU32<Prev> {
16309    fn drop(&mut self) {
16310        if let Some(prev) = &mut self.prev {
16311            if let Some(header_offset) = &self.header_offset {
16312                finalize_nested_header(prev.as_rec_mut(), *header_offset);
16313            }
16314        }
16315    }
16316}
16317pub struct PushArrayIfCombinationAttributes<Prev: Rec> {
16318    pub(crate) prev: Option<Prev>,
16319    pub(crate) header_offset: Option<usize>,
16320    pub(crate) counter: u16,
16321}
16322impl<Prev: Rec> Rec for PushArrayIfCombinationAttributes<Prev> {
16323    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
16324        self.prev.as_mut().unwrap().as_rec_mut()
16325    }
16326    fn as_rec(&self) -> &Vec<u8> {
16327        self.prev.as_ref().unwrap().as_rec()
16328    }
16329}
16330impl<Prev: Rec> PushArrayIfCombinationAttributes<Prev> {
16331    pub fn new(prev: Prev) -> Self {
16332        Self {
16333            prev: Some(prev),
16334            header_offset: None,
16335            counter: 0,
16336        }
16337    }
16338    pub fn end_array(mut self) -> Prev {
16339        let mut prev = self.prev.take().unwrap();
16340        if let Some(header_offset) = &self.header_offset {
16341            finalize_nested_header(prev.as_rec_mut(), *header_offset);
16342        }
16343        prev
16344    }
16345    pub fn entry_nested(mut self) -> PushIfCombinationAttributes<Self> {
16346        let index = self.counter;
16347        self.counter += 1;
16348        let header_offset = push_nested_header(self.as_rec_mut(), index);
16349        PushIfCombinationAttributes {
16350            prev: Some(self),
16351            header_offset: Some(header_offset),
16352        }
16353    }
16354}
16355impl<Prev: Rec> Drop for PushArrayIfCombinationAttributes<Prev> {
16356    fn drop(&mut self) {
16357        if let Some(prev) = &mut self.prev {
16358            if let Some(header_offset) = &self.header_offset {
16359                finalize_nested_header(prev.as_rec_mut(), *header_offset);
16360            }
16361        }
16362    }
16363}
16364impl<Prev: Rec> PushNl80211Attrs<Prev> {
16365    pub fn new(prev: Prev) -> Self {
16366        Self {
16367            prev: Some(prev),
16368            header_offset: None,
16369        }
16370    }
16371    pub fn end_nested(mut self) -> Prev {
16372        let mut prev = self.prev.take().unwrap();
16373        if let Some(header_offset) = &self.header_offset {
16374            finalize_nested_header(prev.as_rec_mut(), *header_offset);
16375        }
16376        prev
16377    }
16378    pub fn push_wiphy(mut self, value: u32) -> Self {
16379        push_header(self.as_rec_mut(), 1u16, 4 as u16);
16380        self.as_rec_mut().extend(value.to_ne_bytes());
16381        self
16382    }
16383    pub fn push_wiphy_name(mut self, value: &CStr) -> Self {
16384        push_header(
16385            self.as_rec_mut(),
16386            2u16,
16387            value.to_bytes_with_nul().len() as u16,
16388        );
16389        self.as_rec_mut().extend(value.to_bytes_with_nul());
16390        self
16391    }
16392    pub fn push_wiphy_name_bytes(mut self, value: &[u8]) -> Self {
16393        push_header(self.as_rec_mut(), 2u16, (value.len() + 1) as u16);
16394        self.as_rec_mut().extend(value);
16395        self.as_rec_mut().push(0);
16396        self
16397    }
16398    pub fn push_ifindex(mut self, value: u32) -> Self {
16399        push_header(self.as_rec_mut(), 3u16, 4 as u16);
16400        self.as_rec_mut().extend(value.to_ne_bytes());
16401        self
16402    }
16403    pub fn push_ifname(mut self, value: &CStr) -> Self {
16404        push_header(
16405            self.as_rec_mut(),
16406            4u16,
16407            value.to_bytes_with_nul().len() as u16,
16408        );
16409        self.as_rec_mut().extend(value.to_bytes_with_nul());
16410        self
16411    }
16412    pub fn push_ifname_bytes(mut self, value: &[u8]) -> Self {
16413        push_header(self.as_rec_mut(), 4u16, (value.len() + 1) as u16);
16414        self.as_rec_mut().extend(value);
16415        self.as_rec_mut().push(0);
16416        self
16417    }
16418    pub fn push_iftype(mut self, value: u32) -> Self {
16419        push_header(self.as_rec_mut(), 5u16, 4 as u16);
16420        self.as_rec_mut().extend(value.to_ne_bytes());
16421        self
16422    }
16423    pub fn push_mac(mut self, value: &[u8]) -> Self {
16424        push_header(self.as_rec_mut(), 6u16, value.len() as u16);
16425        self.as_rec_mut().extend(value);
16426        self
16427    }
16428    pub fn push_key_data(mut self, value: &[u8]) -> Self {
16429        push_header(self.as_rec_mut(), 7u16, value.len() as u16);
16430        self.as_rec_mut().extend(value);
16431        self
16432    }
16433    pub fn push_key_idx(mut self, value: u8) -> Self {
16434        push_header(self.as_rec_mut(), 8u16, 1 as u16);
16435        self.as_rec_mut().extend(value.to_ne_bytes());
16436        self
16437    }
16438    pub fn push_key_cipher(mut self, value: u32) -> Self {
16439        push_header(self.as_rec_mut(), 9u16, 4 as u16);
16440        self.as_rec_mut().extend(value.to_ne_bytes());
16441        self
16442    }
16443    pub fn push_key_seq(mut self, value: &[u8]) -> Self {
16444        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
16445        self.as_rec_mut().extend(value);
16446        self
16447    }
16448    pub fn push_key_default(mut self, value: ()) -> Self {
16449        push_header(self.as_rec_mut(), 11u16, 0 as u16);
16450        self
16451    }
16452    pub fn push_beacon_interval(mut self, value: u32) -> Self {
16453        push_header(self.as_rec_mut(), 12u16, 4 as u16);
16454        self.as_rec_mut().extend(value.to_ne_bytes());
16455        self
16456    }
16457    pub fn push_dtim_period(mut self, value: u32) -> Self {
16458        push_header(self.as_rec_mut(), 13u16, 4 as u16);
16459        self.as_rec_mut().extend(value.to_ne_bytes());
16460        self
16461    }
16462    pub fn push_beacon_head(mut self, value: &[u8]) -> Self {
16463        push_header(self.as_rec_mut(), 14u16, value.len() as u16);
16464        self.as_rec_mut().extend(value);
16465        self
16466    }
16467    pub fn push_beacon_tail(mut self, value: &[u8]) -> Self {
16468        push_header(self.as_rec_mut(), 15u16, value.len() as u16);
16469        self.as_rec_mut().extend(value);
16470        self
16471    }
16472    pub fn push_sta_aid(mut self, value: u16) -> Self {
16473        push_header(self.as_rec_mut(), 16u16, 2 as u16);
16474        self.as_rec_mut().extend(value.to_ne_bytes());
16475        self
16476    }
16477    pub fn push_sta_flags(mut self, value: &[u8]) -> Self {
16478        push_header(self.as_rec_mut(), 17u16, value.len() as u16);
16479        self.as_rec_mut().extend(value);
16480        self
16481    }
16482    pub fn push_sta_listen_interval(mut self, value: u16) -> Self {
16483        push_header(self.as_rec_mut(), 18u16, 2 as u16);
16484        self.as_rec_mut().extend(value.to_ne_bytes());
16485        self
16486    }
16487    pub fn push_sta_supported_rates(mut self, value: &[u8]) -> Self {
16488        push_header(self.as_rec_mut(), 19u16, value.len() as u16);
16489        self.as_rec_mut().extend(value);
16490        self
16491    }
16492    pub fn push_sta_vlan(mut self, value: u32) -> Self {
16493        push_header(self.as_rec_mut(), 20u16, 4 as u16);
16494        self.as_rec_mut().extend(value.to_ne_bytes());
16495        self
16496    }
16497    pub fn push_sta_info(mut self, value: &[u8]) -> Self {
16498        push_header(self.as_rec_mut(), 21u16, value.len() as u16);
16499        self.as_rec_mut().extend(value);
16500        self
16501    }
16502    pub fn nested_wiphy_bands(mut self) -> PushWiphyBands<Self> {
16503        let header_offset = push_nested_header(self.as_rec_mut(), 22u16);
16504        PushWiphyBands {
16505            prev: Some(self),
16506            header_offset: Some(header_offset),
16507        }
16508    }
16509    pub fn push_mntr_flags(mut self, value: &[u8]) -> Self {
16510        push_header(self.as_rec_mut(), 23u16, value.len() as u16);
16511        self.as_rec_mut().extend(value);
16512        self
16513    }
16514    pub fn push_mesh_id(mut self, value: &[u8]) -> Self {
16515        push_header(self.as_rec_mut(), 24u16, value.len() as u16);
16516        self.as_rec_mut().extend(value);
16517        self
16518    }
16519    pub fn push_sta_plink_action(mut self, value: u8) -> Self {
16520        push_header(self.as_rec_mut(), 25u16, 1 as u16);
16521        self.as_rec_mut().extend(value.to_ne_bytes());
16522        self
16523    }
16524    pub fn push_mpath_next_hop(mut self, value: &[u8]) -> Self {
16525        push_header(self.as_rec_mut(), 26u16, value.len() as u16);
16526        self.as_rec_mut().extend(value);
16527        self
16528    }
16529    pub fn push_mpath_info(mut self, value: &[u8]) -> Self {
16530        push_header(self.as_rec_mut(), 27u16, value.len() as u16);
16531        self.as_rec_mut().extend(value);
16532        self
16533    }
16534    pub fn push_bss_cts_prot(mut self, value: u8) -> Self {
16535        push_header(self.as_rec_mut(), 28u16, 1 as u16);
16536        self.as_rec_mut().extend(value.to_ne_bytes());
16537        self
16538    }
16539    pub fn push_bss_short_preamble(mut self, value: u8) -> Self {
16540        push_header(self.as_rec_mut(), 29u16, 1 as u16);
16541        self.as_rec_mut().extend(value.to_ne_bytes());
16542        self
16543    }
16544    pub fn push_bss_short_slot_time(mut self, value: u8) -> Self {
16545        push_header(self.as_rec_mut(), 30u16, 1 as u16);
16546        self.as_rec_mut().extend(value.to_ne_bytes());
16547        self
16548    }
16549    pub fn push_ht_capability(mut self, value: &[u8]) -> Self {
16550        push_header(self.as_rec_mut(), 31u16, value.len() as u16);
16551        self.as_rec_mut().extend(value);
16552        self
16553    }
16554    pub fn nested_supported_iftypes(mut self) -> PushSupportedIftypes<Self> {
16555        let header_offset = push_nested_header(self.as_rec_mut(), 32u16);
16556        PushSupportedIftypes {
16557            prev: Some(self),
16558            header_offset: Some(header_offset),
16559        }
16560    }
16561    pub fn push_reg_alpha2(mut self, value: &[u8]) -> Self {
16562        push_header(self.as_rec_mut(), 33u16, value.len() as u16);
16563        self.as_rec_mut().extend(value);
16564        self
16565    }
16566    pub fn push_reg_rules(mut self, value: &[u8]) -> Self {
16567        push_header(self.as_rec_mut(), 34u16, value.len() as u16);
16568        self.as_rec_mut().extend(value);
16569        self
16570    }
16571    pub fn push_mesh_config(mut self, value: &[u8]) -> Self {
16572        push_header(self.as_rec_mut(), 35u16, value.len() as u16);
16573        self.as_rec_mut().extend(value);
16574        self
16575    }
16576    pub fn push_bss_basic_rates(mut self, value: &[u8]) -> Self {
16577        push_header(self.as_rec_mut(), 36u16, value.len() as u16);
16578        self.as_rec_mut().extend(value);
16579        self
16580    }
16581    pub fn push_wiphy_txq_params(mut self, value: &[u8]) -> Self {
16582        push_header(self.as_rec_mut(), 37u16, value.len() as u16);
16583        self.as_rec_mut().extend(value);
16584        self
16585    }
16586    pub fn push_wiphy_freq(mut self, value: u32) -> Self {
16587        push_header(self.as_rec_mut(), 38u16, 4 as u16);
16588        self.as_rec_mut().extend(value.to_ne_bytes());
16589        self
16590    }
16591    #[doc = "Associated type: [`ChannelType`] (enum)"]
16592    pub fn push_wiphy_channel_type(mut self, value: u32) -> Self {
16593        push_header(self.as_rec_mut(), 39u16, 4 as u16);
16594        self.as_rec_mut().extend(value.to_ne_bytes());
16595        self
16596    }
16597    pub fn push_key_default_mgmt(mut self, value: ()) -> Self {
16598        push_header(self.as_rec_mut(), 40u16, 0 as u16);
16599        self
16600    }
16601    pub fn push_mgmt_subtype(mut self, value: u8) -> Self {
16602        push_header(self.as_rec_mut(), 41u16, 1 as u16);
16603        self.as_rec_mut().extend(value.to_ne_bytes());
16604        self
16605    }
16606    pub fn push_ie(mut self, value: &[u8]) -> Self {
16607        push_header(self.as_rec_mut(), 42u16, value.len() as u16);
16608        self.as_rec_mut().extend(value);
16609        self
16610    }
16611    pub fn push_max_num_scan_ssids(mut self, value: u8) -> Self {
16612        push_header(self.as_rec_mut(), 43u16, 1 as u16);
16613        self.as_rec_mut().extend(value.to_ne_bytes());
16614        self
16615    }
16616    pub fn push_scan_frequencies(mut self, value: &[u8]) -> Self {
16617        push_header(self.as_rec_mut(), 44u16, value.len() as u16);
16618        self.as_rec_mut().extend(value);
16619        self
16620    }
16621    pub fn push_scan_ssids(mut self, value: &[u8]) -> Self {
16622        push_header(self.as_rec_mut(), 45u16, value.len() as u16);
16623        self.as_rec_mut().extend(value);
16624        self
16625    }
16626    pub fn push_generation(mut self, value: u32) -> Self {
16627        push_header(self.as_rec_mut(), 46u16, 4 as u16);
16628        self.as_rec_mut().extend(value.to_ne_bytes());
16629        self
16630    }
16631    pub fn push_bss(mut self, value: &[u8]) -> Self {
16632        push_header(self.as_rec_mut(), 47u16, value.len() as u16);
16633        self.as_rec_mut().extend(value);
16634        self
16635    }
16636    pub fn push_reg_initiator(mut self, value: u8) -> Self {
16637        push_header(self.as_rec_mut(), 48u16, 1 as u16);
16638        self.as_rec_mut().extend(value.to_ne_bytes());
16639        self
16640    }
16641    pub fn push_reg_type(mut self, value: u8) -> Self {
16642        push_header(self.as_rec_mut(), 49u16, 1 as u16);
16643        self.as_rec_mut().extend(value.to_ne_bytes());
16644        self
16645    }
16646    #[doc = "Associated type: [`Commands`] (enum)"]
16647    pub fn array_supported_commands(mut self) -> PushArrayU32<Self> {
16648        let header_offset = push_nested_header(self.as_rec_mut(), 50u16);
16649        PushArrayU32 {
16650            prev: Some(self),
16651            header_offset: Some(header_offset),
16652            counter: 0,
16653        }
16654    }
16655    pub fn push_frame(mut self, value: &[u8]) -> Self {
16656        push_header(self.as_rec_mut(), 51u16, value.len() as u16);
16657        self.as_rec_mut().extend(value);
16658        self
16659    }
16660    pub fn push_ssid(mut self, value: &[u8]) -> Self {
16661        push_header(self.as_rec_mut(), 52u16, value.len() as u16);
16662        self.as_rec_mut().extend(value);
16663        self
16664    }
16665    pub fn push_auth_type(mut self, value: u32) -> Self {
16666        push_header(self.as_rec_mut(), 53u16, 4 as u16);
16667        self.as_rec_mut().extend(value.to_ne_bytes());
16668        self
16669    }
16670    pub fn push_reason_code(mut self, value: u16) -> Self {
16671        push_header(self.as_rec_mut(), 54u16, 2 as u16);
16672        self.as_rec_mut().extend(value.to_ne_bytes());
16673        self
16674    }
16675    pub fn push_key_type(mut self, value: u32) -> Self {
16676        push_header(self.as_rec_mut(), 55u16, 4 as u16);
16677        self.as_rec_mut().extend(value.to_ne_bytes());
16678        self
16679    }
16680    pub fn push_max_scan_ie_len(mut self, value: u16) -> Self {
16681        push_header(self.as_rec_mut(), 56u16, 2 as u16);
16682        self.as_rec_mut().extend(value.to_ne_bytes());
16683        self
16684    }
16685    pub fn push_cipher_suites(mut self, value: &[u8]) -> Self {
16686        push_header(self.as_rec_mut(), 57u16, value.len() as u16);
16687        self.as_rec_mut().extend(value);
16688        self
16689    }
16690    pub fn push_freq_before(mut self, value: &[u8]) -> Self {
16691        push_header(self.as_rec_mut(), 58u16, value.len() as u16);
16692        self.as_rec_mut().extend(value);
16693        self
16694    }
16695    pub fn push_freq_after(mut self, value: &[u8]) -> Self {
16696        push_header(self.as_rec_mut(), 59u16, value.len() as u16);
16697        self.as_rec_mut().extend(value);
16698        self
16699    }
16700    pub fn push_freq_fixed(mut self, value: ()) -> Self {
16701        push_header(self.as_rec_mut(), 60u16, 0 as u16);
16702        self
16703    }
16704    pub fn push_wiphy_retry_short(mut self, value: u8) -> Self {
16705        push_header(self.as_rec_mut(), 61u16, 1 as u16);
16706        self.as_rec_mut().extend(value.to_ne_bytes());
16707        self
16708    }
16709    pub fn push_wiphy_retry_long(mut self, value: u8) -> Self {
16710        push_header(self.as_rec_mut(), 62u16, 1 as u16);
16711        self.as_rec_mut().extend(value.to_ne_bytes());
16712        self
16713    }
16714    pub fn push_wiphy_frag_threshold(mut self, value: u32) -> Self {
16715        push_header(self.as_rec_mut(), 63u16, 4 as u16);
16716        self.as_rec_mut().extend(value.to_ne_bytes());
16717        self
16718    }
16719    pub fn push_wiphy_rts_threshold(mut self, value: u32) -> Self {
16720        push_header(self.as_rec_mut(), 64u16, 4 as u16);
16721        self.as_rec_mut().extend(value.to_ne_bytes());
16722        self
16723    }
16724    pub fn push_timed_out(mut self, value: ()) -> Self {
16725        push_header(self.as_rec_mut(), 65u16, 0 as u16);
16726        self
16727    }
16728    pub fn push_use_mfp(mut self, value: u32) -> Self {
16729        push_header(self.as_rec_mut(), 66u16, 4 as u16);
16730        self.as_rec_mut().extend(value.to_ne_bytes());
16731        self
16732    }
16733    pub fn push_sta_flags2(mut self, value: StaFlagUpdate) -> Self {
16734        push_header(self.as_rec_mut(), 67u16, value.as_slice().len() as u16);
16735        self.as_rec_mut().extend(value.as_slice());
16736        self
16737    }
16738    pub fn push_control_port(mut self, value: ()) -> Self {
16739        push_header(self.as_rec_mut(), 68u16, 0 as u16);
16740        self
16741    }
16742    pub fn push_testdata(mut self, value: &[u8]) -> Self {
16743        push_header(self.as_rec_mut(), 69u16, value.len() as u16);
16744        self.as_rec_mut().extend(value);
16745        self
16746    }
16747    pub fn push_privacy(mut self, value: ()) -> Self {
16748        push_header(self.as_rec_mut(), 70u16, 0 as u16);
16749        self
16750    }
16751    pub fn push_disconnected_by_ap(mut self, value: ()) -> Self {
16752        push_header(self.as_rec_mut(), 71u16, 0 as u16);
16753        self
16754    }
16755    pub fn push_status_code(mut self, value: u16) -> Self {
16756        push_header(self.as_rec_mut(), 72u16, 2 as u16);
16757        self.as_rec_mut().extend(value.to_ne_bytes());
16758        self
16759    }
16760    pub fn push_cipher_suites_pairwise(mut self, value: &[u8]) -> Self {
16761        push_header(self.as_rec_mut(), 73u16, value.len() as u16);
16762        self.as_rec_mut().extend(value);
16763        self
16764    }
16765    pub fn push_cipher_suite_group(mut self, value: u32) -> Self {
16766        push_header(self.as_rec_mut(), 74u16, 4 as u16);
16767        self.as_rec_mut().extend(value.to_ne_bytes());
16768        self
16769    }
16770    pub fn push_wpa_versions(mut self, value: u32) -> Self {
16771        push_header(self.as_rec_mut(), 75u16, 4 as u16);
16772        self.as_rec_mut().extend(value.to_ne_bytes());
16773        self
16774    }
16775    pub fn push_akm_suites(mut self, value: &[u8]) -> Self {
16776        push_header(self.as_rec_mut(), 76u16, value.len() as u16);
16777        self.as_rec_mut().extend(value);
16778        self
16779    }
16780    pub fn push_req_ie(mut self, value: &[u8]) -> Self {
16781        push_header(self.as_rec_mut(), 77u16, value.len() as u16);
16782        self.as_rec_mut().extend(value);
16783        self
16784    }
16785    pub fn push_resp_ie(mut self, value: &[u8]) -> Self {
16786        push_header(self.as_rec_mut(), 78u16, value.len() as u16);
16787        self.as_rec_mut().extend(value);
16788        self
16789    }
16790    pub fn push_prev_bssid(mut self, value: &[u8]) -> Self {
16791        push_header(self.as_rec_mut(), 79u16, value.len() as u16);
16792        self.as_rec_mut().extend(value);
16793        self
16794    }
16795    pub fn push_key(mut self, value: &[u8]) -> Self {
16796        push_header(self.as_rec_mut(), 80u16, value.len() as u16);
16797        self.as_rec_mut().extend(value);
16798        self
16799    }
16800    pub fn push_keys(mut self, value: &[u8]) -> Self {
16801        push_header(self.as_rec_mut(), 81u16, value.len() as u16);
16802        self.as_rec_mut().extend(value);
16803        self
16804    }
16805    pub fn push_pid(mut self, value: u32) -> Self {
16806        push_header(self.as_rec_mut(), 82u16, 4 as u16);
16807        self.as_rec_mut().extend(value.to_ne_bytes());
16808        self
16809    }
16810    pub fn push_4addr(mut self, value: u8) -> Self {
16811        push_header(self.as_rec_mut(), 83u16, 1 as u16);
16812        self.as_rec_mut().extend(value.to_ne_bytes());
16813        self
16814    }
16815    pub fn push_survey_info(mut self, value: &[u8]) -> Self {
16816        push_header(self.as_rec_mut(), 84u16, value.len() as u16);
16817        self.as_rec_mut().extend(value);
16818        self
16819    }
16820    pub fn push_pmkid(mut self, value: &[u8]) -> Self {
16821        push_header(self.as_rec_mut(), 85u16, value.len() as u16);
16822        self.as_rec_mut().extend(value);
16823        self
16824    }
16825    pub fn push_max_num_pmkids(mut self, value: u8) -> Self {
16826        push_header(self.as_rec_mut(), 86u16, 1 as u16);
16827        self.as_rec_mut().extend(value.to_ne_bytes());
16828        self
16829    }
16830    pub fn push_duration(mut self, value: u32) -> Self {
16831        push_header(self.as_rec_mut(), 87u16, 4 as u16);
16832        self.as_rec_mut().extend(value.to_ne_bytes());
16833        self
16834    }
16835    pub fn push_cookie(mut self, value: u64) -> Self {
16836        push_header(self.as_rec_mut(), 88u16, 8 as u16);
16837        self.as_rec_mut().extend(value.to_ne_bytes());
16838        self
16839    }
16840    pub fn push_wiphy_coverage_class(mut self, value: u8) -> Self {
16841        push_header(self.as_rec_mut(), 89u16, 1 as u16);
16842        self.as_rec_mut().extend(value.to_ne_bytes());
16843        self
16844    }
16845    pub fn push_tx_rates(mut self, value: &[u8]) -> Self {
16846        push_header(self.as_rec_mut(), 90u16, value.len() as u16);
16847        self.as_rec_mut().extend(value);
16848        self
16849    }
16850    pub fn push_frame_match(mut self, value: &[u8]) -> Self {
16851        push_header(self.as_rec_mut(), 91u16, value.len() as u16);
16852        self.as_rec_mut().extend(value);
16853        self
16854    }
16855    pub fn push_ack(mut self, value: ()) -> Self {
16856        push_header(self.as_rec_mut(), 92u16, 0 as u16);
16857        self
16858    }
16859    pub fn push_ps_state(mut self, value: u32) -> Self {
16860        push_header(self.as_rec_mut(), 93u16, 4 as u16);
16861        self.as_rec_mut().extend(value.to_ne_bytes());
16862        self
16863    }
16864    pub fn push_cqm(mut self, value: &[u8]) -> Self {
16865        push_header(self.as_rec_mut(), 94u16, value.len() as u16);
16866        self.as_rec_mut().extend(value);
16867        self
16868    }
16869    pub fn push_local_state_change(mut self, value: ()) -> Self {
16870        push_header(self.as_rec_mut(), 95u16, 0 as u16);
16871        self
16872    }
16873    pub fn push_ap_isolate(mut self, value: u8) -> Self {
16874        push_header(self.as_rec_mut(), 96u16, 1 as u16);
16875        self.as_rec_mut().extend(value.to_ne_bytes());
16876        self
16877    }
16878    pub fn push_wiphy_tx_power_setting(mut self, value: u32) -> Self {
16879        push_header(self.as_rec_mut(), 97u16, 4 as u16);
16880        self.as_rec_mut().extend(value.to_ne_bytes());
16881        self
16882    }
16883    pub fn push_wiphy_tx_power_level(mut self, value: u32) -> Self {
16884        push_header(self.as_rec_mut(), 98u16, 4 as u16);
16885        self.as_rec_mut().extend(value.to_ne_bytes());
16886        self
16887    }
16888    pub fn nested_tx_frame_types(mut self) -> PushIftypeAttrs<Self> {
16889        let header_offset = push_nested_header(self.as_rec_mut(), 99u16);
16890        PushIftypeAttrs {
16891            prev: Some(self),
16892            header_offset: Some(header_offset),
16893        }
16894    }
16895    pub fn nested_rx_frame_types(mut self) -> PushIftypeAttrs<Self> {
16896        let header_offset = push_nested_header(self.as_rec_mut(), 100u16);
16897        PushIftypeAttrs {
16898            prev: Some(self),
16899            header_offset: Some(header_offset),
16900        }
16901    }
16902    pub fn push_frame_type(mut self, value: u16) -> Self {
16903        push_header(self.as_rec_mut(), 101u16, 2 as u16);
16904        self.as_rec_mut().extend(value.to_ne_bytes());
16905        self
16906    }
16907    pub fn push_control_port_ethertype(mut self, value: ()) -> Self {
16908        push_header(self.as_rec_mut(), 102u16, 0 as u16);
16909        self
16910    }
16911    pub fn push_control_port_no_encrypt(mut self, value: ()) -> Self {
16912        push_header(self.as_rec_mut(), 103u16, 0 as u16);
16913        self
16914    }
16915    pub fn push_support_ibss_rsn(mut self, value: ()) -> Self {
16916        push_header(self.as_rec_mut(), 104u16, 0 as u16);
16917        self
16918    }
16919    pub fn push_wiphy_antenna_tx(mut self, value: u32) -> Self {
16920        push_header(self.as_rec_mut(), 105u16, 4 as u16);
16921        self.as_rec_mut().extend(value.to_ne_bytes());
16922        self
16923    }
16924    pub fn push_wiphy_antenna_rx(mut self, value: u32) -> Self {
16925        push_header(self.as_rec_mut(), 106u16, 4 as u16);
16926        self.as_rec_mut().extend(value.to_ne_bytes());
16927        self
16928    }
16929    pub fn push_mcast_rate(mut self, value: u32) -> Self {
16930        push_header(self.as_rec_mut(), 107u16, 4 as u16);
16931        self.as_rec_mut().extend(value.to_ne_bytes());
16932        self
16933    }
16934    pub fn push_offchannel_tx_ok(mut self, value: ()) -> Self {
16935        push_header(self.as_rec_mut(), 108u16, 0 as u16);
16936        self
16937    }
16938    pub fn push_bss_ht_opmode(mut self, value: u16) -> Self {
16939        push_header(self.as_rec_mut(), 109u16, 2 as u16);
16940        self.as_rec_mut().extend(value.to_ne_bytes());
16941        self
16942    }
16943    pub fn push_key_default_types(mut self, value: &[u8]) -> Self {
16944        push_header(self.as_rec_mut(), 110u16, value.len() as u16);
16945        self.as_rec_mut().extend(value);
16946        self
16947    }
16948    pub fn push_max_remain_on_channel_duration(mut self, value: u32) -> Self {
16949        push_header(self.as_rec_mut(), 111u16, 4 as u16);
16950        self.as_rec_mut().extend(value.to_ne_bytes());
16951        self
16952    }
16953    pub fn push_mesh_setup(mut self, value: &[u8]) -> Self {
16954        push_header(self.as_rec_mut(), 112u16, value.len() as u16);
16955        self.as_rec_mut().extend(value);
16956        self
16957    }
16958    pub fn push_wiphy_antenna_avail_tx(mut self, value: u32) -> Self {
16959        push_header(self.as_rec_mut(), 113u16, 4 as u16);
16960        self.as_rec_mut().extend(value.to_ne_bytes());
16961        self
16962    }
16963    pub fn push_wiphy_antenna_avail_rx(mut self, value: u32) -> Self {
16964        push_header(self.as_rec_mut(), 114u16, 4 as u16);
16965        self.as_rec_mut().extend(value.to_ne_bytes());
16966        self
16967    }
16968    pub fn push_support_mesh_auth(mut self, value: ()) -> Self {
16969        push_header(self.as_rec_mut(), 115u16, 0 as u16);
16970        self
16971    }
16972    pub fn push_sta_plink_state(mut self, value: u8) -> Self {
16973        push_header(self.as_rec_mut(), 116u16, 1 as u16);
16974        self.as_rec_mut().extend(value.to_ne_bytes());
16975        self
16976    }
16977    pub fn push_wowlan_triggers(mut self, value: &[u8]) -> Self {
16978        push_header(self.as_rec_mut(), 117u16, value.len() as u16);
16979        self.as_rec_mut().extend(value);
16980        self
16981    }
16982    pub fn nested_wowlan_triggers_supported(mut self) -> PushWowlanTriggersAttrs<Self> {
16983        let header_offset = push_nested_header(self.as_rec_mut(), 118u16);
16984        PushWowlanTriggersAttrs {
16985            prev: Some(self),
16986            header_offset: Some(header_offset),
16987        }
16988    }
16989    pub fn push_sched_scan_interval(mut self, value: u32) -> Self {
16990        push_header(self.as_rec_mut(), 119u16, 4 as u16);
16991        self.as_rec_mut().extend(value.to_ne_bytes());
16992        self
16993    }
16994    pub fn array_interface_combinations(mut self) -> PushArrayIfCombinationAttributes<Self> {
16995        let header_offset = push_nested_header(self.as_rec_mut(), 120u16);
16996        PushArrayIfCombinationAttributes {
16997            prev: Some(self),
16998            header_offset: Some(header_offset),
16999            counter: 0,
17000        }
17001    }
17002    pub fn nested_software_iftypes(mut self) -> PushSupportedIftypes<Self> {
17003        let header_offset = push_nested_header(self.as_rec_mut(), 121u16);
17004        PushSupportedIftypes {
17005            prev: Some(self),
17006            header_offset: Some(header_offset),
17007        }
17008    }
17009    pub fn push_rekey_data(mut self, value: &[u8]) -> Self {
17010        push_header(self.as_rec_mut(), 122u16, value.len() as u16);
17011        self.as_rec_mut().extend(value);
17012        self
17013    }
17014    pub fn push_max_num_sched_scan_ssids(mut self, value: u8) -> Self {
17015        push_header(self.as_rec_mut(), 123u16, 1 as u16);
17016        self.as_rec_mut().extend(value.to_ne_bytes());
17017        self
17018    }
17019    pub fn push_max_sched_scan_ie_len(mut self, value: u16) -> Self {
17020        push_header(self.as_rec_mut(), 124u16, 2 as u16);
17021        self.as_rec_mut().extend(value.to_ne_bytes());
17022        self
17023    }
17024    pub fn push_scan_supp_rates(mut self, value: &[u8]) -> Self {
17025        push_header(self.as_rec_mut(), 125u16, value.len() as u16);
17026        self.as_rec_mut().extend(value);
17027        self
17028    }
17029    pub fn push_hidden_ssid(mut self, value: u32) -> Self {
17030        push_header(self.as_rec_mut(), 126u16, 4 as u16);
17031        self.as_rec_mut().extend(value.to_ne_bytes());
17032        self
17033    }
17034    pub fn push_ie_probe_resp(mut self, value: &[u8]) -> Self {
17035        push_header(self.as_rec_mut(), 127u16, value.len() as u16);
17036        self.as_rec_mut().extend(value);
17037        self
17038    }
17039    pub fn push_ie_assoc_resp(mut self, value: &[u8]) -> Self {
17040        push_header(self.as_rec_mut(), 128u16, value.len() as u16);
17041        self.as_rec_mut().extend(value);
17042        self
17043    }
17044    pub fn push_sta_wme(mut self, value: &[u8]) -> Self {
17045        push_header(self.as_rec_mut(), 129u16, value.len() as u16);
17046        self.as_rec_mut().extend(value);
17047        self
17048    }
17049    pub fn push_support_ap_uapsd(mut self, value: ()) -> Self {
17050        push_header(self.as_rec_mut(), 130u16, 0 as u16);
17051        self
17052    }
17053    pub fn push_roam_support(mut self, value: ()) -> Self {
17054        push_header(self.as_rec_mut(), 131u16, 0 as u16);
17055        self
17056    }
17057    pub fn push_sched_scan_match(mut self, value: &[u8]) -> Self {
17058        push_header(self.as_rec_mut(), 132u16, value.len() as u16);
17059        self.as_rec_mut().extend(value);
17060        self
17061    }
17062    pub fn push_max_match_sets(mut self, value: u8) -> Self {
17063        push_header(self.as_rec_mut(), 133u16, 1 as u16);
17064        self.as_rec_mut().extend(value.to_ne_bytes());
17065        self
17066    }
17067    pub fn push_pmksa_candidate(mut self, value: &[u8]) -> Self {
17068        push_header(self.as_rec_mut(), 134u16, value.len() as u16);
17069        self.as_rec_mut().extend(value);
17070        self
17071    }
17072    pub fn push_tx_no_cck_rate(mut self, value: ()) -> Self {
17073        push_header(self.as_rec_mut(), 135u16, 0 as u16);
17074        self
17075    }
17076    pub fn push_tdls_action(mut self, value: u8) -> Self {
17077        push_header(self.as_rec_mut(), 136u16, 1 as u16);
17078        self.as_rec_mut().extend(value.to_ne_bytes());
17079        self
17080    }
17081    pub fn push_tdls_dialog_token(mut self, value: u8) -> Self {
17082        push_header(self.as_rec_mut(), 137u16, 1 as u16);
17083        self.as_rec_mut().extend(value.to_ne_bytes());
17084        self
17085    }
17086    pub fn push_tdls_operation(mut self, value: u8) -> Self {
17087        push_header(self.as_rec_mut(), 138u16, 1 as u16);
17088        self.as_rec_mut().extend(value.to_ne_bytes());
17089        self
17090    }
17091    pub fn push_tdls_support(mut self, value: ()) -> Self {
17092        push_header(self.as_rec_mut(), 139u16, 0 as u16);
17093        self
17094    }
17095    pub fn push_tdls_external_setup(mut self, value: ()) -> Self {
17096        push_header(self.as_rec_mut(), 140u16, 0 as u16);
17097        self
17098    }
17099    pub fn push_device_ap_sme(mut self, value: u32) -> Self {
17100        push_header(self.as_rec_mut(), 141u16, 4 as u16);
17101        self.as_rec_mut().extend(value.to_ne_bytes());
17102        self
17103    }
17104    pub fn push_dont_wait_for_ack(mut self, value: ()) -> Self {
17105        push_header(self.as_rec_mut(), 142u16, 0 as u16);
17106        self
17107    }
17108    #[doc = "Associated type: [`FeatureFlags`] (1 bit per enumeration)"]
17109    pub fn push_feature_flags(mut self, value: u32) -> Self {
17110        push_header(self.as_rec_mut(), 143u16, 4 as u16);
17111        self.as_rec_mut().extend(value.to_ne_bytes());
17112        self
17113    }
17114    pub fn push_probe_resp_offload(mut self, value: u32) -> Self {
17115        push_header(self.as_rec_mut(), 144u16, 4 as u16);
17116        self.as_rec_mut().extend(value.to_ne_bytes());
17117        self
17118    }
17119    pub fn push_probe_resp(mut self, value: &[u8]) -> Self {
17120        push_header(self.as_rec_mut(), 145u16, value.len() as u16);
17121        self.as_rec_mut().extend(value);
17122        self
17123    }
17124    pub fn push_dfs_region(mut self, value: u8) -> Self {
17125        push_header(self.as_rec_mut(), 146u16, 1 as u16);
17126        self.as_rec_mut().extend(value.to_ne_bytes());
17127        self
17128    }
17129    pub fn push_disable_ht(mut self, value: ()) -> Self {
17130        push_header(self.as_rec_mut(), 147u16, 0 as u16);
17131        self
17132    }
17133    pub fn push_ht_capability_mask(mut self, value: &[u8]) -> Self {
17134        push_header(self.as_rec_mut(), 148u16, value.len() as u16);
17135        self.as_rec_mut().extend(value);
17136        self
17137    }
17138    pub fn push_noack_map(mut self, value: u16) -> Self {
17139        push_header(self.as_rec_mut(), 149u16, 2 as u16);
17140        self.as_rec_mut().extend(value.to_ne_bytes());
17141        self
17142    }
17143    pub fn push_inactivity_timeout(mut self, value: u16) -> Self {
17144        push_header(self.as_rec_mut(), 150u16, 2 as u16);
17145        self.as_rec_mut().extend(value.to_ne_bytes());
17146        self
17147    }
17148    pub fn push_rx_signal_dbm(mut self, value: u32) -> Self {
17149        push_header(self.as_rec_mut(), 151u16, 4 as u16);
17150        self.as_rec_mut().extend(value.to_ne_bytes());
17151        self
17152    }
17153    pub fn push_bg_scan_period(mut self, value: u16) -> Self {
17154        push_header(self.as_rec_mut(), 152u16, 2 as u16);
17155        self.as_rec_mut().extend(value.to_ne_bytes());
17156        self
17157    }
17158    pub fn push_wdev(mut self, value: u64) -> Self {
17159        push_header(self.as_rec_mut(), 153u16, 8 as u16);
17160        self.as_rec_mut().extend(value.to_ne_bytes());
17161        self
17162    }
17163    pub fn push_user_reg_hint_type(mut self, value: u32) -> Self {
17164        push_header(self.as_rec_mut(), 154u16, 4 as u16);
17165        self.as_rec_mut().extend(value.to_ne_bytes());
17166        self
17167    }
17168    pub fn push_conn_failed_reason(mut self, value: u32) -> Self {
17169        push_header(self.as_rec_mut(), 155u16, 4 as u16);
17170        self.as_rec_mut().extend(value.to_ne_bytes());
17171        self
17172    }
17173    pub fn push_auth_data(mut self, value: &[u8]) -> Self {
17174        push_header(self.as_rec_mut(), 156u16, value.len() as u16);
17175        self.as_rec_mut().extend(value);
17176        self
17177    }
17178    pub fn push_vht_capability(mut self, value: &[u8]) -> Self {
17179        push_header(self.as_rec_mut(), 157u16, value.len() as u16);
17180        self.as_rec_mut().extend(value);
17181        self
17182    }
17183    pub fn push_scan_flags(mut self, value: u32) -> Self {
17184        push_header(self.as_rec_mut(), 158u16, 4 as u16);
17185        self.as_rec_mut().extend(value.to_ne_bytes());
17186        self
17187    }
17188    pub fn push_channel_width(mut self, value: u32) -> Self {
17189        push_header(self.as_rec_mut(), 159u16, 4 as u16);
17190        self.as_rec_mut().extend(value.to_ne_bytes());
17191        self
17192    }
17193    pub fn push_center_freq1(mut self, value: u32) -> Self {
17194        push_header(self.as_rec_mut(), 160u16, 4 as u16);
17195        self.as_rec_mut().extend(value.to_ne_bytes());
17196        self
17197    }
17198    pub fn push_center_freq2(mut self, value: u32) -> Self {
17199        push_header(self.as_rec_mut(), 161u16, 4 as u16);
17200        self.as_rec_mut().extend(value.to_ne_bytes());
17201        self
17202    }
17203    pub fn push_p2p_ctwindow(mut self, value: u8) -> Self {
17204        push_header(self.as_rec_mut(), 162u16, 1 as u16);
17205        self.as_rec_mut().extend(value.to_ne_bytes());
17206        self
17207    }
17208    pub fn push_p2p_oppps(mut self, value: u8) -> Self {
17209        push_header(self.as_rec_mut(), 163u16, 1 as u16);
17210        self.as_rec_mut().extend(value.to_ne_bytes());
17211        self
17212    }
17213    pub fn push_local_mesh_power_mode(mut self, value: u32) -> Self {
17214        push_header(self.as_rec_mut(), 164u16, 4 as u16);
17215        self.as_rec_mut().extend(value.to_ne_bytes());
17216        self
17217    }
17218    pub fn push_acl_policy(mut self, value: u32) -> Self {
17219        push_header(self.as_rec_mut(), 165u16, 4 as u16);
17220        self.as_rec_mut().extend(value.to_ne_bytes());
17221        self
17222    }
17223    pub fn push_mac_addrs(mut self, value: &[u8]) -> Self {
17224        push_header(self.as_rec_mut(), 166u16, value.len() as u16);
17225        self.as_rec_mut().extend(value);
17226        self
17227    }
17228    pub fn push_mac_acl_max(mut self, value: u32) -> Self {
17229        push_header(self.as_rec_mut(), 167u16, 4 as u16);
17230        self.as_rec_mut().extend(value.to_ne_bytes());
17231        self
17232    }
17233    pub fn push_radar_event(mut self, value: u32) -> Self {
17234        push_header(self.as_rec_mut(), 168u16, 4 as u16);
17235        self.as_rec_mut().extend(value.to_ne_bytes());
17236        self
17237    }
17238    pub fn push_ext_capa(mut self, value: &[u8]) -> Self {
17239        push_header(self.as_rec_mut(), 169u16, value.len() as u16);
17240        self.as_rec_mut().extend(value);
17241        self
17242    }
17243    pub fn push_ext_capa_mask(mut self, value: &[u8]) -> Self {
17244        push_header(self.as_rec_mut(), 170u16, value.len() as u16);
17245        self.as_rec_mut().extend(value);
17246        self
17247    }
17248    pub fn push_sta_capability(mut self, value: u16) -> Self {
17249        push_header(self.as_rec_mut(), 171u16, 2 as u16);
17250        self.as_rec_mut().extend(value.to_ne_bytes());
17251        self
17252    }
17253    pub fn push_sta_ext_capability(mut self, value: &[u8]) -> Self {
17254        push_header(self.as_rec_mut(), 172u16, value.len() as u16);
17255        self.as_rec_mut().extend(value);
17256        self
17257    }
17258    #[doc = "Associated type: [`ProtocolFeatures`] (enum)"]
17259    pub fn push_protocol_features(mut self, value: u32) -> Self {
17260        push_header(self.as_rec_mut(), 173u16, 4 as u16);
17261        self.as_rec_mut().extend(value.to_ne_bytes());
17262        self
17263    }
17264    pub fn push_split_wiphy_dump(mut self, value: ()) -> Self {
17265        push_header(self.as_rec_mut(), 174u16, 0 as u16);
17266        self
17267    }
17268    pub fn push_disable_vht(mut self, value: ()) -> Self {
17269        push_header(self.as_rec_mut(), 175u16, 0 as u16);
17270        self
17271    }
17272    pub fn push_vht_capability_mask(mut self, value: &[u8]) -> Self {
17273        push_header(self.as_rec_mut(), 176u16, value.len() as u16);
17274        self.as_rec_mut().extend(value);
17275        self
17276    }
17277    pub fn push_mdid(mut self, value: u16) -> Self {
17278        push_header(self.as_rec_mut(), 177u16, 2 as u16);
17279        self.as_rec_mut().extend(value.to_ne_bytes());
17280        self
17281    }
17282    pub fn push_ie_ric(mut self, value: &[u8]) -> Self {
17283        push_header(self.as_rec_mut(), 178u16, value.len() as u16);
17284        self.as_rec_mut().extend(value);
17285        self
17286    }
17287    pub fn push_crit_prot_id(mut self, value: u16) -> Self {
17288        push_header(self.as_rec_mut(), 179u16, 2 as u16);
17289        self.as_rec_mut().extend(value.to_ne_bytes());
17290        self
17291    }
17292    pub fn push_max_crit_prot_duration(mut self, value: u16) -> Self {
17293        push_header(self.as_rec_mut(), 180u16, 2 as u16);
17294        self.as_rec_mut().extend(value.to_ne_bytes());
17295        self
17296    }
17297    pub fn push_peer_aid(mut self, value: u16) -> Self {
17298        push_header(self.as_rec_mut(), 181u16, 2 as u16);
17299        self.as_rec_mut().extend(value.to_ne_bytes());
17300        self
17301    }
17302    pub fn push_coalesce_rule(mut self, value: &[u8]) -> Self {
17303        push_header(self.as_rec_mut(), 182u16, value.len() as u16);
17304        self.as_rec_mut().extend(value);
17305        self
17306    }
17307    pub fn push_ch_switch_count(mut self, value: u32) -> Self {
17308        push_header(self.as_rec_mut(), 183u16, 4 as u16);
17309        self.as_rec_mut().extend(value.to_ne_bytes());
17310        self
17311    }
17312    pub fn push_ch_switch_block_tx(mut self, value: ()) -> Self {
17313        push_header(self.as_rec_mut(), 184u16, 0 as u16);
17314        self
17315    }
17316    pub fn push_csa_ies(mut self, value: &[u8]) -> Self {
17317        push_header(self.as_rec_mut(), 185u16, value.len() as u16);
17318        self.as_rec_mut().extend(value);
17319        self
17320    }
17321    pub fn push_cntdwn_offs_beacon(mut self, value: &[u8]) -> Self {
17322        push_header(self.as_rec_mut(), 186u16, value.len() as u16);
17323        self.as_rec_mut().extend(value);
17324        self
17325    }
17326    pub fn push_cntdwn_offs_presp(mut self, value: &[u8]) -> Self {
17327        push_header(self.as_rec_mut(), 187u16, value.len() as u16);
17328        self.as_rec_mut().extend(value);
17329        self
17330    }
17331    pub fn push_rxmgmt_flags(mut self, value: &[u8]) -> Self {
17332        push_header(self.as_rec_mut(), 188u16, value.len() as u16);
17333        self.as_rec_mut().extend(value);
17334        self
17335    }
17336    pub fn push_sta_supported_channels(mut self, value: &[u8]) -> Self {
17337        push_header(self.as_rec_mut(), 189u16, value.len() as u16);
17338        self.as_rec_mut().extend(value);
17339        self
17340    }
17341    pub fn push_sta_supported_oper_classes(mut self, value: &[u8]) -> Self {
17342        push_header(self.as_rec_mut(), 190u16, value.len() as u16);
17343        self.as_rec_mut().extend(value);
17344        self
17345    }
17346    pub fn push_handle_dfs(mut self, value: ()) -> Self {
17347        push_header(self.as_rec_mut(), 191u16, 0 as u16);
17348        self
17349    }
17350    pub fn push_support_5_mhz(mut self, value: ()) -> Self {
17351        push_header(self.as_rec_mut(), 192u16, 0 as u16);
17352        self
17353    }
17354    pub fn push_support_10_mhz(mut self, value: ()) -> Self {
17355        push_header(self.as_rec_mut(), 193u16, 0 as u16);
17356        self
17357    }
17358    pub fn push_opmode_notif(mut self, value: u8) -> Self {
17359        push_header(self.as_rec_mut(), 194u16, 1 as u16);
17360        self.as_rec_mut().extend(value.to_ne_bytes());
17361        self
17362    }
17363    pub fn push_vendor_id(mut self, value: u32) -> Self {
17364        push_header(self.as_rec_mut(), 195u16, 4 as u16);
17365        self.as_rec_mut().extend(value.to_ne_bytes());
17366        self
17367    }
17368    pub fn push_vendor_subcmd(mut self, value: u32) -> Self {
17369        push_header(self.as_rec_mut(), 196u16, 4 as u16);
17370        self.as_rec_mut().extend(value.to_ne_bytes());
17371        self
17372    }
17373    pub fn push_vendor_data(mut self, value: &[u8]) -> Self {
17374        push_header(self.as_rec_mut(), 197u16, value.len() as u16);
17375        self.as_rec_mut().extend(value);
17376        self
17377    }
17378    pub fn push_vendor_events(mut self, value: &[u8]) -> Self {
17379        push_header(self.as_rec_mut(), 198u16, value.len() as u16);
17380        self.as_rec_mut().extend(value);
17381        self
17382    }
17383    pub fn push_qos_map(mut self, value: &[u8]) -> Self {
17384        push_header(self.as_rec_mut(), 199u16, value.len() as u16);
17385        self.as_rec_mut().extend(value);
17386        self
17387    }
17388    pub fn push_mac_hint(mut self, value: &[u8]) -> Self {
17389        push_header(self.as_rec_mut(), 200u16, value.len() as u16);
17390        self.as_rec_mut().extend(value);
17391        self
17392    }
17393    pub fn push_wiphy_freq_hint(mut self, value: u32) -> Self {
17394        push_header(self.as_rec_mut(), 201u16, 4 as u16);
17395        self.as_rec_mut().extend(value.to_ne_bytes());
17396        self
17397    }
17398    pub fn push_max_ap_assoc_sta(mut self, value: u32) -> Self {
17399        push_header(self.as_rec_mut(), 202u16, 4 as u16);
17400        self.as_rec_mut().extend(value.to_ne_bytes());
17401        self
17402    }
17403    pub fn push_tdls_peer_capability(mut self, value: u32) -> Self {
17404        push_header(self.as_rec_mut(), 203u16, 4 as u16);
17405        self.as_rec_mut().extend(value.to_ne_bytes());
17406        self
17407    }
17408    pub fn push_socket_owner(mut self, value: ()) -> Self {
17409        push_header(self.as_rec_mut(), 204u16, 0 as u16);
17410        self
17411    }
17412    pub fn push_csa_c_offsets_tx(mut self, value: &[u8]) -> Self {
17413        push_header(self.as_rec_mut(), 205u16, value.len() as u16);
17414        self.as_rec_mut().extend(value);
17415        self
17416    }
17417    pub fn push_max_csa_counters(mut self, value: u8) -> Self {
17418        push_header(self.as_rec_mut(), 206u16, 1 as u16);
17419        self.as_rec_mut().extend(value.to_ne_bytes());
17420        self
17421    }
17422    pub fn push_tdls_initiator(mut self, value: ()) -> Self {
17423        push_header(self.as_rec_mut(), 207u16, 0 as u16);
17424        self
17425    }
17426    pub fn push_use_rrm(mut self, value: ()) -> Self {
17427        push_header(self.as_rec_mut(), 208u16, 0 as u16);
17428        self
17429    }
17430    pub fn push_wiphy_dyn_ack(mut self, value: ()) -> Self {
17431        push_header(self.as_rec_mut(), 209u16, 0 as u16);
17432        self
17433    }
17434    pub fn push_tsid(mut self, value: u8) -> Self {
17435        push_header(self.as_rec_mut(), 210u16, 1 as u16);
17436        self.as_rec_mut().extend(value.to_ne_bytes());
17437        self
17438    }
17439    pub fn push_user_prio(mut self, value: u8) -> Self {
17440        push_header(self.as_rec_mut(), 211u16, 1 as u16);
17441        self.as_rec_mut().extend(value.to_ne_bytes());
17442        self
17443    }
17444    pub fn push_admitted_time(mut self, value: u16) -> Self {
17445        push_header(self.as_rec_mut(), 212u16, 2 as u16);
17446        self.as_rec_mut().extend(value.to_ne_bytes());
17447        self
17448    }
17449    pub fn push_smps_mode(mut self, value: u8) -> Self {
17450        push_header(self.as_rec_mut(), 213u16, 1 as u16);
17451        self.as_rec_mut().extend(value.to_ne_bytes());
17452        self
17453    }
17454    pub fn push_oper_class(mut self, value: u8) -> Self {
17455        push_header(self.as_rec_mut(), 214u16, 1 as u16);
17456        self.as_rec_mut().extend(value.to_ne_bytes());
17457        self
17458    }
17459    pub fn push_mac_mask(mut self, value: &[u8]) -> Self {
17460        push_header(self.as_rec_mut(), 215u16, value.len() as u16);
17461        self.as_rec_mut().extend(value);
17462        self
17463    }
17464    pub fn push_wiphy_self_managed_reg(mut self, value: ()) -> Self {
17465        push_header(self.as_rec_mut(), 216u16, 0 as u16);
17466        self
17467    }
17468    pub fn push_ext_features(mut self, value: &[u8]) -> Self {
17469        push_header(self.as_rec_mut(), 217u16, value.len() as u16);
17470        self.as_rec_mut().extend(value);
17471        self
17472    }
17473    pub fn push_survey_radio_stats(mut self, value: &[u8]) -> Self {
17474        push_header(self.as_rec_mut(), 218u16, value.len() as u16);
17475        self.as_rec_mut().extend(value);
17476        self
17477    }
17478    pub fn push_netns_fd(mut self, value: u32) -> Self {
17479        push_header(self.as_rec_mut(), 219u16, 4 as u16);
17480        self.as_rec_mut().extend(value.to_ne_bytes());
17481        self
17482    }
17483    pub fn push_sched_scan_delay(mut self, value: u32) -> Self {
17484        push_header(self.as_rec_mut(), 220u16, 4 as u16);
17485        self.as_rec_mut().extend(value.to_ne_bytes());
17486        self
17487    }
17488    pub fn push_reg_indoor(mut self, value: ()) -> Self {
17489        push_header(self.as_rec_mut(), 221u16, 0 as u16);
17490        self
17491    }
17492    pub fn push_max_num_sched_scan_plans(mut self, value: u32) -> Self {
17493        push_header(self.as_rec_mut(), 222u16, 4 as u16);
17494        self.as_rec_mut().extend(value.to_ne_bytes());
17495        self
17496    }
17497    pub fn push_max_scan_plan_interval(mut self, value: u32) -> Self {
17498        push_header(self.as_rec_mut(), 223u16, 4 as u16);
17499        self.as_rec_mut().extend(value.to_ne_bytes());
17500        self
17501    }
17502    pub fn push_max_scan_plan_iterations(mut self, value: u32) -> Self {
17503        push_header(self.as_rec_mut(), 224u16, 4 as u16);
17504        self.as_rec_mut().extend(value.to_ne_bytes());
17505        self
17506    }
17507    pub fn push_sched_scan_plans(mut self, value: &[u8]) -> Self {
17508        push_header(self.as_rec_mut(), 225u16, value.len() as u16);
17509        self.as_rec_mut().extend(value);
17510        self
17511    }
17512    pub fn push_pbss(mut self, value: ()) -> Self {
17513        push_header(self.as_rec_mut(), 226u16, 0 as u16);
17514        self
17515    }
17516    pub fn push_bss_select(mut self, value: &[u8]) -> Self {
17517        push_header(self.as_rec_mut(), 227u16, value.len() as u16);
17518        self.as_rec_mut().extend(value);
17519        self
17520    }
17521    pub fn push_sta_support_p2p_ps(mut self, value: u8) -> Self {
17522        push_header(self.as_rec_mut(), 228u16, 1 as u16);
17523        self.as_rec_mut().extend(value.to_ne_bytes());
17524        self
17525    }
17526    pub fn push_pad(mut self, value: &[u8]) -> Self {
17527        push_header(self.as_rec_mut(), 229u16, value.len() as u16);
17528        self.as_rec_mut().extend(value);
17529        self
17530    }
17531    pub fn push_iftype_ext_capa(mut self, value: &[u8]) -> Self {
17532        push_header(self.as_rec_mut(), 230u16, value.len() as u16);
17533        self.as_rec_mut().extend(value);
17534        self
17535    }
17536    pub fn push_mu_mimo_group_data(mut self, value: &[u8]) -> Self {
17537        push_header(self.as_rec_mut(), 231u16, value.len() as u16);
17538        self.as_rec_mut().extend(value);
17539        self
17540    }
17541    pub fn push_mu_mimo_follow_mac_addr(mut self, value: &[u8]) -> Self {
17542        push_header(self.as_rec_mut(), 232u16, value.len() as u16);
17543        self.as_rec_mut().extend(value);
17544        self
17545    }
17546    pub fn push_scan_start_time_tsf(mut self, value: u64) -> Self {
17547        push_header(self.as_rec_mut(), 233u16, 8 as u16);
17548        self.as_rec_mut().extend(value.to_ne_bytes());
17549        self
17550    }
17551    pub fn push_scan_start_time_tsf_bssid(mut self, value: &[u8]) -> Self {
17552        push_header(self.as_rec_mut(), 234u16, value.len() as u16);
17553        self.as_rec_mut().extend(value);
17554        self
17555    }
17556    pub fn push_measurement_duration(mut self, value: u16) -> Self {
17557        push_header(self.as_rec_mut(), 235u16, 2 as u16);
17558        self.as_rec_mut().extend(value.to_ne_bytes());
17559        self
17560    }
17561    pub fn push_measurement_duration_mandatory(mut self, value: ()) -> Self {
17562        push_header(self.as_rec_mut(), 236u16, 0 as u16);
17563        self
17564    }
17565    pub fn push_mesh_peer_aid(mut self, value: u16) -> Self {
17566        push_header(self.as_rec_mut(), 237u16, 2 as u16);
17567        self.as_rec_mut().extend(value.to_ne_bytes());
17568        self
17569    }
17570    pub fn push_nan_master_pref(mut self, value: u8) -> Self {
17571        push_header(self.as_rec_mut(), 238u16, 1 as u16);
17572        self.as_rec_mut().extend(value.to_ne_bytes());
17573        self
17574    }
17575    pub fn push_bands(mut self, value: u32) -> Self {
17576        push_header(self.as_rec_mut(), 239u16, 4 as u16);
17577        self.as_rec_mut().extend(value.to_ne_bytes());
17578        self
17579    }
17580    pub fn push_nan_func(mut self, value: &[u8]) -> Self {
17581        push_header(self.as_rec_mut(), 240u16, value.len() as u16);
17582        self.as_rec_mut().extend(value);
17583        self
17584    }
17585    pub fn push_nan_match(mut self, value: &[u8]) -> Self {
17586        push_header(self.as_rec_mut(), 241u16, value.len() as u16);
17587        self.as_rec_mut().extend(value);
17588        self
17589    }
17590    pub fn push_fils_kek(mut self, value: &[u8]) -> Self {
17591        push_header(self.as_rec_mut(), 242u16, value.len() as u16);
17592        self.as_rec_mut().extend(value);
17593        self
17594    }
17595    pub fn push_fils_nonces(mut self, value: &[u8]) -> Self {
17596        push_header(self.as_rec_mut(), 243u16, value.len() as u16);
17597        self.as_rec_mut().extend(value);
17598        self
17599    }
17600    pub fn push_multicast_to_unicast_enabled(mut self, value: ()) -> Self {
17601        push_header(self.as_rec_mut(), 244u16, 0 as u16);
17602        self
17603    }
17604    pub fn push_bssid(mut self, value: &[u8]) -> Self {
17605        push_header(self.as_rec_mut(), 245u16, value.len() as u16);
17606        self.as_rec_mut().extend(value);
17607        self
17608    }
17609    pub fn push_sched_scan_relative_rssi(mut self, value: i8) -> Self {
17610        push_header(self.as_rec_mut(), 246u16, 1 as u16);
17611        self.as_rec_mut().extend(value.to_ne_bytes());
17612        self
17613    }
17614    pub fn push_sched_scan_rssi_adjust(mut self, value: &[u8]) -> Self {
17615        push_header(self.as_rec_mut(), 247u16, value.len() as u16);
17616        self.as_rec_mut().extend(value);
17617        self
17618    }
17619    pub fn push_timeout_reason(mut self, value: u32) -> Self {
17620        push_header(self.as_rec_mut(), 248u16, 4 as u16);
17621        self.as_rec_mut().extend(value.to_ne_bytes());
17622        self
17623    }
17624    pub fn push_fils_erp_username(mut self, value: &[u8]) -> Self {
17625        push_header(self.as_rec_mut(), 249u16, value.len() as u16);
17626        self.as_rec_mut().extend(value);
17627        self
17628    }
17629    pub fn push_fils_erp_realm(mut self, value: &[u8]) -> Self {
17630        push_header(self.as_rec_mut(), 250u16, value.len() as u16);
17631        self.as_rec_mut().extend(value);
17632        self
17633    }
17634    pub fn push_fils_erp_next_seq_num(mut self, value: u16) -> Self {
17635        push_header(self.as_rec_mut(), 251u16, 2 as u16);
17636        self.as_rec_mut().extend(value.to_ne_bytes());
17637        self
17638    }
17639    pub fn push_fils_erp_rrk(mut self, value: &[u8]) -> Self {
17640        push_header(self.as_rec_mut(), 252u16, value.len() as u16);
17641        self.as_rec_mut().extend(value);
17642        self
17643    }
17644    pub fn push_fils_cache_id(mut self, value: &[u8]) -> Self {
17645        push_header(self.as_rec_mut(), 253u16, value.len() as u16);
17646        self.as_rec_mut().extend(value);
17647        self
17648    }
17649    pub fn push_pmk(mut self, value: &[u8]) -> Self {
17650        push_header(self.as_rec_mut(), 254u16, value.len() as u16);
17651        self.as_rec_mut().extend(value);
17652        self
17653    }
17654    pub fn push_sched_scan_multi(mut self, value: ()) -> Self {
17655        push_header(self.as_rec_mut(), 255u16, 0 as u16);
17656        self
17657    }
17658    pub fn push_sched_scan_max_reqs(mut self, value: u32) -> Self {
17659        push_header(self.as_rec_mut(), 256u16, 4 as u16);
17660        self.as_rec_mut().extend(value.to_ne_bytes());
17661        self
17662    }
17663    pub fn push_want_1x_4way_hs(mut self, value: ()) -> Self {
17664        push_header(self.as_rec_mut(), 257u16, 0 as u16);
17665        self
17666    }
17667    pub fn push_pmkr0_name(mut self, value: &[u8]) -> Self {
17668        push_header(self.as_rec_mut(), 258u16, value.len() as u16);
17669        self.as_rec_mut().extend(value);
17670        self
17671    }
17672    pub fn push_port_authorized(mut self, value: &[u8]) -> Self {
17673        push_header(self.as_rec_mut(), 259u16, value.len() as u16);
17674        self.as_rec_mut().extend(value);
17675        self
17676    }
17677    pub fn push_external_auth_action(mut self, value: u32) -> Self {
17678        push_header(self.as_rec_mut(), 260u16, 4 as u16);
17679        self.as_rec_mut().extend(value.to_ne_bytes());
17680        self
17681    }
17682    pub fn push_external_auth_support(mut self, value: ()) -> Self {
17683        push_header(self.as_rec_mut(), 261u16, 0 as u16);
17684        self
17685    }
17686    pub fn push_nss(mut self, value: u8) -> Self {
17687        push_header(self.as_rec_mut(), 262u16, 1 as u16);
17688        self.as_rec_mut().extend(value.to_ne_bytes());
17689        self
17690    }
17691    pub fn push_ack_signal(mut self, value: i32) -> Self {
17692        push_header(self.as_rec_mut(), 263u16, 4 as u16);
17693        self.as_rec_mut().extend(value.to_ne_bytes());
17694        self
17695    }
17696    pub fn push_control_port_over_nl80211(mut self, value: ()) -> Self {
17697        push_header(self.as_rec_mut(), 264u16, 0 as u16);
17698        self
17699    }
17700    pub fn nested_txq_stats(mut self) -> PushTxqStatsAttrs<Self> {
17701        let header_offset = push_nested_header(self.as_rec_mut(), 265u16);
17702        PushTxqStatsAttrs {
17703            prev: Some(self),
17704            header_offset: Some(header_offset),
17705        }
17706    }
17707    pub fn push_txq_limit(mut self, value: u32) -> Self {
17708        push_header(self.as_rec_mut(), 266u16, 4 as u16);
17709        self.as_rec_mut().extend(value.to_ne_bytes());
17710        self
17711    }
17712    pub fn push_txq_memory_limit(mut self, value: u32) -> Self {
17713        push_header(self.as_rec_mut(), 267u16, 4 as u16);
17714        self.as_rec_mut().extend(value.to_ne_bytes());
17715        self
17716    }
17717    pub fn push_txq_quantum(mut self, value: u32) -> Self {
17718        push_header(self.as_rec_mut(), 268u16, 4 as u16);
17719        self.as_rec_mut().extend(value.to_ne_bytes());
17720        self
17721    }
17722    pub fn push_he_capability(mut self, value: &[u8]) -> Self {
17723        push_header(self.as_rec_mut(), 269u16, value.len() as u16);
17724        self.as_rec_mut().extend(value);
17725        self
17726    }
17727    pub fn push_ftm_responder(mut self, value: &[u8]) -> Self {
17728        push_header(self.as_rec_mut(), 270u16, value.len() as u16);
17729        self.as_rec_mut().extend(value);
17730        self
17731    }
17732    pub fn push_ftm_responder_stats(mut self, value: &[u8]) -> Self {
17733        push_header(self.as_rec_mut(), 271u16, value.len() as u16);
17734        self.as_rec_mut().extend(value);
17735        self
17736    }
17737    pub fn push_timeout(mut self, value: u32) -> Self {
17738        push_header(self.as_rec_mut(), 272u16, 4 as u16);
17739        self.as_rec_mut().extend(value.to_ne_bytes());
17740        self
17741    }
17742    pub fn push_peer_measurements(mut self, value: &[u8]) -> Self {
17743        push_header(self.as_rec_mut(), 273u16, value.len() as u16);
17744        self.as_rec_mut().extend(value);
17745        self
17746    }
17747    pub fn push_airtime_weight(mut self, value: u16) -> Self {
17748        push_header(self.as_rec_mut(), 274u16, 2 as u16);
17749        self.as_rec_mut().extend(value.to_ne_bytes());
17750        self
17751    }
17752    pub fn push_sta_tx_power_setting(mut self, value: u8) -> Self {
17753        push_header(self.as_rec_mut(), 275u16, 1 as u16);
17754        self.as_rec_mut().extend(value.to_ne_bytes());
17755        self
17756    }
17757    pub fn push_sta_tx_power(mut self, value: i16) -> Self {
17758        push_header(self.as_rec_mut(), 276u16, 2 as u16);
17759        self.as_rec_mut().extend(value.to_ne_bytes());
17760        self
17761    }
17762    pub fn push_sae_password(mut self, value: &[u8]) -> Self {
17763        push_header(self.as_rec_mut(), 277u16, value.len() as u16);
17764        self.as_rec_mut().extend(value);
17765        self
17766    }
17767    pub fn push_twt_responder(mut self, value: ()) -> Self {
17768        push_header(self.as_rec_mut(), 278u16, 0 as u16);
17769        self
17770    }
17771    pub fn push_he_obss_pd(mut self, value: &[u8]) -> Self {
17772        push_header(self.as_rec_mut(), 279u16, value.len() as u16);
17773        self.as_rec_mut().extend(value);
17774        self
17775    }
17776    pub fn push_wiphy_edmg_channels(mut self, value: u8) -> Self {
17777        push_header(self.as_rec_mut(), 280u16, 1 as u16);
17778        self.as_rec_mut().extend(value.to_ne_bytes());
17779        self
17780    }
17781    pub fn push_wiphy_edmg_bw_config(mut self, value: u8) -> Self {
17782        push_header(self.as_rec_mut(), 281u16, 1 as u16);
17783        self.as_rec_mut().extend(value.to_ne_bytes());
17784        self
17785    }
17786    pub fn push_vlan_id(mut self, value: u16) -> Self {
17787        push_header(self.as_rec_mut(), 282u16, 2 as u16);
17788        self.as_rec_mut().extend(value.to_ne_bytes());
17789        self
17790    }
17791    pub fn push_he_bss_color(mut self, value: &[u8]) -> Self {
17792        push_header(self.as_rec_mut(), 283u16, value.len() as u16);
17793        self.as_rec_mut().extend(value);
17794        self
17795    }
17796    pub fn push_iftype_akm_suites(mut self, value: &[u8]) -> Self {
17797        push_header(self.as_rec_mut(), 284u16, value.len() as u16);
17798        self.as_rec_mut().extend(value);
17799        self
17800    }
17801    pub fn push_tid_config(mut self, value: &[u8]) -> Self {
17802        push_header(self.as_rec_mut(), 285u16, value.len() as u16);
17803        self.as_rec_mut().extend(value);
17804        self
17805    }
17806    pub fn push_control_port_no_preauth(mut self, value: ()) -> Self {
17807        push_header(self.as_rec_mut(), 286u16, 0 as u16);
17808        self
17809    }
17810    pub fn push_pmk_lifetime(mut self, value: u32) -> Self {
17811        push_header(self.as_rec_mut(), 287u16, 4 as u16);
17812        self.as_rec_mut().extend(value.to_ne_bytes());
17813        self
17814    }
17815    pub fn push_pmk_reauth_threshold(mut self, value: u8) -> Self {
17816        push_header(self.as_rec_mut(), 288u16, 1 as u16);
17817        self.as_rec_mut().extend(value.to_ne_bytes());
17818        self
17819    }
17820    pub fn push_receive_multicast(mut self, value: ()) -> Self {
17821        push_header(self.as_rec_mut(), 289u16, 0 as u16);
17822        self
17823    }
17824    pub fn push_wiphy_freq_offset(mut self, value: u32) -> Self {
17825        push_header(self.as_rec_mut(), 290u16, 4 as u16);
17826        self.as_rec_mut().extend(value.to_ne_bytes());
17827        self
17828    }
17829    pub fn push_center_freq1_offset(mut self, value: u32) -> Self {
17830        push_header(self.as_rec_mut(), 291u16, 4 as u16);
17831        self.as_rec_mut().extend(value.to_ne_bytes());
17832        self
17833    }
17834    pub fn push_scan_freq_khz(mut self, value: &[u8]) -> Self {
17835        push_header(self.as_rec_mut(), 292u16, value.len() as u16);
17836        self.as_rec_mut().extend(value);
17837        self
17838    }
17839    pub fn push_he_6ghz_capability(mut self, value: &[u8]) -> Self {
17840        push_header(self.as_rec_mut(), 293u16, value.len() as u16);
17841        self.as_rec_mut().extend(value);
17842        self
17843    }
17844    pub fn push_fils_discovery(mut self, value: &[u8]) -> Self {
17845        push_header(self.as_rec_mut(), 294u16, value.len() as u16);
17846        self.as_rec_mut().extend(value);
17847        self
17848    }
17849    pub fn push_unsol_bcast_probe_resp(mut self, value: &[u8]) -> Self {
17850        push_header(self.as_rec_mut(), 295u16, value.len() as u16);
17851        self.as_rec_mut().extend(value);
17852        self
17853    }
17854    pub fn push_s1g_capability(mut self, value: &[u8]) -> Self {
17855        push_header(self.as_rec_mut(), 296u16, value.len() as u16);
17856        self.as_rec_mut().extend(value);
17857        self
17858    }
17859    pub fn push_s1g_capability_mask(mut self, value: &[u8]) -> Self {
17860        push_header(self.as_rec_mut(), 297u16, value.len() as u16);
17861        self.as_rec_mut().extend(value);
17862        self
17863    }
17864    pub fn push_sae_pwe(mut self, value: u8) -> Self {
17865        push_header(self.as_rec_mut(), 298u16, 1 as u16);
17866        self.as_rec_mut().extend(value.to_ne_bytes());
17867        self
17868    }
17869    pub fn push_reconnect_requested(mut self, value: &[u8]) -> Self {
17870        push_header(self.as_rec_mut(), 299u16, value.len() as u16);
17871        self.as_rec_mut().extend(value);
17872        self
17873    }
17874    pub fn nested_sar_spec(mut self) -> PushSarAttributes<Self> {
17875        let header_offset = push_nested_header(self.as_rec_mut(), 300u16);
17876        PushSarAttributes {
17877            prev: Some(self),
17878            header_offset: Some(header_offset),
17879        }
17880    }
17881    pub fn push_disable_he(mut self, value: ()) -> Self {
17882        push_header(self.as_rec_mut(), 301u16, 0 as u16);
17883        self
17884    }
17885    pub fn push_obss_color_bitmap(mut self, value: u64) -> Self {
17886        push_header(self.as_rec_mut(), 302u16, 8 as u16);
17887        self.as_rec_mut().extend(value.to_ne_bytes());
17888        self
17889    }
17890    pub fn push_color_change_count(mut self, value: u8) -> Self {
17891        push_header(self.as_rec_mut(), 303u16, 1 as u16);
17892        self.as_rec_mut().extend(value.to_ne_bytes());
17893        self
17894    }
17895    pub fn push_color_change_color(mut self, value: u8) -> Self {
17896        push_header(self.as_rec_mut(), 304u16, 1 as u16);
17897        self.as_rec_mut().extend(value.to_ne_bytes());
17898        self
17899    }
17900    pub fn push_color_change_elems(mut self, value: &[u8]) -> Self {
17901        push_header(self.as_rec_mut(), 305u16, value.len() as u16);
17902        self.as_rec_mut().extend(value);
17903        self
17904    }
17905    pub fn push_mbssid_config(mut self, value: &[u8]) -> Self {
17906        push_header(self.as_rec_mut(), 306u16, value.len() as u16);
17907        self.as_rec_mut().extend(value);
17908        self
17909    }
17910    pub fn push_mbssid_elems(mut self, value: &[u8]) -> Self {
17911        push_header(self.as_rec_mut(), 307u16, value.len() as u16);
17912        self.as_rec_mut().extend(value);
17913        self
17914    }
17915    pub fn push_radar_background(mut self, value: ()) -> Self {
17916        push_header(self.as_rec_mut(), 308u16, 0 as u16);
17917        self
17918    }
17919    pub fn push_ap_settings_flags(mut self, value: u32) -> Self {
17920        push_header(self.as_rec_mut(), 309u16, 4 as u16);
17921        self.as_rec_mut().extend(value.to_ne_bytes());
17922        self
17923    }
17924    pub fn push_eht_capability(mut self, value: &[u8]) -> Self {
17925        push_header(self.as_rec_mut(), 310u16, value.len() as u16);
17926        self.as_rec_mut().extend(value);
17927        self
17928    }
17929    pub fn push_disable_eht(mut self, value: ()) -> Self {
17930        push_header(self.as_rec_mut(), 311u16, 0 as u16);
17931        self
17932    }
17933    pub fn push_mlo_links(mut self, value: &[u8]) -> Self {
17934        push_header(self.as_rec_mut(), 312u16, value.len() as u16);
17935        self.as_rec_mut().extend(value);
17936        self
17937    }
17938    pub fn push_mlo_link_id(mut self, value: u8) -> Self {
17939        push_header(self.as_rec_mut(), 313u16, 1 as u16);
17940        self.as_rec_mut().extend(value.to_ne_bytes());
17941        self
17942    }
17943    pub fn push_mld_addr(mut self, value: &[u8]) -> Self {
17944        push_header(self.as_rec_mut(), 314u16, value.len() as u16);
17945        self.as_rec_mut().extend(value);
17946        self
17947    }
17948    pub fn push_mlo_support(mut self, value: ()) -> Self {
17949        push_header(self.as_rec_mut(), 315u16, 0 as u16);
17950        self
17951    }
17952    pub fn push_max_num_akm_suites(mut self, value: &[u8]) -> Self {
17953        push_header(self.as_rec_mut(), 316u16, value.len() as u16);
17954        self.as_rec_mut().extend(value);
17955        self
17956    }
17957    pub fn push_eml_capability(mut self, value: u16) -> Self {
17958        push_header(self.as_rec_mut(), 317u16, 2 as u16);
17959        self.as_rec_mut().extend(value.to_ne_bytes());
17960        self
17961    }
17962    pub fn push_mld_capa_and_ops(mut self, value: u16) -> Self {
17963        push_header(self.as_rec_mut(), 318u16, 2 as u16);
17964        self.as_rec_mut().extend(value.to_ne_bytes());
17965        self
17966    }
17967    pub fn push_tx_hw_timestamp(mut self, value: u64) -> Self {
17968        push_header(self.as_rec_mut(), 319u16, 8 as u16);
17969        self.as_rec_mut().extend(value.to_ne_bytes());
17970        self
17971    }
17972    pub fn push_rx_hw_timestamp(mut self, value: u64) -> Self {
17973        push_header(self.as_rec_mut(), 320u16, 8 as u16);
17974        self.as_rec_mut().extend(value.to_ne_bytes());
17975        self
17976    }
17977    pub fn push_td_bitmap(mut self, value: &[u8]) -> Self {
17978        push_header(self.as_rec_mut(), 321u16, value.len() as u16);
17979        self.as_rec_mut().extend(value);
17980        self
17981    }
17982    pub fn push_punct_bitmap(mut self, value: u32) -> Self {
17983        push_header(self.as_rec_mut(), 322u16, 4 as u16);
17984        self.as_rec_mut().extend(value.to_ne_bytes());
17985        self
17986    }
17987    pub fn push_max_hw_timestamp_peers(mut self, value: u16) -> Self {
17988        push_header(self.as_rec_mut(), 323u16, 2 as u16);
17989        self.as_rec_mut().extend(value.to_ne_bytes());
17990        self
17991    }
17992    pub fn push_hw_timestamp_enabled(mut self, value: ()) -> Self {
17993        push_header(self.as_rec_mut(), 324u16, 0 as u16);
17994        self
17995    }
17996    pub fn push_ema_rnr_elems(mut self, value: &[u8]) -> Self {
17997        push_header(self.as_rec_mut(), 325u16, value.len() as u16);
17998        self.as_rec_mut().extend(value);
17999        self
18000    }
18001    pub fn push_mlo_link_disabled(mut self, value: ()) -> Self {
18002        push_header(self.as_rec_mut(), 326u16, 0 as u16);
18003        self
18004    }
18005    pub fn push_bss_dump_include_use_data(mut self, value: ()) -> Self {
18006        push_header(self.as_rec_mut(), 327u16, 0 as u16);
18007        self
18008    }
18009    pub fn push_mlo_ttlm_dlink(mut self, value: u16) -> Self {
18010        push_header(self.as_rec_mut(), 328u16, 2 as u16);
18011        self.as_rec_mut().extend(value.to_ne_bytes());
18012        self
18013    }
18014    pub fn push_mlo_ttlm_ulink(mut self, value: u16) -> Self {
18015        push_header(self.as_rec_mut(), 329u16, 2 as u16);
18016        self.as_rec_mut().extend(value.to_ne_bytes());
18017        self
18018    }
18019    pub fn push_assoc_spp_amsdu(mut self, value: ()) -> Self {
18020        push_header(self.as_rec_mut(), 330u16, 0 as u16);
18021        self
18022    }
18023    pub fn push_wiphy_radios(mut self, value: &[u8]) -> Self {
18024        push_header(self.as_rec_mut(), 331u16, value.len() as u16);
18025        self.as_rec_mut().extend(value);
18026        self
18027    }
18028    pub fn push_wiphy_interface_combinations(mut self, value: &[u8]) -> Self {
18029        push_header(self.as_rec_mut(), 332u16, value.len() as u16);
18030        self.as_rec_mut().extend(value);
18031        self
18032    }
18033    pub fn push_vif_radio_mask(mut self, value: u32) -> Self {
18034        push_header(self.as_rec_mut(), 333u16, 4 as u16);
18035        self.as_rec_mut().extend(value.to_ne_bytes());
18036        self
18037    }
18038}
18039impl<Prev: Rec> Drop for PushNl80211Attrs<Prev> {
18040    fn drop(&mut self) {
18041        if let Some(prev) = &mut self.prev {
18042            if let Some(header_offset) = &self.header_offset {
18043                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18044            }
18045        }
18046    }
18047}
18048pub struct PushFrameTypeAttrs<Prev: Rec> {
18049    pub(crate) prev: Option<Prev>,
18050    pub(crate) header_offset: Option<usize>,
18051}
18052impl<Prev: Rec> Rec for PushFrameTypeAttrs<Prev> {
18053    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18054        self.prev.as_mut().unwrap().as_rec_mut()
18055    }
18056    fn as_rec(&self) -> &Vec<u8> {
18057        self.prev.as_ref().unwrap().as_rec()
18058    }
18059}
18060impl<Prev: Rec> PushFrameTypeAttrs<Prev> {
18061    pub fn new(prev: Prev) -> Self {
18062        Self {
18063            prev: Some(prev),
18064            header_offset: None,
18065        }
18066    }
18067    pub fn end_nested(mut self) -> Prev {
18068        let mut prev = self.prev.take().unwrap();
18069        if let Some(header_offset) = &self.header_offset {
18070            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18071        }
18072        prev
18073    }
18074    pub fn push_frame_type(mut self, value: u16) -> Self {
18075        push_header(self.as_rec_mut(), 101u16, 2 as u16);
18076        self.as_rec_mut().extend(value.to_ne_bytes());
18077        self
18078    }
18079}
18080impl<Prev: Rec> Drop for PushFrameTypeAttrs<Prev> {
18081    fn drop(&mut self) {
18082        if let Some(prev) = &mut self.prev {
18083            if let Some(header_offset) = &self.header_offset {
18084                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18085            }
18086        }
18087    }
18088}
18089pub struct PushWiphyBands<Prev: Rec> {
18090    pub(crate) prev: Option<Prev>,
18091    pub(crate) header_offset: Option<usize>,
18092}
18093impl<Prev: Rec> Rec for PushWiphyBands<Prev> {
18094    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18095        self.prev.as_mut().unwrap().as_rec_mut()
18096    }
18097    fn as_rec(&self) -> &Vec<u8> {
18098        self.prev.as_ref().unwrap().as_rec()
18099    }
18100}
18101impl<Prev: Rec> PushWiphyBands<Prev> {
18102    pub fn new(prev: Prev) -> Self {
18103        Self {
18104            prev: Some(prev),
18105            header_offset: None,
18106        }
18107    }
18108    pub fn end_nested(mut self) -> Prev {
18109        let mut prev = self.prev.take().unwrap();
18110        if let Some(header_offset) = &self.header_offset {
18111            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18112        }
18113        prev
18114    }
18115    #[doc = "2\\.4 GHz ISM band"]
18116    pub fn nested_2ghz(mut self) -> PushBandAttrs<Self> {
18117        let header_offset = push_nested_header(self.as_rec_mut(), 0u16);
18118        PushBandAttrs {
18119            prev: Some(self),
18120            header_offset: Some(header_offset),
18121        }
18122    }
18123    #[doc = "around 5 GHz band (4\\.9 \\- 5\\.7 GHz)"]
18124    pub fn nested_5ghz(mut self) -> PushBandAttrs<Self> {
18125        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
18126        PushBandAttrs {
18127            prev: Some(self),
18128            header_offset: Some(header_offset),
18129        }
18130    }
18131    #[doc = "around 60 GHz band (58\\.32 \\- 69\\.12 GHz)"]
18132    pub fn nested_60ghz(mut self) -> PushBandAttrs<Self> {
18133        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
18134        PushBandAttrs {
18135            prev: Some(self),
18136            header_offset: Some(header_offset),
18137        }
18138    }
18139    pub fn nested_6ghz(mut self) -> PushBandAttrs<Self> {
18140        let header_offset = push_nested_header(self.as_rec_mut(), 3u16);
18141        PushBandAttrs {
18142            prev: Some(self),
18143            header_offset: Some(header_offset),
18144        }
18145    }
18146    pub fn nested_s1ghz(mut self) -> PushBandAttrs<Self> {
18147        let header_offset = push_nested_header(self.as_rec_mut(), 4u16);
18148        PushBandAttrs {
18149            prev: Some(self),
18150            header_offset: Some(header_offset),
18151        }
18152    }
18153    pub fn nested_lc(mut self) -> PushBandAttrs<Self> {
18154        let header_offset = push_nested_header(self.as_rec_mut(), 5u16);
18155        PushBandAttrs {
18156            prev: Some(self),
18157            header_offset: Some(header_offset),
18158        }
18159    }
18160}
18161impl<Prev: Rec> Drop for PushWiphyBands<Prev> {
18162    fn drop(&mut self) {
18163        if let Some(prev) = &mut self.prev {
18164            if let Some(header_offset) = &self.header_offset {
18165                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18166            }
18167        }
18168    }
18169}
18170pub struct PushBandAttrs<Prev: Rec> {
18171    pub(crate) prev: Option<Prev>,
18172    pub(crate) header_offset: Option<usize>,
18173}
18174impl<Prev: Rec> Rec for PushBandAttrs<Prev> {
18175    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18176        self.prev.as_mut().unwrap().as_rec_mut()
18177    }
18178    fn as_rec(&self) -> &Vec<u8> {
18179        self.prev.as_ref().unwrap().as_rec()
18180    }
18181}
18182pub struct PushArrayFrequencyAttrs<Prev: Rec> {
18183    pub(crate) prev: Option<Prev>,
18184    pub(crate) header_offset: Option<usize>,
18185    pub(crate) counter: u16,
18186}
18187impl<Prev: Rec> Rec for PushArrayFrequencyAttrs<Prev> {
18188    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18189        self.prev.as_mut().unwrap().as_rec_mut()
18190    }
18191    fn as_rec(&self) -> &Vec<u8> {
18192        self.prev.as_ref().unwrap().as_rec()
18193    }
18194}
18195impl<Prev: Rec> PushArrayFrequencyAttrs<Prev> {
18196    pub fn new(prev: Prev) -> Self {
18197        Self {
18198            prev: Some(prev),
18199            header_offset: None,
18200            counter: 0,
18201        }
18202    }
18203    pub fn end_array(mut self) -> Prev {
18204        let mut prev = self.prev.take().unwrap();
18205        if let Some(header_offset) = &self.header_offset {
18206            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18207        }
18208        prev
18209    }
18210    pub fn entry_nested(mut self) -> PushFrequencyAttrs<Self> {
18211        let index = self.counter;
18212        self.counter += 1;
18213        let header_offset = push_nested_header(self.as_rec_mut(), index);
18214        PushFrequencyAttrs {
18215            prev: Some(self),
18216            header_offset: Some(header_offset),
18217        }
18218    }
18219}
18220impl<Prev: Rec> Drop for PushArrayFrequencyAttrs<Prev> {
18221    fn drop(&mut self) {
18222        if let Some(prev) = &mut self.prev {
18223            if let Some(header_offset) = &self.header_offset {
18224                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18225            }
18226        }
18227    }
18228}
18229pub struct PushArrayBitrateAttrs<Prev: Rec> {
18230    pub(crate) prev: Option<Prev>,
18231    pub(crate) header_offset: Option<usize>,
18232    pub(crate) counter: u16,
18233}
18234impl<Prev: Rec> Rec for PushArrayBitrateAttrs<Prev> {
18235    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18236        self.prev.as_mut().unwrap().as_rec_mut()
18237    }
18238    fn as_rec(&self) -> &Vec<u8> {
18239        self.prev.as_ref().unwrap().as_rec()
18240    }
18241}
18242impl<Prev: Rec> PushArrayBitrateAttrs<Prev> {
18243    pub fn new(prev: Prev) -> Self {
18244        Self {
18245            prev: Some(prev),
18246            header_offset: None,
18247            counter: 0,
18248        }
18249    }
18250    pub fn end_array(mut self) -> Prev {
18251        let mut prev = self.prev.take().unwrap();
18252        if let Some(header_offset) = &self.header_offset {
18253            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18254        }
18255        prev
18256    }
18257    pub fn entry_nested(mut self) -> PushBitrateAttrs<Self> {
18258        let index = self.counter;
18259        self.counter += 1;
18260        let header_offset = push_nested_header(self.as_rec_mut(), index);
18261        PushBitrateAttrs {
18262            prev: Some(self),
18263            header_offset: Some(header_offset),
18264        }
18265    }
18266}
18267impl<Prev: Rec> Drop for PushArrayBitrateAttrs<Prev> {
18268    fn drop(&mut self) {
18269        if let Some(prev) = &mut self.prev {
18270            if let Some(header_offset) = &self.header_offset {
18271                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18272            }
18273        }
18274    }
18275}
18276pub struct PushArrayIftypeDataAttrs<Prev: Rec> {
18277    pub(crate) prev: Option<Prev>,
18278    pub(crate) header_offset: Option<usize>,
18279    pub(crate) counter: u16,
18280}
18281impl<Prev: Rec> Rec for PushArrayIftypeDataAttrs<Prev> {
18282    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18283        self.prev.as_mut().unwrap().as_rec_mut()
18284    }
18285    fn as_rec(&self) -> &Vec<u8> {
18286        self.prev.as_ref().unwrap().as_rec()
18287    }
18288}
18289impl<Prev: Rec> PushArrayIftypeDataAttrs<Prev> {
18290    pub fn new(prev: Prev) -> Self {
18291        Self {
18292            prev: Some(prev),
18293            header_offset: None,
18294            counter: 0,
18295        }
18296    }
18297    pub fn end_array(mut self) -> Prev {
18298        let mut prev = self.prev.take().unwrap();
18299        if let Some(header_offset) = &self.header_offset {
18300            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18301        }
18302        prev
18303    }
18304    pub fn entry_nested(mut self) -> PushIftypeDataAttrs<Self> {
18305        let index = self.counter;
18306        self.counter += 1;
18307        let header_offset = push_nested_header(self.as_rec_mut(), index);
18308        PushIftypeDataAttrs {
18309            prev: Some(self),
18310            header_offset: Some(header_offset),
18311        }
18312    }
18313}
18314impl<Prev: Rec> Drop for PushArrayIftypeDataAttrs<Prev> {
18315    fn drop(&mut self) {
18316        if let Some(prev) = &mut self.prev {
18317            if let Some(header_offset) = &self.header_offset {
18318                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18319            }
18320        }
18321    }
18322}
18323impl<Prev: Rec> PushBandAttrs<Prev> {
18324    pub fn new(prev: Prev) -> Self {
18325        Self {
18326            prev: Some(prev),
18327            header_offset: None,
18328        }
18329    }
18330    pub fn end_nested(mut self) -> Prev {
18331        let mut prev = self.prev.take().unwrap();
18332        if let Some(header_offset) = &self.header_offset {
18333            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18334        }
18335        prev
18336    }
18337    pub fn array_freqs(mut self) -> PushArrayFrequencyAttrs<Self> {
18338        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
18339        PushArrayFrequencyAttrs {
18340            prev: Some(self),
18341            header_offset: Some(header_offset),
18342            counter: 0,
18343        }
18344    }
18345    pub fn array_rates(mut self) -> PushArrayBitrateAttrs<Self> {
18346        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
18347        PushArrayBitrateAttrs {
18348            prev: Some(self),
18349            header_offset: Some(header_offset),
18350            counter: 0,
18351        }
18352    }
18353    pub fn push_ht_mcs_set(mut self, value: &[u8]) -> Self {
18354        push_header(self.as_rec_mut(), 3u16, value.len() as u16);
18355        self.as_rec_mut().extend(value);
18356        self
18357    }
18358    pub fn push_ht_capa(mut self, value: u16) -> Self {
18359        push_header(self.as_rec_mut(), 4u16, 2 as u16);
18360        self.as_rec_mut().extend(value.to_ne_bytes());
18361        self
18362    }
18363    pub fn push_ht_ampdu_factor(mut self, value: u8) -> Self {
18364        push_header(self.as_rec_mut(), 5u16, 1 as u16);
18365        self.as_rec_mut().extend(value.to_ne_bytes());
18366        self
18367    }
18368    pub fn push_ht_ampdu_density(mut self, value: u8) -> Self {
18369        push_header(self.as_rec_mut(), 6u16, 1 as u16);
18370        self.as_rec_mut().extend(value.to_ne_bytes());
18371        self
18372    }
18373    pub fn push_vht_mcs_set(mut self, value: &[u8]) -> Self {
18374        push_header(self.as_rec_mut(), 7u16, value.len() as u16);
18375        self.as_rec_mut().extend(value);
18376        self
18377    }
18378    pub fn push_vht_capa(mut self, value: u32) -> Self {
18379        push_header(self.as_rec_mut(), 8u16, 4 as u16);
18380        self.as_rec_mut().extend(value.to_ne_bytes());
18381        self
18382    }
18383    pub fn array_iftype_data(mut self) -> PushArrayIftypeDataAttrs<Self> {
18384        let header_offset = push_nested_header(self.as_rec_mut(), 9u16);
18385        PushArrayIftypeDataAttrs {
18386            prev: Some(self),
18387            header_offset: Some(header_offset),
18388            counter: 0,
18389        }
18390    }
18391    pub fn push_edmg_channels(mut self, value: &[u8]) -> Self {
18392        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
18393        self.as_rec_mut().extend(value);
18394        self
18395    }
18396    pub fn push_edmg_bw_config(mut self, value: &[u8]) -> Self {
18397        push_header(self.as_rec_mut(), 11u16, value.len() as u16);
18398        self.as_rec_mut().extend(value);
18399        self
18400    }
18401    pub fn push_s1g_mcs_nss_set(mut self, value: &[u8]) -> Self {
18402        push_header(self.as_rec_mut(), 12u16, value.len() as u16);
18403        self.as_rec_mut().extend(value);
18404        self
18405    }
18406    pub fn push_s1g_capa(mut self, value: &[u8]) -> Self {
18407        push_header(self.as_rec_mut(), 13u16, value.len() as u16);
18408        self.as_rec_mut().extend(value);
18409        self
18410    }
18411}
18412impl<Prev: Rec> Drop for PushBandAttrs<Prev> {
18413    fn drop(&mut self) {
18414        if let Some(prev) = &mut self.prev {
18415            if let Some(header_offset) = &self.header_offset {
18416                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18417            }
18418        }
18419    }
18420}
18421pub struct PushBitrateAttrs<Prev: Rec> {
18422    pub(crate) prev: Option<Prev>,
18423    pub(crate) header_offset: Option<usize>,
18424}
18425impl<Prev: Rec> Rec for PushBitrateAttrs<Prev> {
18426    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18427        self.prev.as_mut().unwrap().as_rec_mut()
18428    }
18429    fn as_rec(&self) -> &Vec<u8> {
18430        self.prev.as_ref().unwrap().as_rec()
18431    }
18432}
18433impl<Prev: Rec> PushBitrateAttrs<Prev> {
18434    pub fn new(prev: Prev) -> Self {
18435        Self {
18436            prev: Some(prev),
18437            header_offset: None,
18438        }
18439    }
18440    pub fn end_nested(mut self) -> Prev {
18441        let mut prev = self.prev.take().unwrap();
18442        if let Some(header_offset) = &self.header_offset {
18443            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18444        }
18445        prev
18446    }
18447    pub fn push_rate(mut self, value: u32) -> Self {
18448        push_header(self.as_rec_mut(), 1u16, 4 as u16);
18449        self.as_rec_mut().extend(value.to_ne_bytes());
18450        self
18451    }
18452    pub fn push_2ghz_shortpreamble(mut self, value: ()) -> Self {
18453        push_header(self.as_rec_mut(), 2u16, 0 as u16);
18454        self
18455    }
18456}
18457impl<Prev: Rec> Drop for PushBitrateAttrs<Prev> {
18458    fn drop(&mut self) {
18459        if let Some(prev) = &mut self.prev {
18460            if let Some(header_offset) = &self.header_offset {
18461                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18462            }
18463        }
18464    }
18465}
18466pub struct PushFrequencyAttrs<Prev: Rec> {
18467    pub(crate) prev: Option<Prev>,
18468    pub(crate) header_offset: Option<usize>,
18469}
18470impl<Prev: Rec> Rec for PushFrequencyAttrs<Prev> {
18471    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18472        self.prev.as_mut().unwrap().as_rec_mut()
18473    }
18474    fn as_rec(&self) -> &Vec<u8> {
18475        self.prev.as_ref().unwrap().as_rec()
18476    }
18477}
18478pub struct PushArrayWmmAttrs<Prev: Rec> {
18479    pub(crate) prev: Option<Prev>,
18480    pub(crate) header_offset: Option<usize>,
18481    pub(crate) counter: u16,
18482}
18483impl<Prev: Rec> Rec for PushArrayWmmAttrs<Prev> {
18484    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18485        self.prev.as_mut().unwrap().as_rec_mut()
18486    }
18487    fn as_rec(&self) -> &Vec<u8> {
18488        self.prev.as_ref().unwrap().as_rec()
18489    }
18490}
18491impl<Prev: Rec> PushArrayWmmAttrs<Prev> {
18492    pub fn new(prev: Prev) -> Self {
18493        Self {
18494            prev: Some(prev),
18495            header_offset: None,
18496            counter: 0,
18497        }
18498    }
18499    pub fn end_array(mut self) -> Prev {
18500        let mut prev = self.prev.take().unwrap();
18501        if let Some(header_offset) = &self.header_offset {
18502            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18503        }
18504        prev
18505    }
18506    pub fn entry_nested(mut self) -> PushWmmAttrs<Self> {
18507        let index = self.counter;
18508        self.counter += 1;
18509        let header_offset = push_nested_header(self.as_rec_mut(), index);
18510        PushWmmAttrs {
18511            prev: Some(self),
18512            header_offset: Some(header_offset),
18513        }
18514    }
18515}
18516impl<Prev: Rec> Drop for PushArrayWmmAttrs<Prev> {
18517    fn drop(&mut self) {
18518        if let Some(prev) = &mut self.prev {
18519            if let Some(header_offset) = &self.header_offset {
18520                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18521            }
18522        }
18523    }
18524}
18525impl<Prev: Rec> PushFrequencyAttrs<Prev> {
18526    pub fn new(prev: Prev) -> Self {
18527        Self {
18528            prev: Some(prev),
18529            header_offset: None,
18530        }
18531    }
18532    pub fn end_nested(mut self) -> Prev {
18533        let mut prev = self.prev.take().unwrap();
18534        if let Some(header_offset) = &self.header_offset {
18535            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18536        }
18537        prev
18538    }
18539    pub fn push_freq(mut self, value: u32) -> Self {
18540        push_header(self.as_rec_mut(), 1u16, 4 as u16);
18541        self.as_rec_mut().extend(value.to_ne_bytes());
18542        self
18543    }
18544    pub fn push_disabled(mut self, value: ()) -> Self {
18545        push_header(self.as_rec_mut(), 2u16, 0 as u16);
18546        self
18547    }
18548    pub fn push_no_ir(mut self, value: ()) -> Self {
18549        push_header(self.as_rec_mut(), 3u16, 0 as u16);
18550        self
18551    }
18552    pub fn push_no_ibss(mut self, value: ()) -> Self {
18553        push_header(self.as_rec_mut(), 4u16, 0 as u16);
18554        self
18555    }
18556    pub fn push_radar(mut self, value: ()) -> Self {
18557        push_header(self.as_rec_mut(), 5u16, 0 as u16);
18558        self
18559    }
18560    pub fn push_max_tx_power(mut self, value: u32) -> Self {
18561        push_header(self.as_rec_mut(), 6u16, 4 as u16);
18562        self.as_rec_mut().extend(value.to_ne_bytes());
18563        self
18564    }
18565    pub fn push_dfs_state(mut self, value: u32) -> Self {
18566        push_header(self.as_rec_mut(), 7u16, 4 as u16);
18567        self.as_rec_mut().extend(value.to_ne_bytes());
18568        self
18569    }
18570    pub fn push_dfs_time(mut self, value: &[u8]) -> Self {
18571        push_header(self.as_rec_mut(), 8u16, value.len() as u16);
18572        self.as_rec_mut().extend(value);
18573        self
18574    }
18575    pub fn push_no_ht40_minus(mut self, value: &[u8]) -> Self {
18576        push_header(self.as_rec_mut(), 9u16, value.len() as u16);
18577        self.as_rec_mut().extend(value);
18578        self
18579    }
18580    pub fn push_no_ht40_plus(mut self, value: &[u8]) -> Self {
18581        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
18582        self.as_rec_mut().extend(value);
18583        self
18584    }
18585    pub fn push_no_80mhz(mut self, value: &[u8]) -> Self {
18586        push_header(self.as_rec_mut(), 11u16, value.len() as u16);
18587        self.as_rec_mut().extend(value);
18588        self
18589    }
18590    pub fn push_no_160mhz(mut self, value: &[u8]) -> Self {
18591        push_header(self.as_rec_mut(), 12u16, value.len() as u16);
18592        self.as_rec_mut().extend(value);
18593        self
18594    }
18595    pub fn push_dfs_cac_time(mut self, value: &[u8]) -> Self {
18596        push_header(self.as_rec_mut(), 13u16, value.len() as u16);
18597        self.as_rec_mut().extend(value);
18598        self
18599    }
18600    pub fn push_indoor_only(mut self, value: &[u8]) -> Self {
18601        push_header(self.as_rec_mut(), 14u16, value.len() as u16);
18602        self.as_rec_mut().extend(value);
18603        self
18604    }
18605    pub fn push_ir_concurrent(mut self, value: &[u8]) -> Self {
18606        push_header(self.as_rec_mut(), 15u16, value.len() as u16);
18607        self.as_rec_mut().extend(value);
18608        self
18609    }
18610    pub fn push_no_20mhz(mut self, value: &[u8]) -> Self {
18611        push_header(self.as_rec_mut(), 16u16, value.len() as u16);
18612        self.as_rec_mut().extend(value);
18613        self
18614    }
18615    pub fn push_no_10mhz(mut self, value: &[u8]) -> Self {
18616        push_header(self.as_rec_mut(), 17u16, value.len() as u16);
18617        self.as_rec_mut().extend(value);
18618        self
18619    }
18620    pub fn array_wmm(mut self) -> PushArrayWmmAttrs<Self> {
18621        let header_offset = push_nested_header(self.as_rec_mut(), 18u16);
18622        PushArrayWmmAttrs {
18623            prev: Some(self),
18624            header_offset: Some(header_offset),
18625            counter: 0,
18626        }
18627    }
18628    pub fn push_no_he(mut self, value: &[u8]) -> Self {
18629        push_header(self.as_rec_mut(), 19u16, value.len() as u16);
18630        self.as_rec_mut().extend(value);
18631        self
18632    }
18633    pub fn push_offset(mut self, value: u32) -> Self {
18634        push_header(self.as_rec_mut(), 20u16, 4 as u16);
18635        self.as_rec_mut().extend(value.to_ne_bytes());
18636        self
18637    }
18638    pub fn push_1mhz(mut self, value: &[u8]) -> Self {
18639        push_header(self.as_rec_mut(), 21u16, value.len() as u16);
18640        self.as_rec_mut().extend(value);
18641        self
18642    }
18643    pub fn push_2mhz(mut self, value: &[u8]) -> Self {
18644        push_header(self.as_rec_mut(), 22u16, value.len() as u16);
18645        self.as_rec_mut().extend(value);
18646        self
18647    }
18648    pub fn push_4mhz(mut self, value: &[u8]) -> Self {
18649        push_header(self.as_rec_mut(), 23u16, value.len() as u16);
18650        self.as_rec_mut().extend(value);
18651        self
18652    }
18653    pub fn push_8mhz(mut self, value: &[u8]) -> Self {
18654        push_header(self.as_rec_mut(), 24u16, value.len() as u16);
18655        self.as_rec_mut().extend(value);
18656        self
18657    }
18658    pub fn push_16mhz(mut self, value: &[u8]) -> Self {
18659        push_header(self.as_rec_mut(), 25u16, value.len() as u16);
18660        self.as_rec_mut().extend(value);
18661        self
18662    }
18663    pub fn push_no_320mhz(mut self, value: &[u8]) -> Self {
18664        push_header(self.as_rec_mut(), 26u16, value.len() as u16);
18665        self.as_rec_mut().extend(value);
18666        self
18667    }
18668    pub fn push_no_eht(mut self, value: &[u8]) -> Self {
18669        push_header(self.as_rec_mut(), 27u16, value.len() as u16);
18670        self.as_rec_mut().extend(value);
18671        self
18672    }
18673    pub fn push_psd(mut self, value: &[u8]) -> Self {
18674        push_header(self.as_rec_mut(), 28u16, value.len() as u16);
18675        self.as_rec_mut().extend(value);
18676        self
18677    }
18678    pub fn push_dfs_concurrent(mut self, value: &[u8]) -> Self {
18679        push_header(self.as_rec_mut(), 29u16, value.len() as u16);
18680        self.as_rec_mut().extend(value);
18681        self
18682    }
18683    pub fn push_no_6ghz_vlp_client(mut self, value: &[u8]) -> Self {
18684        push_header(self.as_rec_mut(), 30u16, value.len() as u16);
18685        self.as_rec_mut().extend(value);
18686        self
18687    }
18688    pub fn push_no_6ghz_afc_client(mut self, value: &[u8]) -> Self {
18689        push_header(self.as_rec_mut(), 31u16, value.len() as u16);
18690        self.as_rec_mut().extend(value);
18691        self
18692    }
18693    pub fn push_can_monitor(mut self, value: &[u8]) -> Self {
18694        push_header(self.as_rec_mut(), 32u16, value.len() as u16);
18695        self.as_rec_mut().extend(value);
18696        self
18697    }
18698    pub fn push_allow_6ghz_vlp_ap(mut self, value: &[u8]) -> Self {
18699        push_header(self.as_rec_mut(), 33u16, value.len() as u16);
18700        self.as_rec_mut().extend(value);
18701        self
18702    }
18703}
18704impl<Prev: Rec> Drop for PushFrequencyAttrs<Prev> {
18705    fn drop(&mut self) {
18706        if let Some(prev) = &mut self.prev {
18707            if let Some(header_offset) = &self.header_offset {
18708                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18709            }
18710        }
18711    }
18712}
18713pub struct PushIfCombinationAttributes<Prev: Rec> {
18714    pub(crate) prev: Option<Prev>,
18715    pub(crate) header_offset: Option<usize>,
18716}
18717impl<Prev: Rec> Rec for PushIfCombinationAttributes<Prev> {
18718    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18719        self.prev.as_mut().unwrap().as_rec_mut()
18720    }
18721    fn as_rec(&self) -> &Vec<u8> {
18722        self.prev.as_ref().unwrap().as_rec()
18723    }
18724}
18725pub struct PushArrayIfaceLimitAttributes<Prev: Rec> {
18726    pub(crate) prev: Option<Prev>,
18727    pub(crate) header_offset: Option<usize>,
18728    pub(crate) counter: u16,
18729}
18730impl<Prev: Rec> Rec for PushArrayIfaceLimitAttributes<Prev> {
18731    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18732        self.prev.as_mut().unwrap().as_rec_mut()
18733    }
18734    fn as_rec(&self) -> &Vec<u8> {
18735        self.prev.as_ref().unwrap().as_rec()
18736    }
18737}
18738impl<Prev: Rec> PushArrayIfaceLimitAttributes<Prev> {
18739    pub fn new(prev: Prev) -> Self {
18740        Self {
18741            prev: Some(prev),
18742            header_offset: None,
18743            counter: 0,
18744        }
18745    }
18746    pub fn end_array(mut self) -> Prev {
18747        let mut prev = self.prev.take().unwrap();
18748        if let Some(header_offset) = &self.header_offset {
18749            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18750        }
18751        prev
18752    }
18753    pub fn entry_nested(mut self) -> PushIfaceLimitAttributes<Self> {
18754        let index = self.counter;
18755        self.counter += 1;
18756        let header_offset = push_nested_header(self.as_rec_mut(), index);
18757        PushIfaceLimitAttributes {
18758            prev: Some(self),
18759            header_offset: Some(header_offset),
18760        }
18761    }
18762}
18763impl<Prev: Rec> Drop for PushArrayIfaceLimitAttributes<Prev> {
18764    fn drop(&mut self) {
18765        if let Some(prev) = &mut self.prev {
18766            if let Some(header_offset) = &self.header_offset {
18767                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18768            }
18769        }
18770    }
18771}
18772impl<Prev: Rec> PushIfCombinationAttributes<Prev> {
18773    pub fn new(prev: Prev) -> Self {
18774        Self {
18775            prev: Some(prev),
18776            header_offset: None,
18777        }
18778    }
18779    pub fn end_nested(mut self) -> Prev {
18780        let mut prev = self.prev.take().unwrap();
18781        if let Some(header_offset) = &self.header_offset {
18782            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18783        }
18784        prev
18785    }
18786    pub fn array_limits(mut self) -> PushArrayIfaceLimitAttributes<Self> {
18787        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
18788        PushArrayIfaceLimitAttributes {
18789            prev: Some(self),
18790            header_offset: Some(header_offset),
18791            counter: 0,
18792        }
18793    }
18794    pub fn push_maxnum(mut self, value: u32) -> Self {
18795        push_header(self.as_rec_mut(), 2u16, 4 as u16);
18796        self.as_rec_mut().extend(value.to_ne_bytes());
18797        self
18798    }
18799    pub fn push_sta_ap_bi_match(mut self, value: ()) -> Self {
18800        push_header(self.as_rec_mut(), 3u16, 0 as u16);
18801        self
18802    }
18803    pub fn push_num_channels(mut self, value: u32) -> Self {
18804        push_header(self.as_rec_mut(), 4u16, 4 as u16);
18805        self.as_rec_mut().extend(value.to_ne_bytes());
18806        self
18807    }
18808    pub fn push_radar_detect_widths(mut self, value: u32) -> Self {
18809        push_header(self.as_rec_mut(), 5u16, 4 as u16);
18810        self.as_rec_mut().extend(value.to_ne_bytes());
18811        self
18812    }
18813    pub fn push_radar_detect_regions(mut self, value: u32) -> Self {
18814        push_header(self.as_rec_mut(), 6u16, 4 as u16);
18815        self.as_rec_mut().extend(value.to_ne_bytes());
18816        self
18817    }
18818    pub fn push_bi_min_gcd(mut self, value: u32) -> Self {
18819        push_header(self.as_rec_mut(), 7u16, 4 as u16);
18820        self.as_rec_mut().extend(value.to_ne_bytes());
18821        self
18822    }
18823}
18824impl<Prev: Rec> Drop for PushIfCombinationAttributes<Prev> {
18825    fn drop(&mut self) {
18826        if let Some(prev) = &mut self.prev {
18827            if let Some(header_offset) = &self.header_offset {
18828                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18829            }
18830        }
18831    }
18832}
18833pub struct PushIfaceLimitAttributes<Prev: Rec> {
18834    pub(crate) prev: Option<Prev>,
18835    pub(crate) header_offset: Option<usize>,
18836}
18837impl<Prev: Rec> Rec for PushIfaceLimitAttributes<Prev> {
18838    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18839        self.prev.as_mut().unwrap().as_rec_mut()
18840    }
18841    fn as_rec(&self) -> &Vec<u8> {
18842        self.prev.as_ref().unwrap().as_rec()
18843    }
18844}
18845impl<Prev: Rec> PushIfaceLimitAttributes<Prev> {
18846    pub fn new(prev: Prev) -> Self {
18847        Self {
18848            prev: Some(prev),
18849            header_offset: None,
18850        }
18851    }
18852    pub fn end_nested(mut self) -> Prev {
18853        let mut prev = self.prev.take().unwrap();
18854        if let Some(header_offset) = &self.header_offset {
18855            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18856        }
18857        prev
18858    }
18859    pub fn push_max(mut self, value: u32) -> Self {
18860        push_header(self.as_rec_mut(), 1u16, 4 as u16);
18861        self.as_rec_mut().extend(value.to_ne_bytes());
18862        self
18863    }
18864    pub fn nested_types(mut self) -> PushSupportedIftypes<Self> {
18865        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
18866        PushSupportedIftypes {
18867            prev: Some(self),
18868            header_offset: Some(header_offset),
18869        }
18870    }
18871}
18872impl<Prev: Rec> Drop for PushIfaceLimitAttributes<Prev> {
18873    fn drop(&mut self) {
18874        if let Some(prev) = &mut self.prev {
18875            if let Some(header_offset) = &self.header_offset {
18876                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18877            }
18878        }
18879    }
18880}
18881pub struct PushIftypeDataAttrs<Prev: Rec> {
18882    pub(crate) prev: Option<Prev>,
18883    pub(crate) header_offset: Option<usize>,
18884}
18885impl<Prev: Rec> Rec for PushIftypeDataAttrs<Prev> {
18886    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18887        self.prev.as_mut().unwrap().as_rec_mut()
18888    }
18889    fn as_rec(&self) -> &Vec<u8> {
18890        self.prev.as_ref().unwrap().as_rec()
18891    }
18892}
18893impl<Prev: Rec> PushIftypeDataAttrs<Prev> {
18894    pub fn new(prev: Prev) -> Self {
18895        Self {
18896            prev: Some(prev),
18897            header_offset: None,
18898        }
18899    }
18900    pub fn end_nested(mut self) -> Prev {
18901        let mut prev = self.prev.take().unwrap();
18902        if let Some(header_offset) = &self.header_offset {
18903            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18904        }
18905        prev
18906    }
18907    pub fn push_iftypes(mut self, value: &[u8]) -> Self {
18908        push_header(self.as_rec_mut(), 1u16, value.len() as u16);
18909        self.as_rec_mut().extend(value);
18910        self
18911    }
18912    pub fn push_he_cap_mac(mut self, value: &[u8]) -> Self {
18913        push_header(self.as_rec_mut(), 2u16, value.len() as u16);
18914        self.as_rec_mut().extend(value);
18915        self
18916    }
18917    pub fn push_he_cap_phy(mut self, value: &[u8]) -> Self {
18918        push_header(self.as_rec_mut(), 3u16, value.len() as u16);
18919        self.as_rec_mut().extend(value);
18920        self
18921    }
18922    pub fn push_he_cap_mcs_set(mut self, value: &[u8]) -> Self {
18923        push_header(self.as_rec_mut(), 4u16, value.len() as u16);
18924        self.as_rec_mut().extend(value);
18925        self
18926    }
18927    pub fn push_he_cap_ppe(mut self, value: &[u8]) -> Self {
18928        push_header(self.as_rec_mut(), 5u16, value.len() as u16);
18929        self.as_rec_mut().extend(value);
18930        self
18931    }
18932    pub fn push_he_6ghz_capa(mut self, value: &[u8]) -> Self {
18933        push_header(self.as_rec_mut(), 6u16, value.len() as u16);
18934        self.as_rec_mut().extend(value);
18935        self
18936    }
18937    pub fn push_vendor_elems(mut self, value: &[u8]) -> Self {
18938        push_header(self.as_rec_mut(), 7u16, value.len() as u16);
18939        self.as_rec_mut().extend(value);
18940        self
18941    }
18942    pub fn push_eht_cap_mac(mut self, value: &[u8]) -> Self {
18943        push_header(self.as_rec_mut(), 8u16, value.len() as u16);
18944        self.as_rec_mut().extend(value);
18945        self
18946    }
18947    pub fn push_eht_cap_phy(mut self, value: &[u8]) -> Self {
18948        push_header(self.as_rec_mut(), 9u16, value.len() as u16);
18949        self.as_rec_mut().extend(value);
18950        self
18951    }
18952    pub fn push_eht_cap_mcs_set(mut self, value: &[u8]) -> Self {
18953        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
18954        self.as_rec_mut().extend(value);
18955        self
18956    }
18957    pub fn push_eht_cap_ppe(mut self, value: &[u8]) -> Self {
18958        push_header(self.as_rec_mut(), 11u16, value.len() as u16);
18959        self.as_rec_mut().extend(value);
18960        self
18961    }
18962}
18963impl<Prev: Rec> Drop for PushIftypeDataAttrs<Prev> {
18964    fn drop(&mut self) {
18965        if let Some(prev) = &mut self.prev {
18966            if let Some(header_offset) = &self.header_offset {
18967                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18968            }
18969        }
18970    }
18971}
18972pub struct PushIftypeAttrs<Prev: Rec> {
18973    pub(crate) prev: Option<Prev>,
18974    pub(crate) header_offset: Option<usize>,
18975}
18976impl<Prev: Rec> Rec for PushIftypeAttrs<Prev> {
18977    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18978        self.prev.as_mut().unwrap().as_rec_mut()
18979    }
18980    fn as_rec(&self) -> &Vec<u8> {
18981        self.prev.as_ref().unwrap().as_rec()
18982    }
18983}
18984impl<Prev: Rec> PushIftypeAttrs<Prev> {
18985    pub fn new(prev: Prev) -> Self {
18986        Self {
18987            prev: Some(prev),
18988            header_offset: None,
18989        }
18990    }
18991    pub fn end_nested(mut self) -> Prev {
18992        let mut prev = self.prev.take().unwrap();
18993        if let Some(header_offset) = &self.header_offset {
18994            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18995        }
18996        prev
18997    }
18998    pub fn nested_unspecified(mut self) -> PushFrameTypeAttrs<Self> {
18999        let header_offset = push_nested_header(self.as_rec_mut(), 0u16);
19000        PushFrameTypeAttrs {
19001            prev: Some(self),
19002            header_offset: Some(header_offset),
19003        }
19004    }
19005    pub fn nested_adhoc(mut self) -> PushFrameTypeAttrs<Self> {
19006        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
19007        PushFrameTypeAttrs {
19008            prev: Some(self),
19009            header_offset: Some(header_offset),
19010        }
19011    }
19012    pub fn nested_station(mut self) -> PushFrameTypeAttrs<Self> {
19013        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
19014        PushFrameTypeAttrs {
19015            prev: Some(self),
19016            header_offset: Some(header_offset),
19017        }
19018    }
19019    pub fn nested_ap(mut self) -> PushFrameTypeAttrs<Self> {
19020        let header_offset = push_nested_header(self.as_rec_mut(), 3u16);
19021        PushFrameTypeAttrs {
19022            prev: Some(self),
19023            header_offset: Some(header_offset),
19024        }
19025    }
19026    pub fn nested_ap_vlan(mut self) -> PushFrameTypeAttrs<Self> {
19027        let header_offset = push_nested_header(self.as_rec_mut(), 4u16);
19028        PushFrameTypeAttrs {
19029            prev: Some(self),
19030            header_offset: Some(header_offset),
19031        }
19032    }
19033    pub fn nested_wds(mut self) -> PushFrameTypeAttrs<Self> {
19034        let header_offset = push_nested_header(self.as_rec_mut(), 5u16);
19035        PushFrameTypeAttrs {
19036            prev: Some(self),
19037            header_offset: Some(header_offset),
19038        }
19039    }
19040    pub fn nested_monitor(mut self) -> PushFrameTypeAttrs<Self> {
19041        let header_offset = push_nested_header(self.as_rec_mut(), 6u16);
19042        PushFrameTypeAttrs {
19043            prev: Some(self),
19044            header_offset: Some(header_offset),
19045        }
19046    }
19047    pub fn nested_mesh_point(mut self) -> PushFrameTypeAttrs<Self> {
19048        let header_offset = push_nested_header(self.as_rec_mut(), 7u16);
19049        PushFrameTypeAttrs {
19050            prev: Some(self),
19051            header_offset: Some(header_offset),
19052        }
19053    }
19054    pub fn nested_p2p_client(mut self) -> PushFrameTypeAttrs<Self> {
19055        let header_offset = push_nested_header(self.as_rec_mut(), 8u16);
19056        PushFrameTypeAttrs {
19057            prev: Some(self),
19058            header_offset: Some(header_offset),
19059        }
19060    }
19061    pub fn nested_p2p_go(mut self) -> PushFrameTypeAttrs<Self> {
19062        let header_offset = push_nested_header(self.as_rec_mut(), 9u16);
19063        PushFrameTypeAttrs {
19064            prev: Some(self),
19065            header_offset: Some(header_offset),
19066        }
19067    }
19068    pub fn nested_p2p_device(mut self) -> PushFrameTypeAttrs<Self> {
19069        let header_offset = push_nested_header(self.as_rec_mut(), 10u16);
19070        PushFrameTypeAttrs {
19071            prev: Some(self),
19072            header_offset: Some(header_offset),
19073        }
19074    }
19075    pub fn nested_ocb(mut self) -> PushFrameTypeAttrs<Self> {
19076        let header_offset = push_nested_header(self.as_rec_mut(), 11u16);
19077        PushFrameTypeAttrs {
19078            prev: Some(self),
19079            header_offset: Some(header_offset),
19080        }
19081    }
19082    pub fn nested_nan(mut self) -> PushFrameTypeAttrs<Self> {
19083        let header_offset = push_nested_header(self.as_rec_mut(), 12u16);
19084        PushFrameTypeAttrs {
19085            prev: Some(self),
19086            header_offset: Some(header_offset),
19087        }
19088    }
19089}
19090impl<Prev: Rec> Drop for PushIftypeAttrs<Prev> {
19091    fn drop(&mut self) {
19092        if let Some(prev) = &mut self.prev {
19093            if let Some(header_offset) = &self.header_offset {
19094                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19095            }
19096        }
19097    }
19098}
19099pub struct PushSarAttributes<Prev: Rec> {
19100    pub(crate) prev: Option<Prev>,
19101    pub(crate) header_offset: Option<usize>,
19102}
19103impl<Prev: Rec> Rec for PushSarAttributes<Prev> {
19104    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19105        self.prev.as_mut().unwrap().as_rec_mut()
19106    }
19107    fn as_rec(&self) -> &Vec<u8> {
19108        self.prev.as_ref().unwrap().as_rec()
19109    }
19110}
19111pub struct PushArraySarSpecs<Prev: Rec> {
19112    pub(crate) prev: Option<Prev>,
19113    pub(crate) header_offset: Option<usize>,
19114    pub(crate) counter: u16,
19115}
19116impl<Prev: Rec> Rec for PushArraySarSpecs<Prev> {
19117    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19118        self.prev.as_mut().unwrap().as_rec_mut()
19119    }
19120    fn as_rec(&self) -> &Vec<u8> {
19121        self.prev.as_ref().unwrap().as_rec()
19122    }
19123}
19124impl<Prev: Rec> PushArraySarSpecs<Prev> {
19125    pub fn new(prev: Prev) -> Self {
19126        Self {
19127            prev: Some(prev),
19128            header_offset: None,
19129            counter: 0,
19130        }
19131    }
19132    pub fn end_array(mut self) -> Prev {
19133        let mut prev = self.prev.take().unwrap();
19134        if let Some(header_offset) = &self.header_offset {
19135            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19136        }
19137        prev
19138    }
19139    pub fn entry_nested(mut self) -> PushSarSpecs<Self> {
19140        let index = self.counter;
19141        self.counter += 1;
19142        let header_offset = push_nested_header(self.as_rec_mut(), index);
19143        PushSarSpecs {
19144            prev: Some(self),
19145            header_offset: Some(header_offset),
19146        }
19147    }
19148}
19149impl<Prev: Rec> Drop for PushArraySarSpecs<Prev> {
19150    fn drop(&mut self) {
19151        if let Some(prev) = &mut self.prev {
19152            if let Some(header_offset) = &self.header_offset {
19153                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19154            }
19155        }
19156    }
19157}
19158impl<Prev: Rec> PushSarAttributes<Prev> {
19159    pub fn new(prev: Prev) -> Self {
19160        Self {
19161            prev: Some(prev),
19162            header_offset: None,
19163        }
19164    }
19165    pub fn end_nested(mut self) -> Prev {
19166        let mut prev = self.prev.take().unwrap();
19167        if let Some(header_offset) = &self.header_offset {
19168            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19169        }
19170        prev
19171    }
19172    pub fn push_type(mut self, value: u32) -> Self {
19173        push_header(self.as_rec_mut(), 1u16, 4 as u16);
19174        self.as_rec_mut().extend(value.to_ne_bytes());
19175        self
19176    }
19177    pub fn array_specs(mut self) -> PushArraySarSpecs<Self> {
19178        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
19179        PushArraySarSpecs {
19180            prev: Some(self),
19181            header_offset: Some(header_offset),
19182            counter: 0,
19183        }
19184    }
19185}
19186impl<Prev: Rec> Drop for PushSarAttributes<Prev> {
19187    fn drop(&mut self) {
19188        if let Some(prev) = &mut self.prev {
19189            if let Some(header_offset) = &self.header_offset {
19190                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19191            }
19192        }
19193    }
19194}
19195pub struct PushSarSpecs<Prev: Rec> {
19196    pub(crate) prev: Option<Prev>,
19197    pub(crate) header_offset: Option<usize>,
19198}
19199impl<Prev: Rec> Rec for PushSarSpecs<Prev> {
19200    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19201        self.prev.as_mut().unwrap().as_rec_mut()
19202    }
19203    fn as_rec(&self) -> &Vec<u8> {
19204        self.prev.as_ref().unwrap().as_rec()
19205    }
19206}
19207impl<Prev: Rec> PushSarSpecs<Prev> {
19208    pub fn new(prev: Prev) -> Self {
19209        Self {
19210            prev: Some(prev),
19211            header_offset: None,
19212        }
19213    }
19214    pub fn end_nested(mut self) -> Prev {
19215        let mut prev = self.prev.take().unwrap();
19216        if let Some(header_offset) = &self.header_offset {
19217            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19218        }
19219        prev
19220    }
19221    pub fn push_power(mut self, value: i32) -> Self {
19222        push_header(self.as_rec_mut(), 1u16, 4 as u16);
19223        self.as_rec_mut().extend(value.to_ne_bytes());
19224        self
19225    }
19226    pub fn push_range_index(mut self, value: u32) -> Self {
19227        push_header(self.as_rec_mut(), 2u16, 4 as u16);
19228        self.as_rec_mut().extend(value.to_ne_bytes());
19229        self
19230    }
19231    pub fn push_start_freq(mut self, value: u32) -> Self {
19232        push_header(self.as_rec_mut(), 3u16, 4 as u16);
19233        self.as_rec_mut().extend(value.to_ne_bytes());
19234        self
19235    }
19236    pub fn push_end_freq(mut self, value: u32) -> Self {
19237        push_header(self.as_rec_mut(), 4u16, 4 as u16);
19238        self.as_rec_mut().extend(value.to_ne_bytes());
19239        self
19240    }
19241}
19242impl<Prev: Rec> Drop for PushSarSpecs<Prev> {
19243    fn drop(&mut self) {
19244        if let Some(prev) = &mut self.prev {
19245            if let Some(header_offset) = &self.header_offset {
19246                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19247            }
19248        }
19249    }
19250}
19251pub struct PushSupportedIftypes<Prev: Rec> {
19252    pub(crate) prev: Option<Prev>,
19253    pub(crate) header_offset: Option<usize>,
19254}
19255impl<Prev: Rec> Rec for PushSupportedIftypes<Prev> {
19256    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19257        self.prev.as_mut().unwrap().as_rec_mut()
19258    }
19259    fn as_rec(&self) -> &Vec<u8> {
19260        self.prev.as_ref().unwrap().as_rec()
19261    }
19262}
19263impl<Prev: Rec> PushSupportedIftypes<Prev> {
19264    pub fn new(prev: Prev) -> Self {
19265        Self {
19266            prev: Some(prev),
19267            header_offset: None,
19268        }
19269    }
19270    pub fn end_nested(mut self) -> Prev {
19271        let mut prev = self.prev.take().unwrap();
19272        if let Some(header_offset) = &self.header_offset {
19273            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19274        }
19275        prev
19276    }
19277    pub fn push_adhoc(mut self, value: ()) -> Self {
19278        push_header(self.as_rec_mut(), 1u16, 0 as u16);
19279        self
19280    }
19281    pub fn push_station(mut self, value: ()) -> Self {
19282        push_header(self.as_rec_mut(), 2u16, 0 as u16);
19283        self
19284    }
19285    pub fn push_ap(mut self, value: ()) -> Self {
19286        push_header(self.as_rec_mut(), 3u16, 0 as u16);
19287        self
19288    }
19289    pub fn push_ap_vlan(mut self, value: ()) -> Self {
19290        push_header(self.as_rec_mut(), 4u16, 0 as u16);
19291        self
19292    }
19293    pub fn push_wds(mut self, value: ()) -> Self {
19294        push_header(self.as_rec_mut(), 5u16, 0 as u16);
19295        self
19296    }
19297    pub fn push_monitor(mut self, value: ()) -> Self {
19298        push_header(self.as_rec_mut(), 6u16, 0 as u16);
19299        self
19300    }
19301    pub fn push_mesh_point(mut self, value: ()) -> Self {
19302        push_header(self.as_rec_mut(), 7u16, 0 as u16);
19303        self
19304    }
19305    pub fn push_p2p_client(mut self, value: ()) -> Self {
19306        push_header(self.as_rec_mut(), 8u16, 0 as u16);
19307        self
19308    }
19309    pub fn push_p2p_go(mut self, value: ()) -> Self {
19310        push_header(self.as_rec_mut(), 9u16, 0 as u16);
19311        self
19312    }
19313    pub fn push_p2p_device(mut self, value: ()) -> Self {
19314        push_header(self.as_rec_mut(), 10u16, 0 as u16);
19315        self
19316    }
19317    pub fn push_ocb(mut self, value: ()) -> Self {
19318        push_header(self.as_rec_mut(), 11u16, 0 as u16);
19319        self
19320    }
19321    pub fn push_nan(mut self, value: ()) -> Self {
19322        push_header(self.as_rec_mut(), 12u16, 0 as u16);
19323        self
19324    }
19325}
19326impl<Prev: Rec> Drop for PushSupportedIftypes<Prev> {
19327    fn drop(&mut self) {
19328        if let Some(prev) = &mut self.prev {
19329            if let Some(header_offset) = &self.header_offset {
19330                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19331            }
19332        }
19333    }
19334}
19335pub struct PushTxqStatsAttrs<Prev: Rec> {
19336    pub(crate) prev: Option<Prev>,
19337    pub(crate) header_offset: Option<usize>,
19338}
19339impl<Prev: Rec> Rec for PushTxqStatsAttrs<Prev> {
19340    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19341        self.prev.as_mut().unwrap().as_rec_mut()
19342    }
19343    fn as_rec(&self) -> &Vec<u8> {
19344        self.prev.as_ref().unwrap().as_rec()
19345    }
19346}
19347impl<Prev: Rec> PushTxqStatsAttrs<Prev> {
19348    pub fn new(prev: Prev) -> Self {
19349        Self {
19350            prev: Some(prev),
19351            header_offset: None,
19352        }
19353    }
19354    pub fn end_nested(mut self) -> Prev {
19355        let mut prev = self.prev.take().unwrap();
19356        if let Some(header_offset) = &self.header_offset {
19357            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19358        }
19359        prev
19360    }
19361    pub fn push_backlog_bytes(mut self, value: u32) -> Self {
19362        push_header(self.as_rec_mut(), 1u16, 4 as u16);
19363        self.as_rec_mut().extend(value.to_ne_bytes());
19364        self
19365    }
19366    pub fn push_backlog_packets(mut self, value: u32) -> Self {
19367        push_header(self.as_rec_mut(), 2u16, 4 as u16);
19368        self.as_rec_mut().extend(value.to_ne_bytes());
19369        self
19370    }
19371    pub fn push_flows(mut self, value: u32) -> Self {
19372        push_header(self.as_rec_mut(), 3u16, 4 as u16);
19373        self.as_rec_mut().extend(value.to_ne_bytes());
19374        self
19375    }
19376    pub fn push_drops(mut self, value: u32) -> Self {
19377        push_header(self.as_rec_mut(), 4u16, 4 as u16);
19378        self.as_rec_mut().extend(value.to_ne_bytes());
19379        self
19380    }
19381    pub fn push_ecn_marks(mut self, value: u32) -> Self {
19382        push_header(self.as_rec_mut(), 5u16, 4 as u16);
19383        self.as_rec_mut().extend(value.to_ne_bytes());
19384        self
19385    }
19386    pub fn push_overlimit(mut self, value: u32) -> Self {
19387        push_header(self.as_rec_mut(), 6u16, 4 as u16);
19388        self.as_rec_mut().extend(value.to_ne_bytes());
19389        self
19390    }
19391    pub fn push_overmemory(mut self, value: u32) -> Self {
19392        push_header(self.as_rec_mut(), 7u16, 4 as u16);
19393        self.as_rec_mut().extend(value.to_ne_bytes());
19394        self
19395    }
19396    pub fn push_collisions(mut self, value: u32) -> Self {
19397        push_header(self.as_rec_mut(), 8u16, 4 as u16);
19398        self.as_rec_mut().extend(value.to_ne_bytes());
19399        self
19400    }
19401    pub fn push_tx_bytes(mut self, value: u32) -> Self {
19402        push_header(self.as_rec_mut(), 9u16, 4 as u16);
19403        self.as_rec_mut().extend(value.to_ne_bytes());
19404        self
19405    }
19406    pub fn push_tx_packets(mut self, value: u32) -> Self {
19407        push_header(self.as_rec_mut(), 10u16, 4 as u16);
19408        self.as_rec_mut().extend(value.to_ne_bytes());
19409        self
19410    }
19411    pub fn push_max_flows(mut self, value: u32) -> Self {
19412        push_header(self.as_rec_mut(), 11u16, 4 as u16);
19413        self.as_rec_mut().extend(value.to_ne_bytes());
19414        self
19415    }
19416}
19417impl<Prev: Rec> Drop for PushTxqStatsAttrs<Prev> {
19418    fn drop(&mut self) {
19419        if let Some(prev) = &mut self.prev {
19420            if let Some(header_offset) = &self.header_offset {
19421                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19422            }
19423        }
19424    }
19425}
19426pub struct PushWmmAttrs<Prev: Rec> {
19427    pub(crate) prev: Option<Prev>,
19428    pub(crate) header_offset: Option<usize>,
19429}
19430impl<Prev: Rec> Rec for PushWmmAttrs<Prev> {
19431    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19432        self.prev.as_mut().unwrap().as_rec_mut()
19433    }
19434    fn as_rec(&self) -> &Vec<u8> {
19435        self.prev.as_ref().unwrap().as_rec()
19436    }
19437}
19438impl<Prev: Rec> PushWmmAttrs<Prev> {
19439    pub fn new(prev: Prev) -> Self {
19440        Self {
19441            prev: Some(prev),
19442            header_offset: None,
19443        }
19444    }
19445    pub fn end_nested(mut self) -> Prev {
19446        let mut prev = self.prev.take().unwrap();
19447        if let Some(header_offset) = &self.header_offset {
19448            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19449        }
19450        prev
19451    }
19452    pub fn push_cw_min(mut self, value: u16) -> Self {
19453        push_header(self.as_rec_mut(), 1u16, 2 as u16);
19454        self.as_rec_mut().extend(value.to_ne_bytes());
19455        self
19456    }
19457    pub fn push_cw_max(mut self, value: u16) -> Self {
19458        push_header(self.as_rec_mut(), 2u16, 2 as u16);
19459        self.as_rec_mut().extend(value.to_ne_bytes());
19460        self
19461    }
19462    pub fn push_aifsn(mut self, value: u8) -> Self {
19463        push_header(self.as_rec_mut(), 3u16, 1 as u16);
19464        self.as_rec_mut().extend(value.to_ne_bytes());
19465        self
19466    }
19467    pub fn push_txop(mut self, value: u16) -> Self {
19468        push_header(self.as_rec_mut(), 4u16, 2 as u16);
19469        self.as_rec_mut().extend(value.to_ne_bytes());
19470        self
19471    }
19472}
19473impl<Prev: Rec> Drop for PushWmmAttrs<Prev> {
19474    fn drop(&mut self) {
19475        if let Some(prev) = &mut self.prev {
19476            if let Some(header_offset) = &self.header_offset {
19477                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19478            }
19479        }
19480    }
19481}
19482pub struct PushWowlanTriggersAttrs<Prev: Rec> {
19483    pub(crate) prev: Option<Prev>,
19484    pub(crate) header_offset: Option<usize>,
19485}
19486impl<Prev: Rec> Rec for PushWowlanTriggersAttrs<Prev> {
19487    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19488        self.prev.as_mut().unwrap().as_rec_mut()
19489    }
19490    fn as_rec(&self) -> &Vec<u8> {
19491        self.prev.as_ref().unwrap().as_rec()
19492    }
19493}
19494impl<Prev: Rec> PushWowlanTriggersAttrs<Prev> {
19495    pub fn new(prev: Prev) -> Self {
19496        Self {
19497            prev: Some(prev),
19498            header_offset: None,
19499        }
19500    }
19501    pub fn end_nested(mut self) -> Prev {
19502        let mut prev = self.prev.take().unwrap();
19503        if let Some(header_offset) = &self.header_offset {
19504            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19505        }
19506        prev
19507    }
19508    pub fn push_any(mut self, value: ()) -> Self {
19509        push_header(self.as_rec_mut(), 1u16, 0 as u16);
19510        self
19511    }
19512    pub fn push_disconnect(mut self, value: ()) -> Self {
19513        push_header(self.as_rec_mut(), 2u16, 0 as u16);
19514        self
19515    }
19516    pub fn push_magic_pkt(mut self, value: ()) -> Self {
19517        push_header(self.as_rec_mut(), 3u16, 0 as u16);
19518        self
19519    }
19520    pub fn push_pkt_pattern(mut self, value: ()) -> Self {
19521        push_header(self.as_rec_mut(), 4u16, 0 as u16);
19522        self
19523    }
19524    pub fn push_gtk_rekey_supported(mut self, value: ()) -> Self {
19525        push_header(self.as_rec_mut(), 5u16, 0 as u16);
19526        self
19527    }
19528    pub fn push_gtk_rekey_failure(mut self, value: ()) -> Self {
19529        push_header(self.as_rec_mut(), 6u16, 0 as u16);
19530        self
19531    }
19532    pub fn push_eap_ident_request(mut self, value: ()) -> Self {
19533        push_header(self.as_rec_mut(), 7u16, 0 as u16);
19534        self
19535    }
19536    pub fn push_4way_handshake(mut self, value: ()) -> Self {
19537        push_header(self.as_rec_mut(), 8u16, 0 as u16);
19538        self
19539    }
19540    pub fn push_rfkill_release(mut self, value: ()) -> Self {
19541        push_header(self.as_rec_mut(), 9u16, 0 as u16);
19542        self
19543    }
19544    pub fn push_wakeup_pkt_80211(mut self, value: ()) -> Self {
19545        push_header(self.as_rec_mut(), 10u16, 0 as u16);
19546        self
19547    }
19548    pub fn push_wakeup_pkt_80211_len(mut self, value: ()) -> Self {
19549        push_header(self.as_rec_mut(), 11u16, 0 as u16);
19550        self
19551    }
19552    pub fn push_wakeup_pkt_8023(mut self, value: ()) -> Self {
19553        push_header(self.as_rec_mut(), 12u16, 0 as u16);
19554        self
19555    }
19556    pub fn push_wakeup_pkt_8023_len(mut self, value: ()) -> Self {
19557        push_header(self.as_rec_mut(), 13u16, 0 as u16);
19558        self
19559    }
19560    pub fn push_tcp_connection(mut self, value: ()) -> Self {
19561        push_header(self.as_rec_mut(), 14u16, 0 as u16);
19562        self
19563    }
19564    pub fn push_wakeup_tcp_match(mut self, value: ()) -> Self {
19565        push_header(self.as_rec_mut(), 15u16, 0 as u16);
19566        self
19567    }
19568    pub fn push_wakeup_tcp_connlost(mut self, value: ()) -> Self {
19569        push_header(self.as_rec_mut(), 16u16, 0 as u16);
19570        self
19571    }
19572    pub fn push_wakeup_tcp_nomoretokens(mut self, value: ()) -> Self {
19573        push_header(self.as_rec_mut(), 17u16, 0 as u16);
19574        self
19575    }
19576    pub fn push_net_detect(mut self, value: ()) -> Self {
19577        push_header(self.as_rec_mut(), 18u16, 0 as u16);
19578        self
19579    }
19580    pub fn push_net_detect_results(mut self, value: ()) -> Self {
19581        push_header(self.as_rec_mut(), 19u16, 0 as u16);
19582        self
19583    }
19584    pub fn push_unprotected_deauth_disassoc(mut self, value: ()) -> Self {
19585        push_header(self.as_rec_mut(), 20u16, 0 as u16);
19586        self
19587    }
19588}
19589impl<Prev: Rec> Drop for PushWowlanTriggersAttrs<Prev> {
19590    fn drop(&mut self) {
19591        if let Some(prev) = &mut self.prev {
19592            if let Some(header_offset) = &self.header_offset {
19593                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19594            }
19595        }
19596    }
19597}
19598pub struct NotifGroup;
19599impl NotifGroup {
19600    pub const CONFIG: &str = "config";
19601    pub const CONFIG_CSTR: &CStr = c"config";
19602    pub const SCAN: &str = "scan";
19603    pub const SCAN_CSTR: &CStr = c"scan";
19604    pub const REGULATORY: &str = "regulatory";
19605    pub const REGULATORY_CSTR: &CStr = c"regulatory";
19606    pub const MLME: &str = "mlme";
19607    pub const MLME_CSTR: &CStr = c"mlme";
19608    pub const VENDOR: &str = "vendor";
19609    pub const VENDOR_CSTR: &CStr = c"vendor";
19610    pub const NAN: &str = "nan";
19611    pub const NAN_CSTR: &CStr = c"nan";
19612    pub const TESTMODE: &str = "testmode";
19613    pub const TESTMODE_CSTR: &CStr = c"testmode";
19614}
19615#[doc = "Get information about a wiphy or dump a list of all wiphys\\. Requests to\ndump get\\-wiphy should unconditionally include the split\\-wiphy\\-dump flag\nin the request\\.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n- [.push_split_wiphy_dump()](PushNl80211Attrs::push_split_wiphy_dump)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n"]
19616#[derive(Debug)]
19617pub struct OpGetWiphyDump<'r> {
19618    request: Request<'r>,
19619}
19620impl<'r> OpGetWiphyDump<'r> {
19621    pub fn new(mut request: Request<'r>) -> Self {
19622        Self::write_header(request.buf_mut());
19623        Self {
19624            request: request.set_dump(),
19625        }
19626    }
19627    pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19628        Self::write_header(buf);
19629        PushNl80211Attrs::new(buf)
19630    }
19631    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19632        PushNl80211Attrs::new(self.request.buf_mut())
19633    }
19634    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19635        PushNl80211Attrs::new(self.request.buf)
19636    }
19637    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19638        let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19639        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19640    }
19641    fn write_header<Prev: Rec>(prev: &mut Prev) {
19642        let mut header = BuiltinNfgenmsg::new();
19643        header.cmd = 1u8;
19644        header.version = 1u8;
19645        prev.as_rec_mut().extend(header.as_slice());
19646    }
19647}
19648impl NetlinkRequest for OpGetWiphyDump<'_> {
19649    fn protocol(&self) -> Protocol {
19650        Protocol::Generic("nl80211".as_bytes())
19651    }
19652    fn flags(&self) -> u16 {
19653        self.request.flags
19654    }
19655    fn payload(&self) -> &[u8] {
19656        self.request.buf()
19657    }
19658    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19659    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19660        Self::decode_request(buf)
19661    }
19662    fn lookup(
19663        buf: &[u8],
19664        offset: usize,
19665        missing_type: Option<u16>,
19666    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19667        Self::decode_request(buf).lookup_attr(offset, missing_type)
19668    }
19669}
19670#[doc = "Get information about a wiphy or dump a list of all wiphys\\. Requests to\ndump get\\-wiphy should unconditionally include the split\\-wiphy\\-dump flag\nin the request\\.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n"]
19671#[derive(Debug)]
19672pub struct OpGetWiphyDo<'r> {
19673    request: Request<'r>,
19674}
19675impl<'r> OpGetWiphyDo<'r> {
19676    pub fn new(mut request: Request<'r>) -> Self {
19677        Self::write_header(request.buf_mut());
19678        Self { request: request }
19679    }
19680    pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19681        Self::write_header(buf);
19682        PushNl80211Attrs::new(buf)
19683    }
19684    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19685        PushNl80211Attrs::new(self.request.buf_mut())
19686    }
19687    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19688        PushNl80211Attrs::new(self.request.buf)
19689    }
19690    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19691        let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19692        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19693    }
19694    fn write_header<Prev: Rec>(prev: &mut Prev) {
19695        let mut header = BuiltinNfgenmsg::new();
19696        header.cmd = 1u8;
19697        header.version = 1u8;
19698        prev.as_rec_mut().extend(header.as_slice());
19699    }
19700}
19701impl NetlinkRequest for OpGetWiphyDo<'_> {
19702    fn protocol(&self) -> Protocol {
19703        Protocol::Generic("nl80211".as_bytes())
19704    }
19705    fn flags(&self) -> u16 {
19706        self.request.flags
19707    }
19708    fn payload(&self) -> &[u8] {
19709        self.request.buf()
19710    }
19711    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19712    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19713        Self::decode_request(buf)
19714    }
19715    fn lookup(
19716        buf: &[u8],
19717        offset: usize,
19718        missing_type: Option<u16>,
19719    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19720        Self::decode_request(buf).lookup_attr(offset, missing_type)
19721    }
19722}
19723#[doc = "Get information about an interface or dump a list of all interfaces\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n"]
19724#[derive(Debug)]
19725pub struct OpGetInterfaceDump<'r> {
19726    request: Request<'r>,
19727}
19728impl<'r> OpGetInterfaceDump<'r> {
19729    pub fn new(mut request: Request<'r>) -> Self {
19730        Self::write_header(request.buf_mut());
19731        Self {
19732            request: request.set_dump(),
19733        }
19734    }
19735    pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19736        Self::write_header(buf);
19737        PushNl80211Attrs::new(buf)
19738    }
19739    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19740        PushNl80211Attrs::new(self.request.buf_mut())
19741    }
19742    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19743        PushNl80211Attrs::new(self.request.buf)
19744    }
19745    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19746        let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19747        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19748    }
19749    fn write_header<Prev: Rec>(prev: &mut Prev) {
19750        let mut header = BuiltinNfgenmsg::new();
19751        header.cmd = 5u8;
19752        header.version = 1u8;
19753        prev.as_rec_mut().extend(header.as_slice());
19754    }
19755}
19756impl NetlinkRequest for OpGetInterfaceDump<'_> {
19757    fn protocol(&self) -> Protocol {
19758        Protocol::Generic("nl80211".as_bytes())
19759    }
19760    fn flags(&self) -> u16 {
19761        self.request.flags
19762    }
19763    fn payload(&self) -> &[u8] {
19764        self.request.buf()
19765    }
19766    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19767    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19768        Self::decode_request(buf)
19769    }
19770    fn lookup(
19771        buf: &[u8],
19772        offset: usize,
19773        missing_type: Option<u16>,
19774    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19775        Self::decode_request(buf).lookup_attr(offset, missing_type)
19776    }
19777}
19778#[doc = "Get information about an interface or dump a list of all interfaces\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n"]
19779#[derive(Debug)]
19780pub struct OpGetInterfaceDo<'r> {
19781    request: Request<'r>,
19782}
19783impl<'r> OpGetInterfaceDo<'r> {
19784    pub fn new(mut request: Request<'r>) -> Self {
19785        Self::write_header(request.buf_mut());
19786        Self { request: request }
19787    }
19788    pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19789        Self::write_header(buf);
19790        PushNl80211Attrs::new(buf)
19791    }
19792    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19793        PushNl80211Attrs::new(self.request.buf_mut())
19794    }
19795    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19796        PushNl80211Attrs::new(self.request.buf)
19797    }
19798    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19799        let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19800        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19801    }
19802    fn write_header<Prev: Rec>(prev: &mut Prev) {
19803        let mut header = BuiltinNfgenmsg::new();
19804        header.cmd = 5u8;
19805        header.version = 1u8;
19806        prev.as_rec_mut().extend(header.as_slice());
19807    }
19808}
19809impl NetlinkRequest for OpGetInterfaceDo<'_> {
19810    fn protocol(&self) -> Protocol {
19811        Protocol::Generic("nl80211".as_bytes())
19812    }
19813    fn flags(&self) -> u16 {
19814        self.request.flags
19815    }
19816    fn payload(&self) -> &[u8] {
19817        self.request.buf()
19818    }
19819    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19820    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19821        Self::decode_request(buf)
19822    }
19823    fn lookup(
19824        buf: &[u8],
19825        offset: usize,
19826        missing_type: Option<u16>,
19827    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19828        Self::decode_request(buf).lookup_attr(offset, missing_type)
19829    }
19830}
19831#[doc = "Get information about supported protocol features\nRequest attributes:\n- [.push_protocol_features()](PushNl80211Attrs::push_protocol_features)\n\nReply attributes:\n- [.get_protocol_features()](IterableNl80211Attrs::get_protocol_features)\n"]
19832#[derive(Debug)]
19833pub struct OpGetProtocolFeaturesDo<'r> {
19834    request: Request<'r>,
19835}
19836impl<'r> OpGetProtocolFeaturesDo<'r> {
19837    pub fn new(mut request: Request<'r>) -> Self {
19838        Self::write_header(request.buf_mut());
19839        Self { request: request }
19840    }
19841    pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19842        Self::write_header(buf);
19843        PushNl80211Attrs::new(buf)
19844    }
19845    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19846        PushNl80211Attrs::new(self.request.buf_mut())
19847    }
19848    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19849        PushNl80211Attrs::new(self.request.buf)
19850    }
19851    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19852        let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19853        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19854    }
19855    fn write_header<Prev: Rec>(prev: &mut Prev) {
19856        let mut header = BuiltinNfgenmsg::new();
19857        header.cmd = 95u8;
19858        header.version = 1u8;
19859        prev.as_rec_mut().extend(header.as_slice());
19860    }
19861}
19862impl NetlinkRequest for OpGetProtocolFeaturesDo<'_> {
19863    fn protocol(&self) -> Protocol {
19864        Protocol::Generic("nl80211".as_bytes())
19865    }
19866    fn flags(&self) -> u16 {
19867        self.request.flags
19868    }
19869    fn payload(&self) -> &[u8] {
19870        self.request.buf()
19871    }
19872    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19873    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19874        Self::decode_request(buf)
19875    }
19876    fn lookup(
19877        buf: &[u8],
19878        offset: usize,
19879        missing_type: Option<u16>,
19880    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19881        Self::decode_request(buf).lookup_attr(offset, missing_type)
19882    }
19883}
19884#[doc = ""]
19885#[derive(Debug)]
19886pub struct OpDump<'r> {
19887    request: Request<'r>,
19888}
19889impl<'r> OpDump<'r> {
19890    pub fn new(mut request: Request<'r>, request_type: u8) -> Self {
19891        Self::write_header(request.buf_mut(), request_type);
19892        Self {
19893            request: request.set_dump(),
19894        }
19895    }
19896    pub fn encode_request<'buf>(
19897        buf: &'buf mut Vec<u8>,
19898        request_type: u8,
19899    ) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19900        Self::write_header(buf, request_type);
19901        PushNl80211Attrs::new(buf)
19902    }
19903    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19904        PushNl80211Attrs::new(self.request.buf_mut())
19905    }
19906    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19907        PushNl80211Attrs::new(self.request.buf)
19908    }
19909    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19910        let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19911        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19912    }
19913    fn write_header<Prev: Rec>(prev: &mut Prev, request_type: u8) {
19914        let mut header = BuiltinNfgenmsg::new();
19915        header.cmd = request_type;
19916        header.version = 1u8;
19917        prev.as_rec_mut().extend(header.as_slice());
19918    }
19919}
19920impl NetlinkRequest for OpDump<'_> {
19921    fn protocol(&self) -> Protocol {
19922        Protocol::Generic("nl80211".as_bytes())
19923    }
19924    fn flags(&self) -> u16 {
19925        self.request.flags
19926    }
19927    fn payload(&self) -> &[u8] {
19928        self.request.buf()
19929    }
19930    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19931    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19932        Self::decode_request(buf)
19933    }
19934    fn lookup(
19935        buf: &[u8],
19936        offset: usize,
19937        missing_type: Option<u16>,
19938    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19939        Self::decode_request(buf).lookup_attr(offset, missing_type)
19940    }
19941}
19942#[doc = ""]
19943#[derive(Debug)]
19944pub struct OpDo<'r> {
19945    request: Request<'r>,
19946}
19947impl<'r> OpDo<'r> {
19948    pub fn new(mut request: Request<'r>, request_type: u8) -> Self {
19949        Self::write_header(request.buf_mut(), request_type);
19950        Self { request: request }
19951    }
19952    pub fn encode_request<'buf>(
19953        buf: &'buf mut Vec<u8>,
19954        request_type: u8,
19955    ) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19956        Self::write_header(buf, request_type);
19957        PushNl80211Attrs::new(buf)
19958    }
19959    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19960        PushNl80211Attrs::new(self.request.buf_mut())
19961    }
19962    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19963        PushNl80211Attrs::new(self.request.buf)
19964    }
19965    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19966        let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19967        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19968    }
19969    fn write_header<Prev: Rec>(prev: &mut Prev, request_type: u8) {
19970        let mut header = BuiltinNfgenmsg::new();
19971        header.cmd = request_type;
19972        header.version = 1u8;
19973        prev.as_rec_mut().extend(header.as_slice());
19974    }
19975}
19976impl NetlinkRequest for OpDo<'_> {
19977    fn protocol(&self) -> Protocol {
19978        Protocol::Generic("nl80211".as_bytes())
19979    }
19980    fn flags(&self) -> u16 {
19981        self.request.flags
19982    }
19983    fn payload(&self) -> &[u8] {
19984        self.request.buf()
19985    }
19986    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19987    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19988        Self::decode_request(buf)
19989    }
19990    fn lookup(
19991        buf: &[u8],
19992        offset: usize,
19993        missing_type: Option<u16>,
19994    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19995        Self::decode_request(buf).lookup_attr(offset, missing_type)
19996    }
19997}
19998use crate::traits::LookupFn;
19999use crate::utils::RequestBuf;
20000#[derive(Debug)]
20001pub struct Request<'buf> {
20002    buf: RequestBuf<'buf>,
20003    flags: u16,
20004    writeback: Option<&'buf mut Option<RequestInfo>>,
20005}
20006#[allow(unused)]
20007#[derive(Debug, Clone)]
20008pub struct RequestInfo {
20009    protocol: Protocol,
20010    flags: u16,
20011    name: &'static str,
20012    lookup: LookupFn,
20013}
20014impl Request<'static> {
20015    pub fn new() -> Self {
20016        Self::new_from_buf(Vec::new())
20017    }
20018    pub fn new_from_buf(buf: Vec<u8>) -> Self {
20019        Self {
20020            flags: 0,
20021            buf: RequestBuf::Own(buf),
20022            writeback: None,
20023        }
20024    }
20025    pub fn into_buf(self) -> Vec<u8> {
20026        match self.buf {
20027            RequestBuf::Own(buf) => buf,
20028            _ => unreachable!(),
20029        }
20030    }
20031}
20032impl<'buf> Request<'buf> {
20033    pub fn new_with_buf(buf: &'buf mut Vec<u8>) -> Self {
20034        buf.clear();
20035        Self::new_extend(buf)
20036    }
20037    pub fn new_extend(buf: &'buf mut Vec<u8>) -> Self {
20038        Self {
20039            flags: 0,
20040            buf: RequestBuf::Ref(buf),
20041            writeback: None,
20042        }
20043    }
20044    fn do_writeback(&mut self, protocol: Protocol, name: &'static str, lookup: LookupFn) {
20045        let Some(writeback) = &mut self.writeback else {
20046            return;
20047        };
20048        **writeback = Some(RequestInfo {
20049            protocol,
20050            flags: self.flags,
20051            name,
20052            lookup,
20053        })
20054    }
20055    pub fn buf(&self) -> &Vec<u8> {
20056        self.buf.buf()
20057    }
20058    pub fn buf_mut(&mut self) -> &mut Vec<u8> {
20059        self.buf.buf_mut()
20060    }
20061    #[doc = "Set `NLM_F_CREATE` flag"]
20062    pub fn set_create(mut self) -> Self {
20063        self.flags |= consts::NLM_F_CREATE as u16;
20064        self
20065    }
20066    #[doc = "Set `NLM_F_EXCL` flag"]
20067    pub fn set_excl(mut self) -> Self {
20068        self.flags |= consts::NLM_F_EXCL as u16;
20069        self
20070    }
20071    #[doc = "Set `NLM_F_REPLACE` flag"]
20072    pub fn set_replace(mut self) -> Self {
20073        self.flags |= consts::NLM_F_REPLACE as u16;
20074        self
20075    }
20076    #[doc = "Set `NLM_F_CREATE` and `NLM_F_REPLACE` flag"]
20077    pub fn set_change(self) -> Self {
20078        self.set_create().set_replace()
20079    }
20080    #[doc = "Set `NLM_F_APPEND` flag"]
20081    pub fn set_append(mut self) -> Self {
20082        self.flags |= consts::NLM_F_APPEND as u16;
20083        self
20084    }
20085    #[doc = "Set `self.flags |= flags`"]
20086    pub fn set_flags(mut self, flags: u16) -> Self {
20087        self.flags |= flags;
20088        self
20089    }
20090    #[doc = "Set `self.flags ^= self.flags & flags`"]
20091    pub fn unset_flags(mut self, flags: u16) -> Self {
20092        self.flags ^= self.flags & flags;
20093        self
20094    }
20095    #[doc = "Set `NLM_F_DUMP` flag"]
20096    fn set_dump(mut self) -> Self {
20097        self.flags |= consts::NLM_F_DUMP as u16;
20098        self
20099    }
20100    #[doc = "Get information about a wiphy or dump a list of all wiphys\\. Requests to\ndump get\\-wiphy should unconditionally include the split\\-wiphy\\-dump flag\nin the request\\.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n- [.push_split_wiphy_dump()](PushNl80211Attrs::push_split_wiphy_dump)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n"]
20101    pub fn op_get_wiphy_dump(self) -> OpGetWiphyDump<'buf> {
20102        let mut res = OpGetWiphyDump::new(self);
20103        res.request
20104            .do_writeback(res.protocol(), "op-get-wiphy-dump", OpGetWiphyDump::lookup);
20105        res
20106    }
20107    #[doc = "Get information about a wiphy or dump a list of all wiphys\\. Requests to\ndump get\\-wiphy should unconditionally include the split\\-wiphy\\-dump flag\nin the request\\.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n"]
20108    pub fn op_get_wiphy_do(self) -> OpGetWiphyDo<'buf> {
20109        let mut res = OpGetWiphyDo::new(self);
20110        res.request
20111            .do_writeback(res.protocol(), "op-get-wiphy-do", OpGetWiphyDo::lookup);
20112        res
20113    }
20114    #[doc = "Get information about an interface or dump a list of all interfaces\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n"]
20115    pub fn op_get_interface_dump(self) -> OpGetInterfaceDump<'buf> {
20116        let mut res = OpGetInterfaceDump::new(self);
20117        res.request.do_writeback(
20118            res.protocol(),
20119            "op-get-interface-dump",
20120            OpGetInterfaceDump::lookup,
20121        );
20122        res
20123    }
20124    #[doc = "Get information about an interface or dump a list of all interfaces\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n"]
20125    pub fn op_get_interface_do(self) -> OpGetInterfaceDo<'buf> {
20126        let mut res = OpGetInterfaceDo::new(self);
20127        res.request.do_writeback(
20128            res.protocol(),
20129            "op-get-interface-do",
20130            OpGetInterfaceDo::lookup,
20131        );
20132        res
20133    }
20134    #[doc = "Get information about supported protocol features\nRequest attributes:\n- [.push_protocol_features()](PushNl80211Attrs::push_protocol_features)\n\nReply attributes:\n- [.get_protocol_features()](IterableNl80211Attrs::get_protocol_features)\n"]
20135    pub fn op_get_protocol_features_do(self) -> OpGetProtocolFeaturesDo<'buf> {
20136        let mut res = OpGetProtocolFeaturesDo::new(self);
20137        res.request.do_writeback(
20138            res.protocol(),
20139            "op-get-protocol-features-do",
20140            OpGetProtocolFeaturesDo::lookup,
20141        );
20142        res
20143    }
20144    #[doc = ""]
20145    pub fn op_dump(self, request_type: u8) -> OpDump<'buf> {
20146        let mut res = OpDump::new(self, request_type);
20147        res.request
20148            .do_writeback(res.protocol(), "op-dump", OpDump::lookup);
20149        res
20150    }
20151    #[doc = ""]
20152    pub fn op_do(self, request_type: u8) -> OpDo<'buf> {
20153        let mut res = OpDo::new(self, request_type);
20154        res.request
20155            .do_writeback(res.protocol(), "op-do", OpDo::lookup);
20156        res
20157    }
20158}
20159#[cfg(test)]
20160mod generated_tests {
20161    use super::*;
20162    #[test]
20163    fn tests() {
20164        let _ = IterableNl80211Attrs::get_4addr;
20165        let _ = IterableNl80211Attrs::get_bands;
20166        let _ = IterableNl80211Attrs::get_cipher_suites;
20167        let _ = IterableNl80211Attrs::get_control_port_ethertype;
20168        let _ = IterableNl80211Attrs::get_ext_capa;
20169        let _ = IterableNl80211Attrs::get_ext_capa_mask;
20170        let _ = IterableNl80211Attrs::get_ext_features;
20171        let _ = IterableNl80211Attrs::get_feature_flags;
20172        let _ = IterableNl80211Attrs::get_generation;
20173        let _ = IterableNl80211Attrs::get_ht_capability_mask;
20174        let _ = IterableNl80211Attrs::get_ifindex;
20175        let _ = IterableNl80211Attrs::get_ifname;
20176        let _ = IterableNl80211Attrs::get_iftype;
20177        let _ = IterableNl80211Attrs::get_interface_combinations;
20178        let _ = IterableNl80211Attrs::get_mac;
20179        let _ = IterableNl80211Attrs::get_max_csa_counters;
20180        let _ = IterableNl80211Attrs::get_max_match_sets;
20181        let _ = IterableNl80211Attrs::get_max_num_akm_suites;
20182        let _ = IterableNl80211Attrs::get_max_num_pmkids;
20183        let _ = IterableNl80211Attrs::get_max_num_scan_ssids;
20184        let _ = IterableNl80211Attrs::get_max_num_sched_scan_plans;
20185        let _ = IterableNl80211Attrs::get_max_num_sched_scan_ssids;
20186        let _ = IterableNl80211Attrs::get_max_remain_on_channel_duration;
20187        let _ = IterableNl80211Attrs::get_max_scan_ie_len;
20188        let _ = IterableNl80211Attrs::get_max_scan_plan_interval;
20189        let _ = IterableNl80211Attrs::get_max_scan_plan_iterations;
20190        let _ = IterableNl80211Attrs::get_max_sched_scan_ie_len;
20191        let _ = IterableNl80211Attrs::get_offchannel_tx_ok;
20192        let _ = IterableNl80211Attrs::get_protocol_features;
20193        let _ = IterableNl80211Attrs::get_rx_frame_types;
20194        let _ = IterableNl80211Attrs::get_sar_spec;
20195        let _ = IterableNl80211Attrs::get_sched_scan_max_reqs;
20196        let _ = IterableNl80211Attrs::get_software_iftypes;
20197        let _ = IterableNl80211Attrs::get_support_ap_uapsd;
20198        let _ = IterableNl80211Attrs::get_supported_commands;
20199        let _ = IterableNl80211Attrs::get_supported_iftypes;
20200        let _ = IterableNl80211Attrs::get_tdls_external_setup;
20201        let _ = IterableNl80211Attrs::get_tdls_support;
20202        let _ = IterableNl80211Attrs::get_tx_frame_types;
20203        let _ = IterableNl80211Attrs::get_txq_limit;
20204        let _ = IterableNl80211Attrs::get_txq_memory_limit;
20205        let _ = IterableNl80211Attrs::get_txq_quantum;
20206        let _ = IterableNl80211Attrs::get_txq_stats;
20207        let _ = IterableNl80211Attrs::get_vht_capability_mask;
20208        let _ = IterableNl80211Attrs::get_wdev;
20209        let _ = IterableNl80211Attrs::get_wiphy;
20210        let _ = IterableNl80211Attrs::get_wiphy_antenna_avail_rx;
20211        let _ = IterableNl80211Attrs::get_wiphy_antenna_avail_tx;
20212        let _ = IterableNl80211Attrs::get_wiphy_antenna_rx;
20213        let _ = IterableNl80211Attrs::get_wiphy_antenna_tx;
20214        let _ = IterableNl80211Attrs::get_wiphy_bands;
20215        let _ = IterableNl80211Attrs::get_wiphy_coverage_class;
20216        let _ = IterableNl80211Attrs::get_wiphy_frag_threshold;
20217        let _ = IterableNl80211Attrs::get_wiphy_name;
20218        let _ = IterableNl80211Attrs::get_wiphy_retry_long;
20219        let _ = IterableNl80211Attrs::get_wiphy_retry_short;
20220        let _ = IterableNl80211Attrs::get_wiphy_rts_threshold;
20221        let _ = IterableNl80211Attrs::get_wowlan_triggers_supported;
20222        let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_ifindex;
20223        let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_ifname;
20224        let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_protocol_features;
20225        let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_split_wiphy_dump;
20226        let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_wdev;
20227        let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_wiphy;
20228    }
20229}