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::{PushBuiltinBitfield32, PushBuiltinNfgenmsg, PushDummy, PushNlmsghdr};
11use crate::{
12    consts,
13    traits::{NetlinkRequest, Protocol},
14    utils::*,
15};
16pub const PROTONAME: &CStr = c"nl80211";
17#[doc = "Enum - defines an integer enumeration, with values for each entry incrementing by 1, (e.g. 0, 1, 2, 3)"]
18#[derive(Debug, Clone, Copy)]
19pub enum Commands {
20    Unspec = 0,
21    GetWiphy = 1,
22    SetWiphy = 2,
23    NewWiphy = 3,
24    DelWiphy = 4,
25    GetInterface = 5,
26    SetInterface = 6,
27    NewInterface = 7,
28    DelInterface = 8,
29    GetKey = 9,
30    SetKey = 10,
31    NewKey = 11,
32    DelKey = 12,
33    GetBeacon = 13,
34    SetBeacon = 14,
35    NewBeacon = 15,
36    DelBeacon = 16,
37    GetStation = 17,
38    SetStation = 18,
39    NewStation = 19,
40    DelStation = 20,
41    GetMpath = 21,
42    SetMpath = 22,
43    NewMpath = 23,
44    DelMpath = 24,
45    SetBss = 25,
46    SetReg = 26,
47    ReqSetReg = 27,
48    GetMeshConfig = 28,
49    SetMeshConfig = 29,
50    SetMgmtExtraIe = 30,
51    GetReg = 31,
52    GetScan = 32,
53    TriggerScan = 33,
54    NewScanResults = 34,
55    ScanAborted = 35,
56    RegChange = 36,
57    Authenticate = 37,
58    Associate = 38,
59    Deauthenticate = 39,
60    Disassociate = 40,
61    MichaelMicFailure = 41,
62    RegBeaconHint = 42,
63    JoinIbss = 43,
64    LeaveIbss = 44,
65    Testmode = 45,
66    Connect = 46,
67    Roam = 47,
68    Disconnect = 48,
69    SetWiphyNetns = 49,
70    GetSurvey = 50,
71    NewSurveyResults = 51,
72    SetPmksa = 52,
73    DelPmksa = 53,
74    FlushPmksa = 54,
75    RemainOnChannel = 55,
76    CancelRemainOnChannel = 56,
77    SetTxBitrateMask = 57,
78    RegisterAction = 58,
79    Action = 59,
80    ActionTxStatus = 60,
81    SetPowerSave = 61,
82    GetPowerSave = 62,
83    SetCqm = 63,
84    NotifyCqm = 64,
85    SetChannel = 65,
86    SetWdsPeer = 66,
87    FrameWaitCancel = 67,
88    JoinMesh = 68,
89    LeaveMesh = 69,
90    UnprotDeauthenticate = 70,
91    UnprotDisassociate = 71,
92    NewPeerCandidate = 72,
93    GetWowlan = 73,
94    SetWowlan = 74,
95    StartSchedScan = 75,
96    StopSchedScan = 76,
97    SchedScanResults = 77,
98    SchedScanStopped = 78,
99    SetRekeyOffload = 79,
100    PmksaCandidate = 80,
101    TdlsOper = 81,
102    TdlsMgmt = 82,
103    UnexpectedFrame = 83,
104    ProbeClient = 84,
105    RegisterBeacons = 85,
106    Unexpected4AddrFrame = 86,
107    SetNoackMap = 87,
108    ChSwitchNotify = 88,
109    StartP2pDevice = 89,
110    StopP2pDevice = 90,
111    ConnFailed = 91,
112    SetMcastRate = 92,
113    SetMacAcl = 93,
114    RadarDetect = 94,
115    GetProtocolFeatures = 95,
116    UpdateFtIes = 96,
117    FtEvent = 97,
118    CritProtocolStart = 98,
119    CritProtocolStop = 99,
120    GetCoalesce = 100,
121    SetCoalesce = 101,
122    ChannelSwitch = 102,
123    Vendor = 103,
124    SetQosMap = 104,
125    AddTxTs = 105,
126    DelTxTs = 106,
127    GetMpp = 107,
128    JoinOcb = 108,
129    LeaveOcb = 109,
130    ChSwitchStartedNotify = 110,
131    TdlsChannelSwitch = 111,
132    TdlsCancelChannelSwitch = 112,
133    WiphyRegChange = 113,
134    AbortScan = 114,
135    StartNan = 115,
136    StopNan = 116,
137    AddNanFunction = 117,
138    DelNanFunction = 118,
139    ChangeNanConfig = 119,
140    NanMatch = 120,
141    SetMulticastToUnicast = 121,
142    UpdateConnectParams = 122,
143    SetPmk = 123,
144    DelPmk = 124,
145    PortAuthorized = 125,
146    ReloadRegdb = 126,
147    ExternalAuth = 127,
148    StaOpmodeChanged = 128,
149    ControlPortFrame = 129,
150    GetFtmResponderStats = 130,
151    PeerMeasurementStart = 131,
152    PeerMeasurementResult = 132,
153    PeerMeasurementComplete = 133,
154    NotifyRadar = 134,
155    UpdateOweInfo = 135,
156    ProbeMeshLink = 136,
157    SetTidConfig = 137,
158    UnprotBeacon = 138,
159    ControlPortFrameTxStatus = 139,
160    SetSarSpecs = 140,
161    ObssColorCollision = 141,
162    ColorChangeRequest = 142,
163    ColorChangeStarted = 143,
164    ColorChangeAborted = 144,
165    ColorChangeCompleted = 145,
166    SetFilsAad = 146,
167    AssocComeback = 147,
168    AddLink = 148,
169    RemoveLink = 149,
170    AddLinkSta = 150,
171    ModifyLinkSta = 151,
172    RemoveLinkSta = 152,
173    SetHwTimestamp = 153,
174    LinksRemoved = 154,
175    SetTidToLinkMapping = 155,
176}
177impl Commands {
178    pub fn from_value(value: u64) -> Option<Self> {
179        Some(match value {
180            0 => Self::Unspec,
181            1 => Self::GetWiphy,
182            2 => Self::SetWiphy,
183            3 => Self::NewWiphy,
184            4 => Self::DelWiphy,
185            5 => Self::GetInterface,
186            6 => Self::SetInterface,
187            7 => Self::NewInterface,
188            8 => Self::DelInterface,
189            9 => Self::GetKey,
190            10 => Self::SetKey,
191            11 => Self::NewKey,
192            12 => Self::DelKey,
193            13 => Self::GetBeacon,
194            14 => Self::SetBeacon,
195            15 => Self::NewBeacon,
196            16 => Self::DelBeacon,
197            17 => Self::GetStation,
198            18 => Self::SetStation,
199            19 => Self::NewStation,
200            20 => Self::DelStation,
201            21 => Self::GetMpath,
202            22 => Self::SetMpath,
203            23 => Self::NewMpath,
204            24 => Self::DelMpath,
205            25 => Self::SetBss,
206            26 => Self::SetReg,
207            27 => Self::ReqSetReg,
208            28 => Self::GetMeshConfig,
209            29 => Self::SetMeshConfig,
210            30 => Self::SetMgmtExtraIe,
211            31 => Self::GetReg,
212            32 => Self::GetScan,
213            33 => Self::TriggerScan,
214            34 => Self::NewScanResults,
215            35 => Self::ScanAborted,
216            36 => Self::RegChange,
217            37 => Self::Authenticate,
218            38 => Self::Associate,
219            39 => Self::Deauthenticate,
220            40 => Self::Disassociate,
221            41 => Self::MichaelMicFailure,
222            42 => Self::RegBeaconHint,
223            43 => Self::JoinIbss,
224            44 => Self::LeaveIbss,
225            45 => Self::Testmode,
226            46 => Self::Connect,
227            47 => Self::Roam,
228            48 => Self::Disconnect,
229            49 => Self::SetWiphyNetns,
230            50 => Self::GetSurvey,
231            51 => Self::NewSurveyResults,
232            52 => Self::SetPmksa,
233            53 => Self::DelPmksa,
234            54 => Self::FlushPmksa,
235            55 => Self::RemainOnChannel,
236            56 => Self::CancelRemainOnChannel,
237            57 => Self::SetTxBitrateMask,
238            58 => Self::RegisterAction,
239            59 => Self::Action,
240            60 => Self::ActionTxStatus,
241            61 => Self::SetPowerSave,
242            62 => Self::GetPowerSave,
243            63 => Self::SetCqm,
244            64 => Self::NotifyCqm,
245            65 => Self::SetChannel,
246            66 => Self::SetWdsPeer,
247            67 => Self::FrameWaitCancel,
248            68 => Self::JoinMesh,
249            69 => Self::LeaveMesh,
250            70 => Self::UnprotDeauthenticate,
251            71 => Self::UnprotDisassociate,
252            72 => Self::NewPeerCandidate,
253            73 => Self::GetWowlan,
254            74 => Self::SetWowlan,
255            75 => Self::StartSchedScan,
256            76 => Self::StopSchedScan,
257            77 => Self::SchedScanResults,
258            78 => Self::SchedScanStopped,
259            79 => Self::SetRekeyOffload,
260            80 => Self::PmksaCandidate,
261            81 => Self::TdlsOper,
262            82 => Self::TdlsMgmt,
263            83 => Self::UnexpectedFrame,
264            84 => Self::ProbeClient,
265            85 => Self::RegisterBeacons,
266            86 => Self::Unexpected4AddrFrame,
267            87 => Self::SetNoackMap,
268            88 => Self::ChSwitchNotify,
269            89 => Self::StartP2pDevice,
270            90 => Self::StopP2pDevice,
271            91 => Self::ConnFailed,
272            92 => Self::SetMcastRate,
273            93 => Self::SetMacAcl,
274            94 => Self::RadarDetect,
275            95 => Self::GetProtocolFeatures,
276            96 => Self::UpdateFtIes,
277            97 => Self::FtEvent,
278            98 => Self::CritProtocolStart,
279            99 => Self::CritProtocolStop,
280            100 => Self::GetCoalesce,
281            101 => Self::SetCoalesce,
282            102 => Self::ChannelSwitch,
283            103 => Self::Vendor,
284            104 => Self::SetQosMap,
285            105 => Self::AddTxTs,
286            106 => Self::DelTxTs,
287            107 => Self::GetMpp,
288            108 => Self::JoinOcb,
289            109 => Self::LeaveOcb,
290            110 => Self::ChSwitchStartedNotify,
291            111 => Self::TdlsChannelSwitch,
292            112 => Self::TdlsCancelChannelSwitch,
293            113 => Self::WiphyRegChange,
294            114 => Self::AbortScan,
295            115 => Self::StartNan,
296            116 => Self::StopNan,
297            117 => Self::AddNanFunction,
298            118 => Self::DelNanFunction,
299            119 => Self::ChangeNanConfig,
300            120 => Self::NanMatch,
301            121 => Self::SetMulticastToUnicast,
302            122 => Self::UpdateConnectParams,
303            123 => Self::SetPmk,
304            124 => Self::DelPmk,
305            125 => Self::PortAuthorized,
306            126 => Self::ReloadRegdb,
307            127 => Self::ExternalAuth,
308            128 => Self::StaOpmodeChanged,
309            129 => Self::ControlPortFrame,
310            130 => Self::GetFtmResponderStats,
311            131 => Self::PeerMeasurementStart,
312            132 => Self::PeerMeasurementResult,
313            133 => Self::PeerMeasurementComplete,
314            134 => Self::NotifyRadar,
315            135 => Self::UpdateOweInfo,
316            136 => Self::ProbeMeshLink,
317            137 => Self::SetTidConfig,
318            138 => Self::UnprotBeacon,
319            139 => Self::ControlPortFrameTxStatus,
320            140 => Self::SetSarSpecs,
321            141 => Self::ObssColorCollision,
322            142 => Self::ColorChangeRequest,
323            143 => Self::ColorChangeStarted,
324            144 => Self::ColorChangeAborted,
325            145 => Self::ColorChangeCompleted,
326            146 => Self::SetFilsAad,
327            147 => Self::AssocComeback,
328            148 => Self::AddLink,
329            149 => Self::RemoveLink,
330            150 => Self::AddLinkSta,
331            151 => Self::ModifyLinkSta,
332            152 => Self::RemoveLinkSta,
333            153 => Self::SetHwTimestamp,
334            154 => Self::LinksRemoved,
335            155 => Self::SetTidToLinkMapping,
336            _ => return None,
337        })
338    }
339}
340#[doc = "Flags - defines an integer enumeration, with values for each entry occupying a bit, starting from bit 0, (e.g. 1, 2, 4, 8)"]
341#[derive(Debug, Clone, Copy)]
342pub enum FeatureFlags {
343    SkTxStatus = 1 << 0,
344    HtIbss = 1 << 1,
345    InactivityTimer = 1 << 2,
346    CellBaseRegHints = 1 << 3,
347    P2pDeviceNeedsChannel = 1 << 4,
348    Sae = 1 << 5,
349    LowPriorityScan = 1 << 6,
350    ScanFlush = 1 << 7,
351    ApScan = 1 << 8,
352    VifTxpower = 1 << 9,
353    NeedObssScan = 1 << 10,
354    P2pGoCtwin = 1 << 11,
355    P2pGoOppps = 1 << 12,
356    Reserved = 1 << 13,
357    AdvertiseChanLimits = 1 << 14,
358    FullApClientState = 1 << 15,
359    UserspaceMpm = 1 << 16,
360    ActiveMonitor = 1 << 17,
361    ApModeChanWidthChange = 1 << 18,
362    DsParamSetIeInProbes = 1 << 19,
363    WfaTpcIeInProbes = 1 << 20,
364    Quiet = 1 << 21,
365    TxPowerInsertion = 1 << 22,
366    AcktoEstimation = 1 << 23,
367    StaticSmps = 1 << 24,
368    DynamicSmps = 1 << 25,
369    SupportsWmmAdmission = 1 << 26,
370    MacOnCreate = 1 << 27,
371    TdlsChannelSwitch = 1 << 28,
372    ScanRandomMacAddr = 1 << 29,
373    SchedScanRandomMacAddr = 1 << 30,
374    NoRandomMacAddr = 1 << 31,
375}
376impl FeatureFlags {
377    pub fn from_value(value: u64) -> Option<Self> {
378        Some(match value {
379            n if n == 1 << 0 => Self::SkTxStatus,
380            n if n == 1 << 1 => Self::HtIbss,
381            n if n == 1 << 2 => Self::InactivityTimer,
382            n if n == 1 << 3 => Self::CellBaseRegHints,
383            n if n == 1 << 4 => Self::P2pDeviceNeedsChannel,
384            n if n == 1 << 5 => Self::Sae,
385            n if n == 1 << 6 => Self::LowPriorityScan,
386            n if n == 1 << 7 => Self::ScanFlush,
387            n if n == 1 << 8 => Self::ApScan,
388            n if n == 1 << 9 => Self::VifTxpower,
389            n if n == 1 << 10 => Self::NeedObssScan,
390            n if n == 1 << 11 => Self::P2pGoCtwin,
391            n if n == 1 << 12 => Self::P2pGoOppps,
392            n if n == 1 << 13 => Self::Reserved,
393            n if n == 1 << 14 => Self::AdvertiseChanLimits,
394            n if n == 1 << 15 => Self::FullApClientState,
395            n if n == 1 << 16 => Self::UserspaceMpm,
396            n if n == 1 << 17 => Self::ActiveMonitor,
397            n if n == 1 << 18 => Self::ApModeChanWidthChange,
398            n if n == 1 << 19 => Self::DsParamSetIeInProbes,
399            n if n == 1 << 20 => Self::WfaTpcIeInProbes,
400            n if n == 1 << 21 => Self::Quiet,
401            n if n == 1 << 22 => Self::TxPowerInsertion,
402            n if n == 1 << 23 => Self::AcktoEstimation,
403            n if n == 1 << 24 => Self::StaticSmps,
404            n if n == 1 << 25 => Self::DynamicSmps,
405            n if n == 1 << 26 => Self::SupportsWmmAdmission,
406            n if n == 1 << 27 => Self::MacOnCreate,
407            n if n == 1 << 28 => Self::TdlsChannelSwitch,
408            n if n == 1 << 29 => Self::ScanRandomMacAddr,
409            n if n == 1 << 30 => Self::SchedScanRandomMacAddr,
410            n if n == 1 << 31 => Self::NoRandomMacAddr,
411            _ => return None,
412        })
413    }
414}
415#[doc = "Enum - defines an integer enumeration, with values for each entry incrementing by 1, (e.g. 0, 1, 2, 3)"]
416#[derive(Debug, Clone, Copy)]
417pub enum ChannelType {
418    NoHt = 0,
419    Ht20 = 1,
420    Ht40minus = 2,
421    Ht40plus = 3,
422}
423impl ChannelType {
424    pub fn from_value(value: u64) -> Option<Self> {
425        Some(match value {
426            0 => Self::NoHt,
427            1 => Self::Ht20,
428            2 => Self::Ht40minus,
429            3 => Self::Ht40plus,
430            _ => return None,
431        })
432    }
433}
434#[doc = "Flags - defines an integer enumeration, with values for each entry occupying a bit, starting from bit 0, (e.g. 1, 2, 4, 8)"]
435#[derive(Debug, Clone, Copy)]
436pub enum ProtocolFeatures {
437    SplitWiphyDump = 1 << 0,
438}
439impl ProtocolFeatures {
440    pub fn from_value(value: u64) -> Option<Self> {
441        Some(match value {
442            n if n == 1 << 0 => Self::SplitWiphyDump,
443            _ => return None,
444        })
445    }
446}
447#[derive(Clone)]
448pub enum Nl80211Attrs<'a> {
449    Wiphy(u32),
450    WiphyName(&'a CStr),
451    Ifindex(u32),
452    Ifname(&'a CStr),
453    Iftype(u32),
454    Mac(&'a [u8]),
455    KeyData(&'a [u8]),
456    KeyIdx(u8),
457    KeyCipher(u32),
458    KeySeq(&'a [u8]),
459    KeyDefault(()),
460    BeaconInterval(u32),
461    DtimPeriod(u32),
462    BeaconHead(&'a [u8]),
463    BeaconTail(&'a [u8]),
464    StaAid(u16),
465    StaFlags(&'a [u8]),
466    StaListenInterval(u16),
467    StaSupportedRates(&'a [u8]),
468    StaVlan(u32),
469    StaInfo(&'a [u8]),
470    WiphyBands(IterableWiphyBands<'a>),
471    MntrFlags(&'a [u8]),
472    MeshId(&'a [u8]),
473    StaPlinkAction(u8),
474    MpathNextHop(&'a [u8]),
475    MpathInfo(&'a [u8]),
476    BssCtsProt(u8),
477    BssShortPreamble(u8),
478    BssShortSlotTime(u8),
479    HtCapability(&'a [u8]),
480    SupportedIftypes(IterableSupportedIftypes<'a>),
481    RegAlpha2(&'a [u8]),
482    RegRules(&'a [u8]),
483    MeshConfig(&'a [u8]),
484    BssBasicRates(&'a [u8]),
485    WiphyTxqParams(&'a [u8]),
486    WiphyFreq(u32),
487    #[doc = "Associated type: \"ChannelType\" (enum)"]
488    WiphyChannelType(u32),
489    KeyDefaultMgmt(()),
490    MgmtSubtype(u8),
491    Ie(&'a [u8]),
492    MaxNumScanSsids(u8),
493    ScanFrequencies(&'a [u8]),
494    ScanSsids(&'a [u8]),
495    Generation(u32),
496    Bss(&'a [u8]),
497    RegInitiator(u8),
498    RegType(u8),
499    #[doc = "Associated type: \"Commands\" (enum)"]
500    SupportedCommands(IterableArrayU32<'a>),
501    Frame(&'a [u8]),
502    Ssid(&'a [u8]),
503    AuthType(u32),
504    ReasonCode(u16),
505    KeyType(u32),
506    MaxScanIeLen(u16),
507    CipherSuites(&'a [u8]),
508    FreqBefore(&'a [u8]),
509    FreqAfter(&'a [u8]),
510    FreqFixed(()),
511    WiphyRetryShort(u8),
512    WiphyRetryLong(u8),
513    WiphyFragThreshold(u32),
514    WiphyRtsThreshold(u32),
515    TimedOut(()),
516    UseMfp(u32),
517    StaFlags2(PushStaFlagUpdate),
518    ControlPort(()),
519    Testdata(&'a [u8]),
520    Privacy(()),
521    DisconnectedByAp(()),
522    StatusCode(u16),
523    CipherSuitesPairwise(&'a [u8]),
524    CipherSuiteGroup(u32),
525    WpaVersions(u32),
526    AkmSuites(&'a [u8]),
527    ReqIe(&'a [u8]),
528    RespIe(&'a [u8]),
529    PrevBssid(&'a [u8]),
530    Key(&'a [u8]),
531    Keys(&'a [u8]),
532    Pid(u32),
533    _4addr(u8),
534    SurveyInfo(&'a [u8]),
535    Pmkid(&'a [u8]),
536    MaxNumPmkids(u8),
537    Duration(u32),
538    Cookie(u64),
539    WiphyCoverageClass(u8),
540    TxRates(&'a [u8]),
541    FrameMatch(&'a [u8]),
542    Ack(()),
543    PsState(u32),
544    Cqm(&'a [u8]),
545    LocalStateChange(()),
546    ApIsolate(u8),
547    WiphyTxPowerSetting(u32),
548    WiphyTxPowerLevel(u32),
549    TxFrameTypes(IterableIftypeAttrs<'a>),
550    RxFrameTypes(IterableIftypeAttrs<'a>),
551    FrameType(u16),
552    ControlPortEthertype(()),
553    ControlPortNoEncrypt(()),
554    SupportIbssRsn(()),
555    WiphyAntennaTx(u32),
556    WiphyAntennaRx(u32),
557    McastRate(u32),
558    OffchannelTxOk(()),
559    BssHtOpmode(u16),
560    KeyDefaultTypes(&'a [u8]),
561    MaxRemainOnChannelDuration(u32),
562    MeshSetup(&'a [u8]),
563    WiphyAntennaAvailTx(u32),
564    WiphyAntennaAvailRx(u32),
565    SupportMeshAuth(()),
566    StaPlinkState(u8),
567    WowlanTriggers(&'a [u8]),
568    WowlanTriggersSupported(IterableWowlanTriggersAttrs<'a>),
569    SchedScanInterval(u32),
570    InterfaceCombinations(IterableArrayIfCombinationAttributes<'a>),
571    SoftwareIftypes(IterableSupportedIftypes<'a>),
572    RekeyData(&'a [u8]),
573    MaxNumSchedScanSsids(u8),
574    MaxSchedScanIeLen(u16),
575    ScanSuppRates(&'a [u8]),
576    HiddenSsid(u32),
577    IeProbeResp(&'a [u8]),
578    IeAssocResp(&'a [u8]),
579    StaWme(&'a [u8]),
580    SupportApUapsd(()),
581    RoamSupport(()),
582    SchedScanMatch(&'a [u8]),
583    MaxMatchSets(u8),
584    PmksaCandidate(&'a [u8]),
585    TxNoCckRate(()),
586    TdlsAction(u8),
587    TdlsDialogToken(u8),
588    TdlsOperation(u8),
589    TdlsSupport(()),
590    TdlsExternalSetup(()),
591    DeviceApSme(u32),
592    DontWaitForAck(()),
593    #[doc = "Associated type: \"FeatureFlags\" (1 bit per enumeration)"]
594    FeatureFlags(u32),
595    ProbeRespOffload(u32),
596    ProbeResp(&'a [u8]),
597    DfsRegion(u8),
598    DisableHt(()),
599    HtCapabilityMask(&'a [u8]),
600    NoackMap(u16),
601    InactivityTimeout(u16),
602    RxSignalDbm(u32),
603    BgScanPeriod(u16),
604    Wdev(u64),
605    UserRegHintType(u32),
606    ConnFailedReason(u32),
607    AuthData(&'a [u8]),
608    VhtCapability(&'a [u8]),
609    ScanFlags(u32),
610    ChannelWidth(u32),
611    CenterFreq1(u32),
612    CenterFreq2(u32),
613    P2pCtwindow(u8),
614    P2pOppps(u8),
615    LocalMeshPowerMode(u32),
616    AclPolicy(u32),
617    MacAddrs(&'a [u8]),
618    MacAclMax(u32),
619    RadarEvent(u32),
620    ExtCapa(&'a [u8]),
621    ExtCapaMask(&'a [u8]),
622    StaCapability(u16),
623    StaExtCapability(&'a [u8]),
624    #[doc = "Associated type: \"ProtocolFeatures\" (enum)"]
625    ProtocolFeatures(u32),
626    SplitWiphyDump(()),
627    DisableVht(()),
628    VhtCapabilityMask(&'a [u8]),
629    Mdid(u16),
630    IeRic(&'a [u8]),
631    CritProtId(u16),
632    MaxCritProtDuration(u16),
633    PeerAid(u16),
634    CoalesceRule(&'a [u8]),
635    ChSwitchCount(u32),
636    ChSwitchBlockTx(()),
637    CsaIes(&'a [u8]),
638    CntdwnOffsBeacon(&'a [u8]),
639    CntdwnOffsPresp(&'a [u8]),
640    RxmgmtFlags(&'a [u8]),
641    StaSupportedChannels(&'a [u8]),
642    StaSupportedOperClasses(&'a [u8]),
643    HandleDfs(()),
644    Support5Mhz(()),
645    Support10Mhz(()),
646    OpmodeNotif(u8),
647    VendorId(u32),
648    VendorSubcmd(u32),
649    VendorData(&'a [u8]),
650    VendorEvents(&'a [u8]),
651    QosMap(&'a [u8]),
652    MacHint(&'a [u8]),
653    WiphyFreqHint(u32),
654    MaxApAssocSta(u32),
655    TdlsPeerCapability(u32),
656    SocketOwner(()),
657    CsaCOffsetsTx(&'a [u8]),
658    MaxCsaCounters(u8),
659    TdlsInitiator(()),
660    UseRrm(()),
661    WiphyDynAck(()),
662    Tsid(u8),
663    UserPrio(u8),
664    AdmittedTime(u16),
665    SmpsMode(u8),
666    OperClass(u8),
667    MacMask(&'a [u8]),
668    WiphySelfManagedReg(()),
669    ExtFeatures(&'a [u8]),
670    SurveyRadioStats(&'a [u8]),
671    NetnsFd(u32),
672    SchedScanDelay(u32),
673    RegIndoor(()),
674    MaxNumSchedScanPlans(u32),
675    MaxScanPlanInterval(u32),
676    MaxScanPlanIterations(u32),
677    SchedScanPlans(&'a [u8]),
678    Pbss(()),
679    BssSelect(&'a [u8]),
680    StaSupportP2pPs(u8),
681    Pad(&'a [u8]),
682    IftypeExtCapa(&'a [u8]),
683    MuMimoGroupData(&'a [u8]),
684    MuMimoFollowMacAddr(&'a [u8]),
685    ScanStartTimeTsf(u64),
686    ScanStartTimeTsfBssid(&'a [u8]),
687    MeasurementDuration(u16),
688    MeasurementDurationMandatory(()),
689    MeshPeerAid(u16),
690    NanMasterPref(u8),
691    Bands(u32),
692    NanFunc(&'a [u8]),
693    NanMatch(&'a [u8]),
694    FilsKek(&'a [u8]),
695    FilsNonces(&'a [u8]),
696    MulticastToUnicastEnabled(()),
697    Bssid(&'a [u8]),
698    SchedScanRelativeRssi(i8),
699    SchedScanRssiAdjust(&'a [u8]),
700    TimeoutReason(u32),
701    FilsErpUsername(&'a [u8]),
702    FilsErpRealm(&'a [u8]),
703    FilsErpNextSeqNum(u16),
704    FilsErpRrk(&'a [u8]),
705    FilsCacheId(&'a [u8]),
706    Pmk(&'a [u8]),
707    SchedScanMulti(()),
708    SchedScanMaxReqs(u32),
709    Want1x4wayHs(()),
710    Pmkr0Name(&'a [u8]),
711    PortAuthorized(&'a [u8]),
712    ExternalAuthAction(u32),
713    ExternalAuthSupport(()),
714    Nss(u8),
715    AckSignal(i32),
716    ControlPortOverNl80211(()),
717    TxqStats(IterableTxqStatsAttrs<'a>),
718    TxqLimit(u32),
719    TxqMemoryLimit(u32),
720    TxqQuantum(u32),
721    HeCapability(&'a [u8]),
722    FtmResponder(&'a [u8]),
723    FtmResponderStats(&'a [u8]),
724    Timeout(u32),
725    PeerMeasurements(&'a [u8]),
726    AirtimeWeight(u16),
727    StaTxPowerSetting(u8),
728    StaTxPower(i16),
729    SaePassword(&'a [u8]),
730    TwtResponder(()),
731    HeObssPd(&'a [u8]),
732    WiphyEdmgChannels(u8),
733    WiphyEdmgBwConfig(u8),
734    VlanId(u16),
735    HeBssColor(&'a [u8]),
736    IftypeAkmSuites(&'a [u8]),
737    TidConfig(&'a [u8]),
738    ControlPortNoPreauth(()),
739    PmkLifetime(u32),
740    PmkReauthThreshold(u8),
741    ReceiveMulticast(()),
742    WiphyFreqOffset(u32),
743    CenterFreq1Offset(u32),
744    ScanFreqKhz(&'a [u8]),
745    He6ghzCapability(&'a [u8]),
746    FilsDiscovery(&'a [u8]),
747    UnsolBcastProbeResp(&'a [u8]),
748    S1gCapability(&'a [u8]),
749    S1gCapabilityMask(&'a [u8]),
750    SaePwe(u8),
751    ReconnectRequested(&'a [u8]),
752    SarSpec(IterableSarAttributes<'a>),
753    DisableHe(()),
754    ObssColorBitmap(u64),
755    ColorChangeCount(u8),
756    ColorChangeColor(u8),
757    ColorChangeElems(&'a [u8]),
758    MbssidConfig(&'a [u8]),
759    MbssidElems(&'a [u8]),
760    RadarBackground(()),
761    ApSettingsFlags(u32),
762    EhtCapability(&'a [u8]),
763    DisableEht(()),
764    MloLinks(&'a [u8]),
765    MloLinkId(u8),
766    MldAddr(&'a [u8]),
767    MloSupport(()),
768    MaxNumAkmSuites(&'a [u8]),
769    EmlCapability(u16),
770    MldCapaAndOps(u16),
771    TxHwTimestamp(u64),
772    RxHwTimestamp(u64),
773    TdBitmap(&'a [u8]),
774    PunctBitmap(u32),
775    MaxHwTimestampPeers(u16),
776    HwTimestampEnabled(()),
777    EmaRnrElems(&'a [u8]),
778    MloLinkDisabled(()),
779    BssDumpIncludeUseData(()),
780    MloTtlmDlink(u16),
781    MloTtlmUlink(u16),
782    AssocSppAmsdu(()),
783    WiphyRadios(&'a [u8]),
784    WiphyInterfaceCombinations(&'a [u8]),
785    VifRadioMask(u32),
786}
787impl<'a> IterableNl80211Attrs<'a> {
788    pub fn get_wiphy(&self) -> Result<u32, ErrorContext> {
789        let mut iter = self.clone();
790        iter.pos = 0;
791        for attr in iter {
792            if let Nl80211Attrs::Wiphy(val) = attr? {
793                return Ok(val);
794            }
795        }
796        Err(ErrorContext::new_missing(
797            "Nl80211Attrs",
798            "Wiphy",
799            self.orig_loc,
800            self.buf.as_ptr() as usize,
801        ))
802    }
803    pub fn get_wiphy_name(&self) -> Result<&'a CStr, ErrorContext> {
804        let mut iter = self.clone();
805        iter.pos = 0;
806        for attr in iter {
807            if let Nl80211Attrs::WiphyName(val) = attr? {
808                return Ok(val);
809            }
810        }
811        Err(ErrorContext::new_missing(
812            "Nl80211Attrs",
813            "WiphyName",
814            self.orig_loc,
815            self.buf.as_ptr() as usize,
816        ))
817    }
818    pub fn get_ifindex(&self) -> Result<u32, ErrorContext> {
819        let mut iter = self.clone();
820        iter.pos = 0;
821        for attr in iter {
822            if let Nl80211Attrs::Ifindex(val) = attr? {
823                return Ok(val);
824            }
825        }
826        Err(ErrorContext::new_missing(
827            "Nl80211Attrs",
828            "Ifindex",
829            self.orig_loc,
830            self.buf.as_ptr() as usize,
831        ))
832    }
833    pub fn get_ifname(&self) -> Result<&'a CStr, ErrorContext> {
834        let mut iter = self.clone();
835        iter.pos = 0;
836        for attr in iter {
837            if let Nl80211Attrs::Ifname(val) = attr? {
838                return Ok(val);
839            }
840        }
841        Err(ErrorContext::new_missing(
842            "Nl80211Attrs",
843            "Ifname",
844            self.orig_loc,
845            self.buf.as_ptr() as usize,
846        ))
847    }
848    pub fn get_iftype(&self) -> Result<u32, ErrorContext> {
849        let mut iter = self.clone();
850        iter.pos = 0;
851        for attr in iter {
852            if let Nl80211Attrs::Iftype(val) = attr? {
853                return Ok(val);
854            }
855        }
856        Err(ErrorContext::new_missing(
857            "Nl80211Attrs",
858            "Iftype",
859            self.orig_loc,
860            self.buf.as_ptr() as usize,
861        ))
862    }
863    pub fn get_mac(&self) -> Result<&'a [u8], ErrorContext> {
864        let mut iter = self.clone();
865        iter.pos = 0;
866        for attr in iter {
867            if let Nl80211Attrs::Mac(val) = attr? {
868                return Ok(val);
869            }
870        }
871        Err(ErrorContext::new_missing(
872            "Nl80211Attrs",
873            "Mac",
874            self.orig_loc,
875            self.buf.as_ptr() as usize,
876        ))
877    }
878    pub fn get_key_data(&self) -> Result<&'a [u8], ErrorContext> {
879        let mut iter = self.clone();
880        iter.pos = 0;
881        for attr in iter {
882            if let Nl80211Attrs::KeyData(val) = attr? {
883                return Ok(val);
884            }
885        }
886        Err(ErrorContext::new_missing(
887            "Nl80211Attrs",
888            "KeyData",
889            self.orig_loc,
890            self.buf.as_ptr() as usize,
891        ))
892    }
893    pub fn get_key_idx(&self) -> Result<u8, ErrorContext> {
894        let mut iter = self.clone();
895        iter.pos = 0;
896        for attr in iter {
897            if let Nl80211Attrs::KeyIdx(val) = attr? {
898                return Ok(val);
899            }
900        }
901        Err(ErrorContext::new_missing(
902            "Nl80211Attrs",
903            "KeyIdx",
904            self.orig_loc,
905            self.buf.as_ptr() as usize,
906        ))
907    }
908    pub fn get_key_cipher(&self) -> Result<u32, ErrorContext> {
909        let mut iter = self.clone();
910        iter.pos = 0;
911        for attr in iter {
912            if let Nl80211Attrs::KeyCipher(val) = attr? {
913                return Ok(val);
914            }
915        }
916        Err(ErrorContext::new_missing(
917            "Nl80211Attrs",
918            "KeyCipher",
919            self.orig_loc,
920            self.buf.as_ptr() as usize,
921        ))
922    }
923    pub fn get_key_seq(&self) -> Result<&'a [u8], ErrorContext> {
924        let mut iter = self.clone();
925        iter.pos = 0;
926        for attr in iter {
927            if let Nl80211Attrs::KeySeq(val) = attr? {
928                return Ok(val);
929            }
930        }
931        Err(ErrorContext::new_missing(
932            "Nl80211Attrs",
933            "KeySeq",
934            self.orig_loc,
935            self.buf.as_ptr() as usize,
936        ))
937    }
938    pub fn get_key_default(&self) -> Result<(), ErrorContext> {
939        let mut iter = self.clone();
940        iter.pos = 0;
941        for attr in iter {
942            if let Nl80211Attrs::KeyDefault(val) = attr? {
943                return Ok(val);
944            }
945        }
946        Err(ErrorContext::new_missing(
947            "Nl80211Attrs",
948            "KeyDefault",
949            self.orig_loc,
950            self.buf.as_ptr() as usize,
951        ))
952    }
953    pub fn get_beacon_interval(&self) -> Result<u32, ErrorContext> {
954        let mut iter = self.clone();
955        iter.pos = 0;
956        for attr in iter {
957            if let Nl80211Attrs::BeaconInterval(val) = attr? {
958                return Ok(val);
959            }
960        }
961        Err(ErrorContext::new_missing(
962            "Nl80211Attrs",
963            "BeaconInterval",
964            self.orig_loc,
965            self.buf.as_ptr() as usize,
966        ))
967    }
968    pub fn get_dtim_period(&self) -> Result<u32, ErrorContext> {
969        let mut iter = self.clone();
970        iter.pos = 0;
971        for attr in iter {
972            if let Nl80211Attrs::DtimPeriod(val) = attr? {
973                return Ok(val);
974            }
975        }
976        Err(ErrorContext::new_missing(
977            "Nl80211Attrs",
978            "DtimPeriod",
979            self.orig_loc,
980            self.buf.as_ptr() as usize,
981        ))
982    }
983    pub fn get_beacon_head(&self) -> Result<&'a [u8], ErrorContext> {
984        let mut iter = self.clone();
985        iter.pos = 0;
986        for attr in iter {
987            if let Nl80211Attrs::BeaconHead(val) = attr? {
988                return Ok(val);
989            }
990        }
991        Err(ErrorContext::new_missing(
992            "Nl80211Attrs",
993            "BeaconHead",
994            self.orig_loc,
995            self.buf.as_ptr() as usize,
996        ))
997    }
998    pub fn get_beacon_tail(&self) -> Result<&'a [u8], ErrorContext> {
999        let mut iter = self.clone();
1000        iter.pos = 0;
1001        for attr in iter {
1002            if let Nl80211Attrs::BeaconTail(val) = attr? {
1003                return Ok(val);
1004            }
1005        }
1006        Err(ErrorContext::new_missing(
1007            "Nl80211Attrs",
1008            "BeaconTail",
1009            self.orig_loc,
1010            self.buf.as_ptr() as usize,
1011        ))
1012    }
1013    pub fn get_sta_aid(&self) -> Result<u16, ErrorContext> {
1014        let mut iter = self.clone();
1015        iter.pos = 0;
1016        for attr in iter {
1017            if let Nl80211Attrs::StaAid(val) = attr? {
1018                return Ok(val);
1019            }
1020        }
1021        Err(ErrorContext::new_missing(
1022            "Nl80211Attrs",
1023            "StaAid",
1024            self.orig_loc,
1025            self.buf.as_ptr() as usize,
1026        ))
1027    }
1028    pub fn get_sta_flags(&self) -> Result<&'a [u8], ErrorContext> {
1029        let mut iter = self.clone();
1030        iter.pos = 0;
1031        for attr in iter {
1032            if let Nl80211Attrs::StaFlags(val) = attr? {
1033                return Ok(val);
1034            }
1035        }
1036        Err(ErrorContext::new_missing(
1037            "Nl80211Attrs",
1038            "StaFlags",
1039            self.orig_loc,
1040            self.buf.as_ptr() as usize,
1041        ))
1042    }
1043    pub fn get_sta_listen_interval(&self) -> Result<u16, ErrorContext> {
1044        let mut iter = self.clone();
1045        iter.pos = 0;
1046        for attr in iter {
1047            if let Nl80211Attrs::StaListenInterval(val) = attr? {
1048                return Ok(val);
1049            }
1050        }
1051        Err(ErrorContext::new_missing(
1052            "Nl80211Attrs",
1053            "StaListenInterval",
1054            self.orig_loc,
1055            self.buf.as_ptr() as usize,
1056        ))
1057    }
1058    pub fn get_sta_supported_rates(&self) -> Result<&'a [u8], ErrorContext> {
1059        let mut iter = self.clone();
1060        iter.pos = 0;
1061        for attr in iter {
1062            if let Nl80211Attrs::StaSupportedRates(val) = attr? {
1063                return Ok(val);
1064            }
1065        }
1066        Err(ErrorContext::new_missing(
1067            "Nl80211Attrs",
1068            "StaSupportedRates",
1069            self.orig_loc,
1070            self.buf.as_ptr() as usize,
1071        ))
1072    }
1073    pub fn get_sta_vlan(&self) -> Result<u32, ErrorContext> {
1074        let mut iter = self.clone();
1075        iter.pos = 0;
1076        for attr in iter {
1077            if let Nl80211Attrs::StaVlan(val) = attr? {
1078                return Ok(val);
1079            }
1080        }
1081        Err(ErrorContext::new_missing(
1082            "Nl80211Attrs",
1083            "StaVlan",
1084            self.orig_loc,
1085            self.buf.as_ptr() as usize,
1086        ))
1087    }
1088    pub fn get_sta_info(&self) -> Result<&'a [u8], ErrorContext> {
1089        let mut iter = self.clone();
1090        iter.pos = 0;
1091        for attr in iter {
1092            if let Nl80211Attrs::StaInfo(val) = attr? {
1093                return Ok(val);
1094            }
1095        }
1096        Err(ErrorContext::new_missing(
1097            "Nl80211Attrs",
1098            "StaInfo",
1099            self.orig_loc,
1100            self.buf.as_ptr() as usize,
1101        ))
1102    }
1103    pub fn get_wiphy_bands(&self) -> Result<IterableWiphyBands<'a>, ErrorContext> {
1104        let mut iter = self.clone();
1105        iter.pos = 0;
1106        for attr in iter {
1107            if let Nl80211Attrs::WiphyBands(val) = attr? {
1108                return Ok(val);
1109            }
1110        }
1111        Err(ErrorContext::new_missing(
1112            "Nl80211Attrs",
1113            "WiphyBands",
1114            self.orig_loc,
1115            self.buf.as_ptr() as usize,
1116        ))
1117    }
1118    pub fn get_mntr_flags(&self) -> Result<&'a [u8], ErrorContext> {
1119        let mut iter = self.clone();
1120        iter.pos = 0;
1121        for attr in iter {
1122            if let Nl80211Attrs::MntrFlags(val) = attr? {
1123                return Ok(val);
1124            }
1125        }
1126        Err(ErrorContext::new_missing(
1127            "Nl80211Attrs",
1128            "MntrFlags",
1129            self.orig_loc,
1130            self.buf.as_ptr() as usize,
1131        ))
1132    }
1133    pub fn get_mesh_id(&self) -> Result<&'a [u8], ErrorContext> {
1134        let mut iter = self.clone();
1135        iter.pos = 0;
1136        for attr in iter {
1137            if let Nl80211Attrs::MeshId(val) = attr? {
1138                return Ok(val);
1139            }
1140        }
1141        Err(ErrorContext::new_missing(
1142            "Nl80211Attrs",
1143            "MeshId",
1144            self.orig_loc,
1145            self.buf.as_ptr() as usize,
1146        ))
1147    }
1148    pub fn get_sta_plink_action(&self) -> Result<u8, ErrorContext> {
1149        let mut iter = self.clone();
1150        iter.pos = 0;
1151        for attr in iter {
1152            if let Nl80211Attrs::StaPlinkAction(val) = attr? {
1153                return Ok(val);
1154            }
1155        }
1156        Err(ErrorContext::new_missing(
1157            "Nl80211Attrs",
1158            "StaPlinkAction",
1159            self.orig_loc,
1160            self.buf.as_ptr() as usize,
1161        ))
1162    }
1163    pub fn get_mpath_next_hop(&self) -> Result<&'a [u8], ErrorContext> {
1164        let mut iter = self.clone();
1165        iter.pos = 0;
1166        for attr in iter {
1167            if let Nl80211Attrs::MpathNextHop(val) = attr? {
1168                return Ok(val);
1169            }
1170        }
1171        Err(ErrorContext::new_missing(
1172            "Nl80211Attrs",
1173            "MpathNextHop",
1174            self.orig_loc,
1175            self.buf.as_ptr() as usize,
1176        ))
1177    }
1178    pub fn get_mpath_info(&self) -> Result<&'a [u8], ErrorContext> {
1179        let mut iter = self.clone();
1180        iter.pos = 0;
1181        for attr in iter {
1182            if let Nl80211Attrs::MpathInfo(val) = attr? {
1183                return Ok(val);
1184            }
1185        }
1186        Err(ErrorContext::new_missing(
1187            "Nl80211Attrs",
1188            "MpathInfo",
1189            self.orig_loc,
1190            self.buf.as_ptr() as usize,
1191        ))
1192    }
1193    pub fn get_bss_cts_prot(&self) -> Result<u8, ErrorContext> {
1194        let mut iter = self.clone();
1195        iter.pos = 0;
1196        for attr in iter {
1197            if let Nl80211Attrs::BssCtsProt(val) = attr? {
1198                return Ok(val);
1199            }
1200        }
1201        Err(ErrorContext::new_missing(
1202            "Nl80211Attrs",
1203            "BssCtsProt",
1204            self.orig_loc,
1205            self.buf.as_ptr() as usize,
1206        ))
1207    }
1208    pub fn get_bss_short_preamble(&self) -> Result<u8, ErrorContext> {
1209        let mut iter = self.clone();
1210        iter.pos = 0;
1211        for attr in iter {
1212            if let Nl80211Attrs::BssShortPreamble(val) = attr? {
1213                return Ok(val);
1214            }
1215        }
1216        Err(ErrorContext::new_missing(
1217            "Nl80211Attrs",
1218            "BssShortPreamble",
1219            self.orig_loc,
1220            self.buf.as_ptr() as usize,
1221        ))
1222    }
1223    pub fn get_bss_short_slot_time(&self) -> Result<u8, ErrorContext> {
1224        let mut iter = self.clone();
1225        iter.pos = 0;
1226        for attr in iter {
1227            if let Nl80211Attrs::BssShortSlotTime(val) = attr? {
1228                return Ok(val);
1229            }
1230        }
1231        Err(ErrorContext::new_missing(
1232            "Nl80211Attrs",
1233            "BssShortSlotTime",
1234            self.orig_loc,
1235            self.buf.as_ptr() as usize,
1236        ))
1237    }
1238    pub fn get_ht_capability(&self) -> Result<&'a [u8], ErrorContext> {
1239        let mut iter = self.clone();
1240        iter.pos = 0;
1241        for attr in iter {
1242            if let Nl80211Attrs::HtCapability(val) = attr? {
1243                return Ok(val);
1244            }
1245        }
1246        Err(ErrorContext::new_missing(
1247            "Nl80211Attrs",
1248            "HtCapability",
1249            self.orig_loc,
1250            self.buf.as_ptr() as usize,
1251        ))
1252    }
1253    pub fn get_supported_iftypes(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
1254        let mut iter = self.clone();
1255        iter.pos = 0;
1256        for attr in iter {
1257            if let Nl80211Attrs::SupportedIftypes(val) = attr? {
1258                return Ok(val);
1259            }
1260        }
1261        Err(ErrorContext::new_missing(
1262            "Nl80211Attrs",
1263            "SupportedIftypes",
1264            self.orig_loc,
1265            self.buf.as_ptr() as usize,
1266        ))
1267    }
1268    pub fn get_reg_alpha2(&self) -> Result<&'a [u8], ErrorContext> {
1269        let mut iter = self.clone();
1270        iter.pos = 0;
1271        for attr in iter {
1272            if let Nl80211Attrs::RegAlpha2(val) = attr? {
1273                return Ok(val);
1274            }
1275        }
1276        Err(ErrorContext::new_missing(
1277            "Nl80211Attrs",
1278            "RegAlpha2",
1279            self.orig_loc,
1280            self.buf.as_ptr() as usize,
1281        ))
1282    }
1283    pub fn get_reg_rules(&self) -> Result<&'a [u8], ErrorContext> {
1284        let mut iter = self.clone();
1285        iter.pos = 0;
1286        for attr in iter {
1287            if let Nl80211Attrs::RegRules(val) = attr? {
1288                return Ok(val);
1289            }
1290        }
1291        Err(ErrorContext::new_missing(
1292            "Nl80211Attrs",
1293            "RegRules",
1294            self.orig_loc,
1295            self.buf.as_ptr() as usize,
1296        ))
1297    }
1298    pub fn get_mesh_config(&self) -> Result<&'a [u8], ErrorContext> {
1299        let mut iter = self.clone();
1300        iter.pos = 0;
1301        for attr in iter {
1302            if let Nl80211Attrs::MeshConfig(val) = attr? {
1303                return Ok(val);
1304            }
1305        }
1306        Err(ErrorContext::new_missing(
1307            "Nl80211Attrs",
1308            "MeshConfig",
1309            self.orig_loc,
1310            self.buf.as_ptr() as usize,
1311        ))
1312    }
1313    pub fn get_bss_basic_rates(&self) -> Result<&'a [u8], ErrorContext> {
1314        let mut iter = self.clone();
1315        iter.pos = 0;
1316        for attr in iter {
1317            if let Nl80211Attrs::BssBasicRates(val) = attr? {
1318                return Ok(val);
1319            }
1320        }
1321        Err(ErrorContext::new_missing(
1322            "Nl80211Attrs",
1323            "BssBasicRates",
1324            self.orig_loc,
1325            self.buf.as_ptr() as usize,
1326        ))
1327    }
1328    pub fn get_wiphy_txq_params(&self) -> Result<&'a [u8], ErrorContext> {
1329        let mut iter = self.clone();
1330        iter.pos = 0;
1331        for attr in iter {
1332            if let Nl80211Attrs::WiphyTxqParams(val) = attr? {
1333                return Ok(val);
1334            }
1335        }
1336        Err(ErrorContext::new_missing(
1337            "Nl80211Attrs",
1338            "WiphyTxqParams",
1339            self.orig_loc,
1340            self.buf.as_ptr() as usize,
1341        ))
1342    }
1343    pub fn get_wiphy_freq(&self) -> Result<u32, ErrorContext> {
1344        let mut iter = self.clone();
1345        iter.pos = 0;
1346        for attr in iter {
1347            if let Nl80211Attrs::WiphyFreq(val) = attr? {
1348                return Ok(val);
1349            }
1350        }
1351        Err(ErrorContext::new_missing(
1352            "Nl80211Attrs",
1353            "WiphyFreq",
1354            self.orig_loc,
1355            self.buf.as_ptr() as usize,
1356        ))
1357    }
1358    #[doc = "Associated type: \"ChannelType\" (enum)"]
1359    pub fn get_wiphy_channel_type(&self) -> Result<u32, ErrorContext> {
1360        let mut iter = self.clone();
1361        iter.pos = 0;
1362        for attr in iter {
1363            if let Nl80211Attrs::WiphyChannelType(val) = attr? {
1364                return Ok(val);
1365            }
1366        }
1367        Err(ErrorContext::new_missing(
1368            "Nl80211Attrs",
1369            "WiphyChannelType",
1370            self.orig_loc,
1371            self.buf.as_ptr() as usize,
1372        ))
1373    }
1374    pub fn get_key_default_mgmt(&self) -> Result<(), ErrorContext> {
1375        let mut iter = self.clone();
1376        iter.pos = 0;
1377        for attr in iter {
1378            if let Nl80211Attrs::KeyDefaultMgmt(val) = attr? {
1379                return Ok(val);
1380            }
1381        }
1382        Err(ErrorContext::new_missing(
1383            "Nl80211Attrs",
1384            "KeyDefaultMgmt",
1385            self.orig_loc,
1386            self.buf.as_ptr() as usize,
1387        ))
1388    }
1389    pub fn get_mgmt_subtype(&self) -> Result<u8, ErrorContext> {
1390        let mut iter = self.clone();
1391        iter.pos = 0;
1392        for attr in iter {
1393            if let Nl80211Attrs::MgmtSubtype(val) = attr? {
1394                return Ok(val);
1395            }
1396        }
1397        Err(ErrorContext::new_missing(
1398            "Nl80211Attrs",
1399            "MgmtSubtype",
1400            self.orig_loc,
1401            self.buf.as_ptr() as usize,
1402        ))
1403    }
1404    pub fn get_ie(&self) -> Result<&'a [u8], ErrorContext> {
1405        let mut iter = self.clone();
1406        iter.pos = 0;
1407        for attr in iter {
1408            if let Nl80211Attrs::Ie(val) = attr? {
1409                return Ok(val);
1410            }
1411        }
1412        Err(ErrorContext::new_missing(
1413            "Nl80211Attrs",
1414            "Ie",
1415            self.orig_loc,
1416            self.buf.as_ptr() as usize,
1417        ))
1418    }
1419    pub fn get_max_num_scan_ssids(&self) -> Result<u8, ErrorContext> {
1420        let mut iter = self.clone();
1421        iter.pos = 0;
1422        for attr in iter {
1423            if let Nl80211Attrs::MaxNumScanSsids(val) = attr? {
1424                return Ok(val);
1425            }
1426        }
1427        Err(ErrorContext::new_missing(
1428            "Nl80211Attrs",
1429            "MaxNumScanSsids",
1430            self.orig_loc,
1431            self.buf.as_ptr() as usize,
1432        ))
1433    }
1434    pub fn get_scan_frequencies(&self) -> Result<&'a [u8], ErrorContext> {
1435        let mut iter = self.clone();
1436        iter.pos = 0;
1437        for attr in iter {
1438            if let Nl80211Attrs::ScanFrequencies(val) = attr? {
1439                return Ok(val);
1440            }
1441        }
1442        Err(ErrorContext::new_missing(
1443            "Nl80211Attrs",
1444            "ScanFrequencies",
1445            self.orig_loc,
1446            self.buf.as_ptr() as usize,
1447        ))
1448    }
1449    pub fn get_scan_ssids(&self) -> Result<&'a [u8], ErrorContext> {
1450        let mut iter = self.clone();
1451        iter.pos = 0;
1452        for attr in iter {
1453            if let Nl80211Attrs::ScanSsids(val) = attr? {
1454                return Ok(val);
1455            }
1456        }
1457        Err(ErrorContext::new_missing(
1458            "Nl80211Attrs",
1459            "ScanSsids",
1460            self.orig_loc,
1461            self.buf.as_ptr() as usize,
1462        ))
1463    }
1464    pub fn get_generation(&self) -> Result<u32, ErrorContext> {
1465        let mut iter = self.clone();
1466        iter.pos = 0;
1467        for attr in iter {
1468            if let Nl80211Attrs::Generation(val) = attr? {
1469                return Ok(val);
1470            }
1471        }
1472        Err(ErrorContext::new_missing(
1473            "Nl80211Attrs",
1474            "Generation",
1475            self.orig_loc,
1476            self.buf.as_ptr() as usize,
1477        ))
1478    }
1479    pub fn get_bss(&self) -> Result<&'a [u8], ErrorContext> {
1480        let mut iter = self.clone();
1481        iter.pos = 0;
1482        for attr in iter {
1483            if let Nl80211Attrs::Bss(val) = attr? {
1484                return Ok(val);
1485            }
1486        }
1487        Err(ErrorContext::new_missing(
1488            "Nl80211Attrs",
1489            "Bss",
1490            self.orig_loc,
1491            self.buf.as_ptr() as usize,
1492        ))
1493    }
1494    pub fn get_reg_initiator(&self) -> Result<u8, ErrorContext> {
1495        let mut iter = self.clone();
1496        iter.pos = 0;
1497        for attr in iter {
1498            if let Nl80211Attrs::RegInitiator(val) = attr? {
1499                return Ok(val);
1500            }
1501        }
1502        Err(ErrorContext::new_missing(
1503            "Nl80211Attrs",
1504            "RegInitiator",
1505            self.orig_loc,
1506            self.buf.as_ptr() as usize,
1507        ))
1508    }
1509    pub fn get_reg_type(&self) -> Result<u8, ErrorContext> {
1510        let mut iter = self.clone();
1511        iter.pos = 0;
1512        for attr in iter {
1513            if let Nl80211Attrs::RegType(val) = attr? {
1514                return Ok(val);
1515            }
1516        }
1517        Err(ErrorContext::new_missing(
1518            "Nl80211Attrs",
1519            "RegType",
1520            self.orig_loc,
1521            self.buf.as_ptr() as usize,
1522        ))
1523    }
1524    #[doc = "Associated type: \"Commands\" (enum)"]
1525    pub fn get_supported_commands(
1526        &self,
1527    ) -> Result<ArrayIterable<IterableArrayU32<'a>, u32>, ErrorContext> {
1528        for attr in self.clone() {
1529            if let Nl80211Attrs::SupportedCommands(val) = attr? {
1530                return Ok(ArrayIterable::new(val));
1531            }
1532        }
1533        Err(ErrorContext::new_missing(
1534            "Nl80211Attrs",
1535            "SupportedCommands",
1536            self.orig_loc,
1537            self.buf.as_ptr() as usize,
1538        ))
1539    }
1540    pub fn get_frame(&self) -> Result<&'a [u8], ErrorContext> {
1541        let mut iter = self.clone();
1542        iter.pos = 0;
1543        for attr in iter {
1544            if let Nl80211Attrs::Frame(val) = attr? {
1545                return Ok(val);
1546            }
1547        }
1548        Err(ErrorContext::new_missing(
1549            "Nl80211Attrs",
1550            "Frame",
1551            self.orig_loc,
1552            self.buf.as_ptr() as usize,
1553        ))
1554    }
1555    pub fn get_ssid(&self) -> Result<&'a [u8], ErrorContext> {
1556        let mut iter = self.clone();
1557        iter.pos = 0;
1558        for attr in iter {
1559            if let Nl80211Attrs::Ssid(val) = attr? {
1560                return Ok(val);
1561            }
1562        }
1563        Err(ErrorContext::new_missing(
1564            "Nl80211Attrs",
1565            "Ssid",
1566            self.orig_loc,
1567            self.buf.as_ptr() as usize,
1568        ))
1569    }
1570    pub fn get_auth_type(&self) -> Result<u32, ErrorContext> {
1571        let mut iter = self.clone();
1572        iter.pos = 0;
1573        for attr in iter {
1574            if let Nl80211Attrs::AuthType(val) = attr? {
1575                return Ok(val);
1576            }
1577        }
1578        Err(ErrorContext::new_missing(
1579            "Nl80211Attrs",
1580            "AuthType",
1581            self.orig_loc,
1582            self.buf.as_ptr() as usize,
1583        ))
1584    }
1585    pub fn get_reason_code(&self) -> Result<u16, ErrorContext> {
1586        let mut iter = self.clone();
1587        iter.pos = 0;
1588        for attr in iter {
1589            if let Nl80211Attrs::ReasonCode(val) = attr? {
1590                return Ok(val);
1591            }
1592        }
1593        Err(ErrorContext::new_missing(
1594            "Nl80211Attrs",
1595            "ReasonCode",
1596            self.orig_loc,
1597            self.buf.as_ptr() as usize,
1598        ))
1599    }
1600    pub fn get_key_type(&self) -> Result<u32, ErrorContext> {
1601        let mut iter = self.clone();
1602        iter.pos = 0;
1603        for attr in iter {
1604            if let Nl80211Attrs::KeyType(val) = attr? {
1605                return Ok(val);
1606            }
1607        }
1608        Err(ErrorContext::new_missing(
1609            "Nl80211Attrs",
1610            "KeyType",
1611            self.orig_loc,
1612            self.buf.as_ptr() as usize,
1613        ))
1614    }
1615    pub fn get_max_scan_ie_len(&self) -> Result<u16, ErrorContext> {
1616        let mut iter = self.clone();
1617        iter.pos = 0;
1618        for attr in iter {
1619            if let Nl80211Attrs::MaxScanIeLen(val) = attr? {
1620                return Ok(val);
1621            }
1622        }
1623        Err(ErrorContext::new_missing(
1624            "Nl80211Attrs",
1625            "MaxScanIeLen",
1626            self.orig_loc,
1627            self.buf.as_ptr() as usize,
1628        ))
1629    }
1630    pub fn get_cipher_suites(&self) -> Result<&'a [u8], ErrorContext> {
1631        let mut iter = self.clone();
1632        iter.pos = 0;
1633        for attr in iter {
1634            if let Nl80211Attrs::CipherSuites(val) = attr? {
1635                return Ok(val);
1636            }
1637        }
1638        Err(ErrorContext::new_missing(
1639            "Nl80211Attrs",
1640            "CipherSuites",
1641            self.orig_loc,
1642            self.buf.as_ptr() as usize,
1643        ))
1644    }
1645    pub fn get_freq_before(&self) -> Result<&'a [u8], ErrorContext> {
1646        let mut iter = self.clone();
1647        iter.pos = 0;
1648        for attr in iter {
1649            if let Nl80211Attrs::FreqBefore(val) = attr? {
1650                return Ok(val);
1651            }
1652        }
1653        Err(ErrorContext::new_missing(
1654            "Nl80211Attrs",
1655            "FreqBefore",
1656            self.orig_loc,
1657            self.buf.as_ptr() as usize,
1658        ))
1659    }
1660    pub fn get_freq_after(&self) -> Result<&'a [u8], ErrorContext> {
1661        let mut iter = self.clone();
1662        iter.pos = 0;
1663        for attr in iter {
1664            if let Nl80211Attrs::FreqAfter(val) = attr? {
1665                return Ok(val);
1666            }
1667        }
1668        Err(ErrorContext::new_missing(
1669            "Nl80211Attrs",
1670            "FreqAfter",
1671            self.orig_loc,
1672            self.buf.as_ptr() as usize,
1673        ))
1674    }
1675    pub fn get_freq_fixed(&self) -> Result<(), ErrorContext> {
1676        let mut iter = self.clone();
1677        iter.pos = 0;
1678        for attr in iter {
1679            if let Nl80211Attrs::FreqFixed(val) = attr? {
1680                return Ok(val);
1681            }
1682        }
1683        Err(ErrorContext::new_missing(
1684            "Nl80211Attrs",
1685            "FreqFixed",
1686            self.orig_loc,
1687            self.buf.as_ptr() as usize,
1688        ))
1689    }
1690    pub fn get_wiphy_retry_short(&self) -> Result<u8, ErrorContext> {
1691        let mut iter = self.clone();
1692        iter.pos = 0;
1693        for attr in iter {
1694            if let Nl80211Attrs::WiphyRetryShort(val) = attr? {
1695                return Ok(val);
1696            }
1697        }
1698        Err(ErrorContext::new_missing(
1699            "Nl80211Attrs",
1700            "WiphyRetryShort",
1701            self.orig_loc,
1702            self.buf.as_ptr() as usize,
1703        ))
1704    }
1705    pub fn get_wiphy_retry_long(&self) -> Result<u8, ErrorContext> {
1706        let mut iter = self.clone();
1707        iter.pos = 0;
1708        for attr in iter {
1709            if let Nl80211Attrs::WiphyRetryLong(val) = attr? {
1710                return Ok(val);
1711            }
1712        }
1713        Err(ErrorContext::new_missing(
1714            "Nl80211Attrs",
1715            "WiphyRetryLong",
1716            self.orig_loc,
1717            self.buf.as_ptr() as usize,
1718        ))
1719    }
1720    pub fn get_wiphy_frag_threshold(&self) -> Result<u32, ErrorContext> {
1721        let mut iter = self.clone();
1722        iter.pos = 0;
1723        for attr in iter {
1724            if let Nl80211Attrs::WiphyFragThreshold(val) = attr? {
1725                return Ok(val);
1726            }
1727        }
1728        Err(ErrorContext::new_missing(
1729            "Nl80211Attrs",
1730            "WiphyFragThreshold",
1731            self.orig_loc,
1732            self.buf.as_ptr() as usize,
1733        ))
1734    }
1735    pub fn get_wiphy_rts_threshold(&self) -> Result<u32, ErrorContext> {
1736        let mut iter = self.clone();
1737        iter.pos = 0;
1738        for attr in iter {
1739            if let Nl80211Attrs::WiphyRtsThreshold(val) = attr? {
1740                return Ok(val);
1741            }
1742        }
1743        Err(ErrorContext::new_missing(
1744            "Nl80211Attrs",
1745            "WiphyRtsThreshold",
1746            self.orig_loc,
1747            self.buf.as_ptr() as usize,
1748        ))
1749    }
1750    pub fn get_timed_out(&self) -> Result<(), ErrorContext> {
1751        let mut iter = self.clone();
1752        iter.pos = 0;
1753        for attr in iter {
1754            if let Nl80211Attrs::TimedOut(val) = attr? {
1755                return Ok(val);
1756            }
1757        }
1758        Err(ErrorContext::new_missing(
1759            "Nl80211Attrs",
1760            "TimedOut",
1761            self.orig_loc,
1762            self.buf.as_ptr() as usize,
1763        ))
1764    }
1765    pub fn get_use_mfp(&self) -> Result<u32, ErrorContext> {
1766        let mut iter = self.clone();
1767        iter.pos = 0;
1768        for attr in iter {
1769            if let Nl80211Attrs::UseMfp(val) = attr? {
1770                return Ok(val);
1771            }
1772        }
1773        Err(ErrorContext::new_missing(
1774            "Nl80211Attrs",
1775            "UseMfp",
1776            self.orig_loc,
1777            self.buf.as_ptr() as usize,
1778        ))
1779    }
1780    pub fn get_sta_flags2(&self) -> Result<PushStaFlagUpdate, ErrorContext> {
1781        let mut iter = self.clone();
1782        iter.pos = 0;
1783        for attr in iter {
1784            if let Nl80211Attrs::StaFlags2(val) = attr? {
1785                return Ok(val);
1786            }
1787        }
1788        Err(ErrorContext::new_missing(
1789            "Nl80211Attrs",
1790            "StaFlags2",
1791            self.orig_loc,
1792            self.buf.as_ptr() as usize,
1793        ))
1794    }
1795    pub fn get_control_port(&self) -> Result<(), ErrorContext> {
1796        let mut iter = self.clone();
1797        iter.pos = 0;
1798        for attr in iter {
1799            if let Nl80211Attrs::ControlPort(val) = attr? {
1800                return Ok(val);
1801            }
1802        }
1803        Err(ErrorContext::new_missing(
1804            "Nl80211Attrs",
1805            "ControlPort",
1806            self.orig_loc,
1807            self.buf.as_ptr() as usize,
1808        ))
1809    }
1810    pub fn get_testdata(&self) -> Result<&'a [u8], ErrorContext> {
1811        let mut iter = self.clone();
1812        iter.pos = 0;
1813        for attr in iter {
1814            if let Nl80211Attrs::Testdata(val) = attr? {
1815                return Ok(val);
1816            }
1817        }
1818        Err(ErrorContext::new_missing(
1819            "Nl80211Attrs",
1820            "Testdata",
1821            self.orig_loc,
1822            self.buf.as_ptr() as usize,
1823        ))
1824    }
1825    pub fn get_privacy(&self) -> Result<(), ErrorContext> {
1826        let mut iter = self.clone();
1827        iter.pos = 0;
1828        for attr in iter {
1829            if let Nl80211Attrs::Privacy(val) = attr? {
1830                return Ok(val);
1831            }
1832        }
1833        Err(ErrorContext::new_missing(
1834            "Nl80211Attrs",
1835            "Privacy",
1836            self.orig_loc,
1837            self.buf.as_ptr() as usize,
1838        ))
1839    }
1840    pub fn get_disconnected_by_ap(&self) -> Result<(), ErrorContext> {
1841        let mut iter = self.clone();
1842        iter.pos = 0;
1843        for attr in iter {
1844            if let Nl80211Attrs::DisconnectedByAp(val) = attr? {
1845                return Ok(val);
1846            }
1847        }
1848        Err(ErrorContext::new_missing(
1849            "Nl80211Attrs",
1850            "DisconnectedByAp",
1851            self.orig_loc,
1852            self.buf.as_ptr() as usize,
1853        ))
1854    }
1855    pub fn get_status_code(&self) -> Result<u16, ErrorContext> {
1856        let mut iter = self.clone();
1857        iter.pos = 0;
1858        for attr in iter {
1859            if let Nl80211Attrs::StatusCode(val) = attr? {
1860                return Ok(val);
1861            }
1862        }
1863        Err(ErrorContext::new_missing(
1864            "Nl80211Attrs",
1865            "StatusCode",
1866            self.orig_loc,
1867            self.buf.as_ptr() as usize,
1868        ))
1869    }
1870    pub fn get_cipher_suites_pairwise(&self) -> Result<&'a [u8], ErrorContext> {
1871        let mut iter = self.clone();
1872        iter.pos = 0;
1873        for attr in iter {
1874            if let Nl80211Attrs::CipherSuitesPairwise(val) = attr? {
1875                return Ok(val);
1876            }
1877        }
1878        Err(ErrorContext::new_missing(
1879            "Nl80211Attrs",
1880            "CipherSuitesPairwise",
1881            self.orig_loc,
1882            self.buf.as_ptr() as usize,
1883        ))
1884    }
1885    pub fn get_cipher_suite_group(&self) -> Result<u32, ErrorContext> {
1886        let mut iter = self.clone();
1887        iter.pos = 0;
1888        for attr in iter {
1889            if let Nl80211Attrs::CipherSuiteGroup(val) = attr? {
1890                return Ok(val);
1891            }
1892        }
1893        Err(ErrorContext::new_missing(
1894            "Nl80211Attrs",
1895            "CipherSuiteGroup",
1896            self.orig_loc,
1897            self.buf.as_ptr() as usize,
1898        ))
1899    }
1900    pub fn get_wpa_versions(&self) -> Result<u32, ErrorContext> {
1901        let mut iter = self.clone();
1902        iter.pos = 0;
1903        for attr in iter {
1904            if let Nl80211Attrs::WpaVersions(val) = attr? {
1905                return Ok(val);
1906            }
1907        }
1908        Err(ErrorContext::new_missing(
1909            "Nl80211Attrs",
1910            "WpaVersions",
1911            self.orig_loc,
1912            self.buf.as_ptr() as usize,
1913        ))
1914    }
1915    pub fn get_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
1916        let mut iter = self.clone();
1917        iter.pos = 0;
1918        for attr in iter {
1919            if let Nl80211Attrs::AkmSuites(val) = attr? {
1920                return Ok(val);
1921            }
1922        }
1923        Err(ErrorContext::new_missing(
1924            "Nl80211Attrs",
1925            "AkmSuites",
1926            self.orig_loc,
1927            self.buf.as_ptr() as usize,
1928        ))
1929    }
1930    pub fn get_req_ie(&self) -> Result<&'a [u8], ErrorContext> {
1931        let mut iter = self.clone();
1932        iter.pos = 0;
1933        for attr in iter {
1934            if let Nl80211Attrs::ReqIe(val) = attr? {
1935                return Ok(val);
1936            }
1937        }
1938        Err(ErrorContext::new_missing(
1939            "Nl80211Attrs",
1940            "ReqIe",
1941            self.orig_loc,
1942            self.buf.as_ptr() as usize,
1943        ))
1944    }
1945    pub fn get_resp_ie(&self) -> Result<&'a [u8], ErrorContext> {
1946        let mut iter = self.clone();
1947        iter.pos = 0;
1948        for attr in iter {
1949            if let Nl80211Attrs::RespIe(val) = attr? {
1950                return Ok(val);
1951            }
1952        }
1953        Err(ErrorContext::new_missing(
1954            "Nl80211Attrs",
1955            "RespIe",
1956            self.orig_loc,
1957            self.buf.as_ptr() as usize,
1958        ))
1959    }
1960    pub fn get_prev_bssid(&self) -> Result<&'a [u8], ErrorContext> {
1961        let mut iter = self.clone();
1962        iter.pos = 0;
1963        for attr in iter {
1964            if let Nl80211Attrs::PrevBssid(val) = attr? {
1965                return Ok(val);
1966            }
1967        }
1968        Err(ErrorContext::new_missing(
1969            "Nl80211Attrs",
1970            "PrevBssid",
1971            self.orig_loc,
1972            self.buf.as_ptr() as usize,
1973        ))
1974    }
1975    pub fn get_key(&self) -> Result<&'a [u8], ErrorContext> {
1976        let mut iter = self.clone();
1977        iter.pos = 0;
1978        for attr in iter {
1979            if let Nl80211Attrs::Key(val) = attr? {
1980                return Ok(val);
1981            }
1982        }
1983        Err(ErrorContext::new_missing(
1984            "Nl80211Attrs",
1985            "Key",
1986            self.orig_loc,
1987            self.buf.as_ptr() as usize,
1988        ))
1989    }
1990    pub fn get_keys(&self) -> Result<&'a [u8], ErrorContext> {
1991        let mut iter = self.clone();
1992        iter.pos = 0;
1993        for attr in iter {
1994            if let Nl80211Attrs::Keys(val) = attr? {
1995                return Ok(val);
1996            }
1997        }
1998        Err(ErrorContext::new_missing(
1999            "Nl80211Attrs",
2000            "Keys",
2001            self.orig_loc,
2002            self.buf.as_ptr() as usize,
2003        ))
2004    }
2005    pub fn get_pid(&self) -> Result<u32, ErrorContext> {
2006        let mut iter = self.clone();
2007        iter.pos = 0;
2008        for attr in iter {
2009            if let Nl80211Attrs::Pid(val) = attr? {
2010                return Ok(val);
2011            }
2012        }
2013        Err(ErrorContext::new_missing(
2014            "Nl80211Attrs",
2015            "Pid",
2016            self.orig_loc,
2017            self.buf.as_ptr() as usize,
2018        ))
2019    }
2020    pub fn get_4addr(&self) -> Result<u8, ErrorContext> {
2021        let mut iter = self.clone();
2022        iter.pos = 0;
2023        for attr in iter {
2024            if let Nl80211Attrs::_4addr(val) = attr? {
2025                return Ok(val);
2026            }
2027        }
2028        Err(ErrorContext::new_missing(
2029            "Nl80211Attrs",
2030            "4addr",
2031            self.orig_loc,
2032            self.buf.as_ptr() as usize,
2033        ))
2034    }
2035    pub fn get_survey_info(&self) -> Result<&'a [u8], ErrorContext> {
2036        let mut iter = self.clone();
2037        iter.pos = 0;
2038        for attr in iter {
2039            if let Nl80211Attrs::SurveyInfo(val) = attr? {
2040                return Ok(val);
2041            }
2042        }
2043        Err(ErrorContext::new_missing(
2044            "Nl80211Attrs",
2045            "SurveyInfo",
2046            self.orig_loc,
2047            self.buf.as_ptr() as usize,
2048        ))
2049    }
2050    pub fn get_pmkid(&self) -> Result<&'a [u8], ErrorContext> {
2051        let mut iter = self.clone();
2052        iter.pos = 0;
2053        for attr in iter {
2054            if let Nl80211Attrs::Pmkid(val) = attr? {
2055                return Ok(val);
2056            }
2057        }
2058        Err(ErrorContext::new_missing(
2059            "Nl80211Attrs",
2060            "Pmkid",
2061            self.orig_loc,
2062            self.buf.as_ptr() as usize,
2063        ))
2064    }
2065    pub fn get_max_num_pmkids(&self) -> Result<u8, ErrorContext> {
2066        let mut iter = self.clone();
2067        iter.pos = 0;
2068        for attr in iter {
2069            if let Nl80211Attrs::MaxNumPmkids(val) = attr? {
2070                return Ok(val);
2071            }
2072        }
2073        Err(ErrorContext::new_missing(
2074            "Nl80211Attrs",
2075            "MaxNumPmkids",
2076            self.orig_loc,
2077            self.buf.as_ptr() as usize,
2078        ))
2079    }
2080    pub fn get_duration(&self) -> Result<u32, ErrorContext> {
2081        let mut iter = self.clone();
2082        iter.pos = 0;
2083        for attr in iter {
2084            if let Nl80211Attrs::Duration(val) = attr? {
2085                return Ok(val);
2086            }
2087        }
2088        Err(ErrorContext::new_missing(
2089            "Nl80211Attrs",
2090            "Duration",
2091            self.orig_loc,
2092            self.buf.as_ptr() as usize,
2093        ))
2094    }
2095    pub fn get_cookie(&self) -> Result<u64, ErrorContext> {
2096        let mut iter = self.clone();
2097        iter.pos = 0;
2098        for attr in iter {
2099            if let Nl80211Attrs::Cookie(val) = attr? {
2100                return Ok(val);
2101            }
2102        }
2103        Err(ErrorContext::new_missing(
2104            "Nl80211Attrs",
2105            "Cookie",
2106            self.orig_loc,
2107            self.buf.as_ptr() as usize,
2108        ))
2109    }
2110    pub fn get_wiphy_coverage_class(&self) -> Result<u8, ErrorContext> {
2111        let mut iter = self.clone();
2112        iter.pos = 0;
2113        for attr in iter {
2114            if let Nl80211Attrs::WiphyCoverageClass(val) = attr? {
2115                return Ok(val);
2116            }
2117        }
2118        Err(ErrorContext::new_missing(
2119            "Nl80211Attrs",
2120            "WiphyCoverageClass",
2121            self.orig_loc,
2122            self.buf.as_ptr() as usize,
2123        ))
2124    }
2125    pub fn get_tx_rates(&self) -> Result<&'a [u8], ErrorContext> {
2126        let mut iter = self.clone();
2127        iter.pos = 0;
2128        for attr in iter {
2129            if let Nl80211Attrs::TxRates(val) = attr? {
2130                return Ok(val);
2131            }
2132        }
2133        Err(ErrorContext::new_missing(
2134            "Nl80211Attrs",
2135            "TxRates",
2136            self.orig_loc,
2137            self.buf.as_ptr() as usize,
2138        ))
2139    }
2140    pub fn get_frame_match(&self) -> Result<&'a [u8], ErrorContext> {
2141        let mut iter = self.clone();
2142        iter.pos = 0;
2143        for attr in iter {
2144            if let Nl80211Attrs::FrameMatch(val) = attr? {
2145                return Ok(val);
2146            }
2147        }
2148        Err(ErrorContext::new_missing(
2149            "Nl80211Attrs",
2150            "FrameMatch",
2151            self.orig_loc,
2152            self.buf.as_ptr() as usize,
2153        ))
2154    }
2155    pub fn get_ack(&self) -> Result<(), ErrorContext> {
2156        let mut iter = self.clone();
2157        iter.pos = 0;
2158        for attr in iter {
2159            if let Nl80211Attrs::Ack(val) = attr? {
2160                return Ok(val);
2161            }
2162        }
2163        Err(ErrorContext::new_missing(
2164            "Nl80211Attrs",
2165            "Ack",
2166            self.orig_loc,
2167            self.buf.as_ptr() as usize,
2168        ))
2169    }
2170    pub fn get_ps_state(&self) -> Result<u32, ErrorContext> {
2171        let mut iter = self.clone();
2172        iter.pos = 0;
2173        for attr in iter {
2174            if let Nl80211Attrs::PsState(val) = attr? {
2175                return Ok(val);
2176            }
2177        }
2178        Err(ErrorContext::new_missing(
2179            "Nl80211Attrs",
2180            "PsState",
2181            self.orig_loc,
2182            self.buf.as_ptr() as usize,
2183        ))
2184    }
2185    pub fn get_cqm(&self) -> Result<&'a [u8], ErrorContext> {
2186        let mut iter = self.clone();
2187        iter.pos = 0;
2188        for attr in iter {
2189            if let Nl80211Attrs::Cqm(val) = attr? {
2190                return Ok(val);
2191            }
2192        }
2193        Err(ErrorContext::new_missing(
2194            "Nl80211Attrs",
2195            "Cqm",
2196            self.orig_loc,
2197            self.buf.as_ptr() as usize,
2198        ))
2199    }
2200    pub fn get_local_state_change(&self) -> Result<(), ErrorContext> {
2201        let mut iter = self.clone();
2202        iter.pos = 0;
2203        for attr in iter {
2204            if let Nl80211Attrs::LocalStateChange(val) = attr? {
2205                return Ok(val);
2206            }
2207        }
2208        Err(ErrorContext::new_missing(
2209            "Nl80211Attrs",
2210            "LocalStateChange",
2211            self.orig_loc,
2212            self.buf.as_ptr() as usize,
2213        ))
2214    }
2215    pub fn get_ap_isolate(&self) -> Result<u8, ErrorContext> {
2216        let mut iter = self.clone();
2217        iter.pos = 0;
2218        for attr in iter {
2219            if let Nl80211Attrs::ApIsolate(val) = attr? {
2220                return Ok(val);
2221            }
2222        }
2223        Err(ErrorContext::new_missing(
2224            "Nl80211Attrs",
2225            "ApIsolate",
2226            self.orig_loc,
2227            self.buf.as_ptr() as usize,
2228        ))
2229    }
2230    pub fn get_wiphy_tx_power_setting(&self) -> Result<u32, ErrorContext> {
2231        let mut iter = self.clone();
2232        iter.pos = 0;
2233        for attr in iter {
2234            if let Nl80211Attrs::WiphyTxPowerSetting(val) = attr? {
2235                return Ok(val);
2236            }
2237        }
2238        Err(ErrorContext::new_missing(
2239            "Nl80211Attrs",
2240            "WiphyTxPowerSetting",
2241            self.orig_loc,
2242            self.buf.as_ptr() as usize,
2243        ))
2244    }
2245    pub fn get_wiphy_tx_power_level(&self) -> Result<u32, ErrorContext> {
2246        let mut iter = self.clone();
2247        iter.pos = 0;
2248        for attr in iter {
2249            if let Nl80211Attrs::WiphyTxPowerLevel(val) = attr? {
2250                return Ok(val);
2251            }
2252        }
2253        Err(ErrorContext::new_missing(
2254            "Nl80211Attrs",
2255            "WiphyTxPowerLevel",
2256            self.orig_loc,
2257            self.buf.as_ptr() as usize,
2258        ))
2259    }
2260    pub fn get_tx_frame_types(&self) -> Result<IterableIftypeAttrs<'a>, ErrorContext> {
2261        let mut iter = self.clone();
2262        iter.pos = 0;
2263        for attr in iter {
2264            if let Nl80211Attrs::TxFrameTypes(val) = attr? {
2265                return Ok(val);
2266            }
2267        }
2268        Err(ErrorContext::new_missing(
2269            "Nl80211Attrs",
2270            "TxFrameTypes",
2271            self.orig_loc,
2272            self.buf.as_ptr() as usize,
2273        ))
2274    }
2275    pub fn get_rx_frame_types(&self) -> Result<IterableIftypeAttrs<'a>, ErrorContext> {
2276        let mut iter = self.clone();
2277        iter.pos = 0;
2278        for attr in iter {
2279            if let Nl80211Attrs::RxFrameTypes(val) = attr? {
2280                return Ok(val);
2281            }
2282        }
2283        Err(ErrorContext::new_missing(
2284            "Nl80211Attrs",
2285            "RxFrameTypes",
2286            self.orig_loc,
2287            self.buf.as_ptr() as usize,
2288        ))
2289    }
2290    pub fn get_frame_type(&self) -> Result<u16, ErrorContext> {
2291        let mut iter = self.clone();
2292        iter.pos = 0;
2293        for attr in iter {
2294            if let Nl80211Attrs::FrameType(val) = attr? {
2295                return Ok(val);
2296            }
2297        }
2298        Err(ErrorContext::new_missing(
2299            "Nl80211Attrs",
2300            "FrameType",
2301            self.orig_loc,
2302            self.buf.as_ptr() as usize,
2303        ))
2304    }
2305    pub fn get_control_port_ethertype(&self) -> Result<(), ErrorContext> {
2306        let mut iter = self.clone();
2307        iter.pos = 0;
2308        for attr in iter {
2309            if let Nl80211Attrs::ControlPortEthertype(val) = attr? {
2310                return Ok(val);
2311            }
2312        }
2313        Err(ErrorContext::new_missing(
2314            "Nl80211Attrs",
2315            "ControlPortEthertype",
2316            self.orig_loc,
2317            self.buf.as_ptr() as usize,
2318        ))
2319    }
2320    pub fn get_control_port_no_encrypt(&self) -> Result<(), ErrorContext> {
2321        let mut iter = self.clone();
2322        iter.pos = 0;
2323        for attr in iter {
2324            if let Nl80211Attrs::ControlPortNoEncrypt(val) = attr? {
2325                return Ok(val);
2326            }
2327        }
2328        Err(ErrorContext::new_missing(
2329            "Nl80211Attrs",
2330            "ControlPortNoEncrypt",
2331            self.orig_loc,
2332            self.buf.as_ptr() as usize,
2333        ))
2334    }
2335    pub fn get_support_ibss_rsn(&self) -> Result<(), ErrorContext> {
2336        let mut iter = self.clone();
2337        iter.pos = 0;
2338        for attr in iter {
2339            if let Nl80211Attrs::SupportIbssRsn(val) = attr? {
2340                return Ok(val);
2341            }
2342        }
2343        Err(ErrorContext::new_missing(
2344            "Nl80211Attrs",
2345            "SupportIbssRsn",
2346            self.orig_loc,
2347            self.buf.as_ptr() as usize,
2348        ))
2349    }
2350    pub fn get_wiphy_antenna_tx(&self) -> Result<u32, ErrorContext> {
2351        let mut iter = self.clone();
2352        iter.pos = 0;
2353        for attr in iter {
2354            if let Nl80211Attrs::WiphyAntennaTx(val) = attr? {
2355                return Ok(val);
2356            }
2357        }
2358        Err(ErrorContext::new_missing(
2359            "Nl80211Attrs",
2360            "WiphyAntennaTx",
2361            self.orig_loc,
2362            self.buf.as_ptr() as usize,
2363        ))
2364    }
2365    pub fn get_wiphy_antenna_rx(&self) -> Result<u32, ErrorContext> {
2366        let mut iter = self.clone();
2367        iter.pos = 0;
2368        for attr in iter {
2369            if let Nl80211Attrs::WiphyAntennaRx(val) = attr? {
2370                return Ok(val);
2371            }
2372        }
2373        Err(ErrorContext::new_missing(
2374            "Nl80211Attrs",
2375            "WiphyAntennaRx",
2376            self.orig_loc,
2377            self.buf.as_ptr() as usize,
2378        ))
2379    }
2380    pub fn get_mcast_rate(&self) -> Result<u32, ErrorContext> {
2381        let mut iter = self.clone();
2382        iter.pos = 0;
2383        for attr in iter {
2384            if let Nl80211Attrs::McastRate(val) = attr? {
2385                return Ok(val);
2386            }
2387        }
2388        Err(ErrorContext::new_missing(
2389            "Nl80211Attrs",
2390            "McastRate",
2391            self.orig_loc,
2392            self.buf.as_ptr() as usize,
2393        ))
2394    }
2395    pub fn get_offchannel_tx_ok(&self) -> Result<(), ErrorContext> {
2396        let mut iter = self.clone();
2397        iter.pos = 0;
2398        for attr in iter {
2399            if let Nl80211Attrs::OffchannelTxOk(val) = attr? {
2400                return Ok(val);
2401            }
2402        }
2403        Err(ErrorContext::new_missing(
2404            "Nl80211Attrs",
2405            "OffchannelTxOk",
2406            self.orig_loc,
2407            self.buf.as_ptr() as usize,
2408        ))
2409    }
2410    pub fn get_bss_ht_opmode(&self) -> Result<u16, ErrorContext> {
2411        let mut iter = self.clone();
2412        iter.pos = 0;
2413        for attr in iter {
2414            if let Nl80211Attrs::BssHtOpmode(val) = attr? {
2415                return Ok(val);
2416            }
2417        }
2418        Err(ErrorContext::new_missing(
2419            "Nl80211Attrs",
2420            "BssHtOpmode",
2421            self.orig_loc,
2422            self.buf.as_ptr() as usize,
2423        ))
2424    }
2425    pub fn get_key_default_types(&self) -> Result<&'a [u8], ErrorContext> {
2426        let mut iter = self.clone();
2427        iter.pos = 0;
2428        for attr in iter {
2429            if let Nl80211Attrs::KeyDefaultTypes(val) = attr? {
2430                return Ok(val);
2431            }
2432        }
2433        Err(ErrorContext::new_missing(
2434            "Nl80211Attrs",
2435            "KeyDefaultTypes",
2436            self.orig_loc,
2437            self.buf.as_ptr() as usize,
2438        ))
2439    }
2440    pub fn get_max_remain_on_channel_duration(&self) -> Result<u32, ErrorContext> {
2441        let mut iter = self.clone();
2442        iter.pos = 0;
2443        for attr in iter {
2444            if let Nl80211Attrs::MaxRemainOnChannelDuration(val) = attr? {
2445                return Ok(val);
2446            }
2447        }
2448        Err(ErrorContext::new_missing(
2449            "Nl80211Attrs",
2450            "MaxRemainOnChannelDuration",
2451            self.orig_loc,
2452            self.buf.as_ptr() as usize,
2453        ))
2454    }
2455    pub fn get_mesh_setup(&self) -> Result<&'a [u8], ErrorContext> {
2456        let mut iter = self.clone();
2457        iter.pos = 0;
2458        for attr in iter {
2459            if let Nl80211Attrs::MeshSetup(val) = attr? {
2460                return Ok(val);
2461            }
2462        }
2463        Err(ErrorContext::new_missing(
2464            "Nl80211Attrs",
2465            "MeshSetup",
2466            self.orig_loc,
2467            self.buf.as_ptr() as usize,
2468        ))
2469    }
2470    pub fn get_wiphy_antenna_avail_tx(&self) -> Result<u32, ErrorContext> {
2471        let mut iter = self.clone();
2472        iter.pos = 0;
2473        for attr in iter {
2474            if let Nl80211Attrs::WiphyAntennaAvailTx(val) = attr? {
2475                return Ok(val);
2476            }
2477        }
2478        Err(ErrorContext::new_missing(
2479            "Nl80211Attrs",
2480            "WiphyAntennaAvailTx",
2481            self.orig_loc,
2482            self.buf.as_ptr() as usize,
2483        ))
2484    }
2485    pub fn get_wiphy_antenna_avail_rx(&self) -> Result<u32, ErrorContext> {
2486        let mut iter = self.clone();
2487        iter.pos = 0;
2488        for attr in iter {
2489            if let Nl80211Attrs::WiphyAntennaAvailRx(val) = attr? {
2490                return Ok(val);
2491            }
2492        }
2493        Err(ErrorContext::new_missing(
2494            "Nl80211Attrs",
2495            "WiphyAntennaAvailRx",
2496            self.orig_loc,
2497            self.buf.as_ptr() as usize,
2498        ))
2499    }
2500    pub fn get_support_mesh_auth(&self) -> Result<(), ErrorContext> {
2501        let mut iter = self.clone();
2502        iter.pos = 0;
2503        for attr in iter {
2504            if let Nl80211Attrs::SupportMeshAuth(val) = attr? {
2505                return Ok(val);
2506            }
2507        }
2508        Err(ErrorContext::new_missing(
2509            "Nl80211Attrs",
2510            "SupportMeshAuth",
2511            self.orig_loc,
2512            self.buf.as_ptr() as usize,
2513        ))
2514    }
2515    pub fn get_sta_plink_state(&self) -> Result<u8, ErrorContext> {
2516        let mut iter = self.clone();
2517        iter.pos = 0;
2518        for attr in iter {
2519            if let Nl80211Attrs::StaPlinkState(val) = attr? {
2520                return Ok(val);
2521            }
2522        }
2523        Err(ErrorContext::new_missing(
2524            "Nl80211Attrs",
2525            "StaPlinkState",
2526            self.orig_loc,
2527            self.buf.as_ptr() as usize,
2528        ))
2529    }
2530    pub fn get_wowlan_triggers(&self) -> Result<&'a [u8], ErrorContext> {
2531        let mut iter = self.clone();
2532        iter.pos = 0;
2533        for attr in iter {
2534            if let Nl80211Attrs::WowlanTriggers(val) = attr? {
2535                return Ok(val);
2536            }
2537        }
2538        Err(ErrorContext::new_missing(
2539            "Nl80211Attrs",
2540            "WowlanTriggers",
2541            self.orig_loc,
2542            self.buf.as_ptr() as usize,
2543        ))
2544    }
2545    pub fn get_wowlan_triggers_supported(
2546        &self,
2547    ) -> Result<IterableWowlanTriggersAttrs<'a>, ErrorContext> {
2548        let mut iter = self.clone();
2549        iter.pos = 0;
2550        for attr in iter {
2551            if let Nl80211Attrs::WowlanTriggersSupported(val) = attr? {
2552                return Ok(val);
2553            }
2554        }
2555        Err(ErrorContext::new_missing(
2556            "Nl80211Attrs",
2557            "WowlanTriggersSupported",
2558            self.orig_loc,
2559            self.buf.as_ptr() as usize,
2560        ))
2561    }
2562    pub fn get_sched_scan_interval(&self) -> Result<u32, ErrorContext> {
2563        let mut iter = self.clone();
2564        iter.pos = 0;
2565        for attr in iter {
2566            if let Nl80211Attrs::SchedScanInterval(val) = attr? {
2567                return Ok(val);
2568            }
2569        }
2570        Err(ErrorContext::new_missing(
2571            "Nl80211Attrs",
2572            "SchedScanInterval",
2573            self.orig_loc,
2574            self.buf.as_ptr() as usize,
2575        ))
2576    }
2577    pub fn get_interface_combinations(
2578        &self,
2579    ) -> Result<
2580        ArrayIterable<
2581            IterableArrayIfCombinationAttributes<'a>,
2582            IterableIfCombinationAttributes<'a>,
2583        >,
2584        ErrorContext,
2585    > {
2586        for attr in self.clone() {
2587            if let Nl80211Attrs::InterfaceCombinations(val) = attr? {
2588                return Ok(ArrayIterable::new(val));
2589            }
2590        }
2591        Err(ErrorContext::new_missing(
2592            "Nl80211Attrs",
2593            "InterfaceCombinations",
2594            self.orig_loc,
2595            self.buf.as_ptr() as usize,
2596        ))
2597    }
2598    pub fn get_software_iftypes(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
2599        let mut iter = self.clone();
2600        iter.pos = 0;
2601        for attr in iter {
2602            if let Nl80211Attrs::SoftwareIftypes(val) = attr? {
2603                return Ok(val);
2604            }
2605        }
2606        Err(ErrorContext::new_missing(
2607            "Nl80211Attrs",
2608            "SoftwareIftypes",
2609            self.orig_loc,
2610            self.buf.as_ptr() as usize,
2611        ))
2612    }
2613    pub fn get_rekey_data(&self) -> Result<&'a [u8], ErrorContext> {
2614        let mut iter = self.clone();
2615        iter.pos = 0;
2616        for attr in iter {
2617            if let Nl80211Attrs::RekeyData(val) = attr? {
2618                return Ok(val);
2619            }
2620        }
2621        Err(ErrorContext::new_missing(
2622            "Nl80211Attrs",
2623            "RekeyData",
2624            self.orig_loc,
2625            self.buf.as_ptr() as usize,
2626        ))
2627    }
2628    pub fn get_max_num_sched_scan_ssids(&self) -> Result<u8, ErrorContext> {
2629        let mut iter = self.clone();
2630        iter.pos = 0;
2631        for attr in iter {
2632            if let Nl80211Attrs::MaxNumSchedScanSsids(val) = attr? {
2633                return Ok(val);
2634            }
2635        }
2636        Err(ErrorContext::new_missing(
2637            "Nl80211Attrs",
2638            "MaxNumSchedScanSsids",
2639            self.orig_loc,
2640            self.buf.as_ptr() as usize,
2641        ))
2642    }
2643    pub fn get_max_sched_scan_ie_len(&self) -> Result<u16, ErrorContext> {
2644        let mut iter = self.clone();
2645        iter.pos = 0;
2646        for attr in iter {
2647            if let Nl80211Attrs::MaxSchedScanIeLen(val) = attr? {
2648                return Ok(val);
2649            }
2650        }
2651        Err(ErrorContext::new_missing(
2652            "Nl80211Attrs",
2653            "MaxSchedScanIeLen",
2654            self.orig_loc,
2655            self.buf.as_ptr() as usize,
2656        ))
2657    }
2658    pub fn get_scan_supp_rates(&self) -> Result<&'a [u8], ErrorContext> {
2659        let mut iter = self.clone();
2660        iter.pos = 0;
2661        for attr in iter {
2662            if let Nl80211Attrs::ScanSuppRates(val) = attr? {
2663                return Ok(val);
2664            }
2665        }
2666        Err(ErrorContext::new_missing(
2667            "Nl80211Attrs",
2668            "ScanSuppRates",
2669            self.orig_loc,
2670            self.buf.as_ptr() as usize,
2671        ))
2672    }
2673    pub fn get_hidden_ssid(&self) -> Result<u32, ErrorContext> {
2674        let mut iter = self.clone();
2675        iter.pos = 0;
2676        for attr in iter {
2677            if let Nl80211Attrs::HiddenSsid(val) = attr? {
2678                return Ok(val);
2679            }
2680        }
2681        Err(ErrorContext::new_missing(
2682            "Nl80211Attrs",
2683            "HiddenSsid",
2684            self.orig_loc,
2685            self.buf.as_ptr() as usize,
2686        ))
2687    }
2688    pub fn get_ie_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
2689        let mut iter = self.clone();
2690        iter.pos = 0;
2691        for attr in iter {
2692            if let Nl80211Attrs::IeProbeResp(val) = attr? {
2693                return Ok(val);
2694            }
2695        }
2696        Err(ErrorContext::new_missing(
2697            "Nl80211Attrs",
2698            "IeProbeResp",
2699            self.orig_loc,
2700            self.buf.as_ptr() as usize,
2701        ))
2702    }
2703    pub fn get_ie_assoc_resp(&self) -> Result<&'a [u8], ErrorContext> {
2704        let mut iter = self.clone();
2705        iter.pos = 0;
2706        for attr in iter {
2707            if let Nl80211Attrs::IeAssocResp(val) = attr? {
2708                return Ok(val);
2709            }
2710        }
2711        Err(ErrorContext::new_missing(
2712            "Nl80211Attrs",
2713            "IeAssocResp",
2714            self.orig_loc,
2715            self.buf.as_ptr() as usize,
2716        ))
2717    }
2718    pub fn get_sta_wme(&self) -> Result<&'a [u8], ErrorContext> {
2719        let mut iter = self.clone();
2720        iter.pos = 0;
2721        for attr in iter {
2722            if let Nl80211Attrs::StaWme(val) = attr? {
2723                return Ok(val);
2724            }
2725        }
2726        Err(ErrorContext::new_missing(
2727            "Nl80211Attrs",
2728            "StaWme",
2729            self.orig_loc,
2730            self.buf.as_ptr() as usize,
2731        ))
2732    }
2733    pub fn get_support_ap_uapsd(&self) -> Result<(), ErrorContext> {
2734        let mut iter = self.clone();
2735        iter.pos = 0;
2736        for attr in iter {
2737            if let Nl80211Attrs::SupportApUapsd(val) = attr? {
2738                return Ok(val);
2739            }
2740        }
2741        Err(ErrorContext::new_missing(
2742            "Nl80211Attrs",
2743            "SupportApUapsd",
2744            self.orig_loc,
2745            self.buf.as_ptr() as usize,
2746        ))
2747    }
2748    pub fn get_roam_support(&self) -> Result<(), ErrorContext> {
2749        let mut iter = self.clone();
2750        iter.pos = 0;
2751        for attr in iter {
2752            if let Nl80211Attrs::RoamSupport(val) = attr? {
2753                return Ok(val);
2754            }
2755        }
2756        Err(ErrorContext::new_missing(
2757            "Nl80211Attrs",
2758            "RoamSupport",
2759            self.orig_loc,
2760            self.buf.as_ptr() as usize,
2761        ))
2762    }
2763    pub fn get_sched_scan_match(&self) -> Result<&'a [u8], ErrorContext> {
2764        let mut iter = self.clone();
2765        iter.pos = 0;
2766        for attr in iter {
2767            if let Nl80211Attrs::SchedScanMatch(val) = attr? {
2768                return Ok(val);
2769            }
2770        }
2771        Err(ErrorContext::new_missing(
2772            "Nl80211Attrs",
2773            "SchedScanMatch",
2774            self.orig_loc,
2775            self.buf.as_ptr() as usize,
2776        ))
2777    }
2778    pub fn get_max_match_sets(&self) -> Result<u8, ErrorContext> {
2779        let mut iter = self.clone();
2780        iter.pos = 0;
2781        for attr in iter {
2782            if let Nl80211Attrs::MaxMatchSets(val) = attr? {
2783                return Ok(val);
2784            }
2785        }
2786        Err(ErrorContext::new_missing(
2787            "Nl80211Attrs",
2788            "MaxMatchSets",
2789            self.orig_loc,
2790            self.buf.as_ptr() as usize,
2791        ))
2792    }
2793    pub fn get_pmksa_candidate(&self) -> Result<&'a [u8], ErrorContext> {
2794        let mut iter = self.clone();
2795        iter.pos = 0;
2796        for attr in iter {
2797            if let Nl80211Attrs::PmksaCandidate(val) = attr? {
2798                return Ok(val);
2799            }
2800        }
2801        Err(ErrorContext::new_missing(
2802            "Nl80211Attrs",
2803            "PmksaCandidate",
2804            self.orig_loc,
2805            self.buf.as_ptr() as usize,
2806        ))
2807    }
2808    pub fn get_tx_no_cck_rate(&self) -> Result<(), ErrorContext> {
2809        let mut iter = self.clone();
2810        iter.pos = 0;
2811        for attr in iter {
2812            if let Nl80211Attrs::TxNoCckRate(val) = attr? {
2813                return Ok(val);
2814            }
2815        }
2816        Err(ErrorContext::new_missing(
2817            "Nl80211Attrs",
2818            "TxNoCckRate",
2819            self.orig_loc,
2820            self.buf.as_ptr() as usize,
2821        ))
2822    }
2823    pub fn get_tdls_action(&self) -> Result<u8, ErrorContext> {
2824        let mut iter = self.clone();
2825        iter.pos = 0;
2826        for attr in iter {
2827            if let Nl80211Attrs::TdlsAction(val) = attr? {
2828                return Ok(val);
2829            }
2830        }
2831        Err(ErrorContext::new_missing(
2832            "Nl80211Attrs",
2833            "TdlsAction",
2834            self.orig_loc,
2835            self.buf.as_ptr() as usize,
2836        ))
2837    }
2838    pub fn get_tdls_dialog_token(&self) -> Result<u8, ErrorContext> {
2839        let mut iter = self.clone();
2840        iter.pos = 0;
2841        for attr in iter {
2842            if let Nl80211Attrs::TdlsDialogToken(val) = attr? {
2843                return Ok(val);
2844            }
2845        }
2846        Err(ErrorContext::new_missing(
2847            "Nl80211Attrs",
2848            "TdlsDialogToken",
2849            self.orig_loc,
2850            self.buf.as_ptr() as usize,
2851        ))
2852    }
2853    pub fn get_tdls_operation(&self) -> Result<u8, ErrorContext> {
2854        let mut iter = self.clone();
2855        iter.pos = 0;
2856        for attr in iter {
2857            if let Nl80211Attrs::TdlsOperation(val) = attr? {
2858                return Ok(val);
2859            }
2860        }
2861        Err(ErrorContext::new_missing(
2862            "Nl80211Attrs",
2863            "TdlsOperation",
2864            self.orig_loc,
2865            self.buf.as_ptr() as usize,
2866        ))
2867    }
2868    pub fn get_tdls_support(&self) -> Result<(), ErrorContext> {
2869        let mut iter = self.clone();
2870        iter.pos = 0;
2871        for attr in iter {
2872            if let Nl80211Attrs::TdlsSupport(val) = attr? {
2873                return Ok(val);
2874            }
2875        }
2876        Err(ErrorContext::new_missing(
2877            "Nl80211Attrs",
2878            "TdlsSupport",
2879            self.orig_loc,
2880            self.buf.as_ptr() as usize,
2881        ))
2882    }
2883    pub fn get_tdls_external_setup(&self) -> Result<(), ErrorContext> {
2884        let mut iter = self.clone();
2885        iter.pos = 0;
2886        for attr in iter {
2887            if let Nl80211Attrs::TdlsExternalSetup(val) = attr? {
2888                return Ok(val);
2889            }
2890        }
2891        Err(ErrorContext::new_missing(
2892            "Nl80211Attrs",
2893            "TdlsExternalSetup",
2894            self.orig_loc,
2895            self.buf.as_ptr() as usize,
2896        ))
2897    }
2898    pub fn get_device_ap_sme(&self) -> Result<u32, ErrorContext> {
2899        let mut iter = self.clone();
2900        iter.pos = 0;
2901        for attr in iter {
2902            if let Nl80211Attrs::DeviceApSme(val) = attr? {
2903                return Ok(val);
2904            }
2905        }
2906        Err(ErrorContext::new_missing(
2907            "Nl80211Attrs",
2908            "DeviceApSme",
2909            self.orig_loc,
2910            self.buf.as_ptr() as usize,
2911        ))
2912    }
2913    pub fn get_dont_wait_for_ack(&self) -> Result<(), ErrorContext> {
2914        let mut iter = self.clone();
2915        iter.pos = 0;
2916        for attr in iter {
2917            if let Nl80211Attrs::DontWaitForAck(val) = attr? {
2918                return Ok(val);
2919            }
2920        }
2921        Err(ErrorContext::new_missing(
2922            "Nl80211Attrs",
2923            "DontWaitForAck",
2924            self.orig_loc,
2925            self.buf.as_ptr() as usize,
2926        ))
2927    }
2928    #[doc = "Associated type: \"FeatureFlags\" (1 bit per enumeration)"]
2929    pub fn get_feature_flags(&self) -> Result<u32, ErrorContext> {
2930        let mut iter = self.clone();
2931        iter.pos = 0;
2932        for attr in iter {
2933            if let Nl80211Attrs::FeatureFlags(val) = attr? {
2934                return Ok(val);
2935            }
2936        }
2937        Err(ErrorContext::new_missing(
2938            "Nl80211Attrs",
2939            "FeatureFlags",
2940            self.orig_loc,
2941            self.buf.as_ptr() as usize,
2942        ))
2943    }
2944    pub fn get_probe_resp_offload(&self) -> Result<u32, ErrorContext> {
2945        let mut iter = self.clone();
2946        iter.pos = 0;
2947        for attr in iter {
2948            if let Nl80211Attrs::ProbeRespOffload(val) = attr? {
2949                return Ok(val);
2950            }
2951        }
2952        Err(ErrorContext::new_missing(
2953            "Nl80211Attrs",
2954            "ProbeRespOffload",
2955            self.orig_loc,
2956            self.buf.as_ptr() as usize,
2957        ))
2958    }
2959    pub fn get_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
2960        let mut iter = self.clone();
2961        iter.pos = 0;
2962        for attr in iter {
2963            if let Nl80211Attrs::ProbeResp(val) = attr? {
2964                return Ok(val);
2965            }
2966        }
2967        Err(ErrorContext::new_missing(
2968            "Nl80211Attrs",
2969            "ProbeResp",
2970            self.orig_loc,
2971            self.buf.as_ptr() as usize,
2972        ))
2973    }
2974    pub fn get_dfs_region(&self) -> Result<u8, ErrorContext> {
2975        let mut iter = self.clone();
2976        iter.pos = 0;
2977        for attr in iter {
2978            if let Nl80211Attrs::DfsRegion(val) = attr? {
2979                return Ok(val);
2980            }
2981        }
2982        Err(ErrorContext::new_missing(
2983            "Nl80211Attrs",
2984            "DfsRegion",
2985            self.orig_loc,
2986            self.buf.as_ptr() as usize,
2987        ))
2988    }
2989    pub fn get_disable_ht(&self) -> Result<(), ErrorContext> {
2990        let mut iter = self.clone();
2991        iter.pos = 0;
2992        for attr in iter {
2993            if let Nl80211Attrs::DisableHt(val) = attr? {
2994                return Ok(val);
2995            }
2996        }
2997        Err(ErrorContext::new_missing(
2998            "Nl80211Attrs",
2999            "DisableHt",
3000            self.orig_loc,
3001            self.buf.as_ptr() as usize,
3002        ))
3003    }
3004    pub fn get_ht_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
3005        let mut iter = self.clone();
3006        iter.pos = 0;
3007        for attr in iter {
3008            if let Nl80211Attrs::HtCapabilityMask(val) = attr? {
3009                return Ok(val);
3010            }
3011        }
3012        Err(ErrorContext::new_missing(
3013            "Nl80211Attrs",
3014            "HtCapabilityMask",
3015            self.orig_loc,
3016            self.buf.as_ptr() as usize,
3017        ))
3018    }
3019    pub fn get_noack_map(&self) -> Result<u16, ErrorContext> {
3020        let mut iter = self.clone();
3021        iter.pos = 0;
3022        for attr in iter {
3023            if let Nl80211Attrs::NoackMap(val) = attr? {
3024                return Ok(val);
3025            }
3026        }
3027        Err(ErrorContext::new_missing(
3028            "Nl80211Attrs",
3029            "NoackMap",
3030            self.orig_loc,
3031            self.buf.as_ptr() as usize,
3032        ))
3033    }
3034    pub fn get_inactivity_timeout(&self) -> Result<u16, ErrorContext> {
3035        let mut iter = self.clone();
3036        iter.pos = 0;
3037        for attr in iter {
3038            if let Nl80211Attrs::InactivityTimeout(val) = attr? {
3039                return Ok(val);
3040            }
3041        }
3042        Err(ErrorContext::new_missing(
3043            "Nl80211Attrs",
3044            "InactivityTimeout",
3045            self.orig_loc,
3046            self.buf.as_ptr() as usize,
3047        ))
3048    }
3049    pub fn get_rx_signal_dbm(&self) -> Result<u32, ErrorContext> {
3050        let mut iter = self.clone();
3051        iter.pos = 0;
3052        for attr in iter {
3053            if let Nl80211Attrs::RxSignalDbm(val) = attr? {
3054                return Ok(val);
3055            }
3056        }
3057        Err(ErrorContext::new_missing(
3058            "Nl80211Attrs",
3059            "RxSignalDbm",
3060            self.orig_loc,
3061            self.buf.as_ptr() as usize,
3062        ))
3063    }
3064    pub fn get_bg_scan_period(&self) -> Result<u16, ErrorContext> {
3065        let mut iter = self.clone();
3066        iter.pos = 0;
3067        for attr in iter {
3068            if let Nl80211Attrs::BgScanPeriod(val) = attr? {
3069                return Ok(val);
3070            }
3071        }
3072        Err(ErrorContext::new_missing(
3073            "Nl80211Attrs",
3074            "BgScanPeriod",
3075            self.orig_loc,
3076            self.buf.as_ptr() as usize,
3077        ))
3078    }
3079    pub fn get_wdev(&self) -> Result<u64, ErrorContext> {
3080        let mut iter = self.clone();
3081        iter.pos = 0;
3082        for attr in iter {
3083            if let Nl80211Attrs::Wdev(val) = attr? {
3084                return Ok(val);
3085            }
3086        }
3087        Err(ErrorContext::new_missing(
3088            "Nl80211Attrs",
3089            "Wdev",
3090            self.orig_loc,
3091            self.buf.as_ptr() as usize,
3092        ))
3093    }
3094    pub fn get_user_reg_hint_type(&self) -> Result<u32, ErrorContext> {
3095        let mut iter = self.clone();
3096        iter.pos = 0;
3097        for attr in iter {
3098            if let Nl80211Attrs::UserRegHintType(val) = attr? {
3099                return Ok(val);
3100            }
3101        }
3102        Err(ErrorContext::new_missing(
3103            "Nl80211Attrs",
3104            "UserRegHintType",
3105            self.orig_loc,
3106            self.buf.as_ptr() as usize,
3107        ))
3108    }
3109    pub fn get_conn_failed_reason(&self) -> Result<u32, ErrorContext> {
3110        let mut iter = self.clone();
3111        iter.pos = 0;
3112        for attr in iter {
3113            if let Nl80211Attrs::ConnFailedReason(val) = attr? {
3114                return Ok(val);
3115            }
3116        }
3117        Err(ErrorContext::new_missing(
3118            "Nl80211Attrs",
3119            "ConnFailedReason",
3120            self.orig_loc,
3121            self.buf.as_ptr() as usize,
3122        ))
3123    }
3124    pub fn get_auth_data(&self) -> Result<&'a [u8], ErrorContext> {
3125        let mut iter = self.clone();
3126        iter.pos = 0;
3127        for attr in iter {
3128            if let Nl80211Attrs::AuthData(val) = attr? {
3129                return Ok(val);
3130            }
3131        }
3132        Err(ErrorContext::new_missing(
3133            "Nl80211Attrs",
3134            "AuthData",
3135            self.orig_loc,
3136            self.buf.as_ptr() as usize,
3137        ))
3138    }
3139    pub fn get_vht_capability(&self) -> Result<&'a [u8], ErrorContext> {
3140        let mut iter = self.clone();
3141        iter.pos = 0;
3142        for attr in iter {
3143            if let Nl80211Attrs::VhtCapability(val) = attr? {
3144                return Ok(val);
3145            }
3146        }
3147        Err(ErrorContext::new_missing(
3148            "Nl80211Attrs",
3149            "VhtCapability",
3150            self.orig_loc,
3151            self.buf.as_ptr() as usize,
3152        ))
3153    }
3154    pub fn get_scan_flags(&self) -> Result<u32, ErrorContext> {
3155        let mut iter = self.clone();
3156        iter.pos = 0;
3157        for attr in iter {
3158            if let Nl80211Attrs::ScanFlags(val) = attr? {
3159                return Ok(val);
3160            }
3161        }
3162        Err(ErrorContext::new_missing(
3163            "Nl80211Attrs",
3164            "ScanFlags",
3165            self.orig_loc,
3166            self.buf.as_ptr() as usize,
3167        ))
3168    }
3169    pub fn get_channel_width(&self) -> Result<u32, ErrorContext> {
3170        let mut iter = self.clone();
3171        iter.pos = 0;
3172        for attr in iter {
3173            if let Nl80211Attrs::ChannelWidth(val) = attr? {
3174                return Ok(val);
3175            }
3176        }
3177        Err(ErrorContext::new_missing(
3178            "Nl80211Attrs",
3179            "ChannelWidth",
3180            self.orig_loc,
3181            self.buf.as_ptr() as usize,
3182        ))
3183    }
3184    pub fn get_center_freq1(&self) -> Result<u32, ErrorContext> {
3185        let mut iter = self.clone();
3186        iter.pos = 0;
3187        for attr in iter {
3188            if let Nl80211Attrs::CenterFreq1(val) = attr? {
3189                return Ok(val);
3190            }
3191        }
3192        Err(ErrorContext::new_missing(
3193            "Nl80211Attrs",
3194            "CenterFreq1",
3195            self.orig_loc,
3196            self.buf.as_ptr() as usize,
3197        ))
3198    }
3199    pub fn get_center_freq2(&self) -> Result<u32, ErrorContext> {
3200        let mut iter = self.clone();
3201        iter.pos = 0;
3202        for attr in iter {
3203            if let Nl80211Attrs::CenterFreq2(val) = attr? {
3204                return Ok(val);
3205            }
3206        }
3207        Err(ErrorContext::new_missing(
3208            "Nl80211Attrs",
3209            "CenterFreq2",
3210            self.orig_loc,
3211            self.buf.as_ptr() as usize,
3212        ))
3213    }
3214    pub fn get_p2p_ctwindow(&self) -> Result<u8, ErrorContext> {
3215        let mut iter = self.clone();
3216        iter.pos = 0;
3217        for attr in iter {
3218            if let Nl80211Attrs::P2pCtwindow(val) = attr? {
3219                return Ok(val);
3220            }
3221        }
3222        Err(ErrorContext::new_missing(
3223            "Nl80211Attrs",
3224            "P2pCtwindow",
3225            self.orig_loc,
3226            self.buf.as_ptr() as usize,
3227        ))
3228    }
3229    pub fn get_p2p_oppps(&self) -> Result<u8, ErrorContext> {
3230        let mut iter = self.clone();
3231        iter.pos = 0;
3232        for attr in iter {
3233            if let Nl80211Attrs::P2pOppps(val) = attr? {
3234                return Ok(val);
3235            }
3236        }
3237        Err(ErrorContext::new_missing(
3238            "Nl80211Attrs",
3239            "P2pOppps",
3240            self.orig_loc,
3241            self.buf.as_ptr() as usize,
3242        ))
3243    }
3244    pub fn get_local_mesh_power_mode(&self) -> Result<u32, ErrorContext> {
3245        let mut iter = self.clone();
3246        iter.pos = 0;
3247        for attr in iter {
3248            if let Nl80211Attrs::LocalMeshPowerMode(val) = attr? {
3249                return Ok(val);
3250            }
3251        }
3252        Err(ErrorContext::new_missing(
3253            "Nl80211Attrs",
3254            "LocalMeshPowerMode",
3255            self.orig_loc,
3256            self.buf.as_ptr() as usize,
3257        ))
3258    }
3259    pub fn get_acl_policy(&self) -> Result<u32, ErrorContext> {
3260        let mut iter = self.clone();
3261        iter.pos = 0;
3262        for attr in iter {
3263            if let Nl80211Attrs::AclPolicy(val) = attr? {
3264                return Ok(val);
3265            }
3266        }
3267        Err(ErrorContext::new_missing(
3268            "Nl80211Attrs",
3269            "AclPolicy",
3270            self.orig_loc,
3271            self.buf.as_ptr() as usize,
3272        ))
3273    }
3274    pub fn get_mac_addrs(&self) -> Result<&'a [u8], ErrorContext> {
3275        let mut iter = self.clone();
3276        iter.pos = 0;
3277        for attr in iter {
3278            if let Nl80211Attrs::MacAddrs(val) = attr? {
3279                return Ok(val);
3280            }
3281        }
3282        Err(ErrorContext::new_missing(
3283            "Nl80211Attrs",
3284            "MacAddrs",
3285            self.orig_loc,
3286            self.buf.as_ptr() as usize,
3287        ))
3288    }
3289    pub fn get_mac_acl_max(&self) -> Result<u32, ErrorContext> {
3290        let mut iter = self.clone();
3291        iter.pos = 0;
3292        for attr in iter {
3293            if let Nl80211Attrs::MacAclMax(val) = attr? {
3294                return Ok(val);
3295            }
3296        }
3297        Err(ErrorContext::new_missing(
3298            "Nl80211Attrs",
3299            "MacAclMax",
3300            self.orig_loc,
3301            self.buf.as_ptr() as usize,
3302        ))
3303    }
3304    pub fn get_radar_event(&self) -> Result<u32, ErrorContext> {
3305        let mut iter = self.clone();
3306        iter.pos = 0;
3307        for attr in iter {
3308            if let Nl80211Attrs::RadarEvent(val) = attr? {
3309                return Ok(val);
3310            }
3311        }
3312        Err(ErrorContext::new_missing(
3313            "Nl80211Attrs",
3314            "RadarEvent",
3315            self.orig_loc,
3316            self.buf.as_ptr() as usize,
3317        ))
3318    }
3319    pub fn get_ext_capa(&self) -> Result<&'a [u8], ErrorContext> {
3320        let mut iter = self.clone();
3321        iter.pos = 0;
3322        for attr in iter {
3323            if let Nl80211Attrs::ExtCapa(val) = attr? {
3324                return Ok(val);
3325            }
3326        }
3327        Err(ErrorContext::new_missing(
3328            "Nl80211Attrs",
3329            "ExtCapa",
3330            self.orig_loc,
3331            self.buf.as_ptr() as usize,
3332        ))
3333    }
3334    pub fn get_ext_capa_mask(&self) -> Result<&'a [u8], ErrorContext> {
3335        let mut iter = self.clone();
3336        iter.pos = 0;
3337        for attr in iter {
3338            if let Nl80211Attrs::ExtCapaMask(val) = attr? {
3339                return Ok(val);
3340            }
3341        }
3342        Err(ErrorContext::new_missing(
3343            "Nl80211Attrs",
3344            "ExtCapaMask",
3345            self.orig_loc,
3346            self.buf.as_ptr() as usize,
3347        ))
3348    }
3349    pub fn get_sta_capability(&self) -> Result<u16, ErrorContext> {
3350        let mut iter = self.clone();
3351        iter.pos = 0;
3352        for attr in iter {
3353            if let Nl80211Attrs::StaCapability(val) = attr? {
3354                return Ok(val);
3355            }
3356        }
3357        Err(ErrorContext::new_missing(
3358            "Nl80211Attrs",
3359            "StaCapability",
3360            self.orig_loc,
3361            self.buf.as_ptr() as usize,
3362        ))
3363    }
3364    pub fn get_sta_ext_capability(&self) -> Result<&'a [u8], ErrorContext> {
3365        let mut iter = self.clone();
3366        iter.pos = 0;
3367        for attr in iter {
3368            if let Nl80211Attrs::StaExtCapability(val) = attr? {
3369                return Ok(val);
3370            }
3371        }
3372        Err(ErrorContext::new_missing(
3373            "Nl80211Attrs",
3374            "StaExtCapability",
3375            self.orig_loc,
3376            self.buf.as_ptr() as usize,
3377        ))
3378    }
3379    #[doc = "Associated type: \"ProtocolFeatures\" (enum)"]
3380    pub fn get_protocol_features(&self) -> Result<u32, ErrorContext> {
3381        let mut iter = self.clone();
3382        iter.pos = 0;
3383        for attr in iter {
3384            if let Nl80211Attrs::ProtocolFeatures(val) = attr? {
3385                return Ok(val);
3386            }
3387        }
3388        Err(ErrorContext::new_missing(
3389            "Nl80211Attrs",
3390            "ProtocolFeatures",
3391            self.orig_loc,
3392            self.buf.as_ptr() as usize,
3393        ))
3394    }
3395    pub fn get_split_wiphy_dump(&self) -> Result<(), ErrorContext> {
3396        let mut iter = self.clone();
3397        iter.pos = 0;
3398        for attr in iter {
3399            if let Nl80211Attrs::SplitWiphyDump(val) = attr? {
3400                return Ok(val);
3401            }
3402        }
3403        Err(ErrorContext::new_missing(
3404            "Nl80211Attrs",
3405            "SplitWiphyDump",
3406            self.orig_loc,
3407            self.buf.as_ptr() as usize,
3408        ))
3409    }
3410    pub fn get_disable_vht(&self) -> Result<(), ErrorContext> {
3411        let mut iter = self.clone();
3412        iter.pos = 0;
3413        for attr in iter {
3414            if let Nl80211Attrs::DisableVht(val) = attr? {
3415                return Ok(val);
3416            }
3417        }
3418        Err(ErrorContext::new_missing(
3419            "Nl80211Attrs",
3420            "DisableVht",
3421            self.orig_loc,
3422            self.buf.as_ptr() as usize,
3423        ))
3424    }
3425    pub fn get_vht_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
3426        let mut iter = self.clone();
3427        iter.pos = 0;
3428        for attr in iter {
3429            if let Nl80211Attrs::VhtCapabilityMask(val) = attr? {
3430                return Ok(val);
3431            }
3432        }
3433        Err(ErrorContext::new_missing(
3434            "Nl80211Attrs",
3435            "VhtCapabilityMask",
3436            self.orig_loc,
3437            self.buf.as_ptr() as usize,
3438        ))
3439    }
3440    pub fn get_mdid(&self) -> Result<u16, ErrorContext> {
3441        let mut iter = self.clone();
3442        iter.pos = 0;
3443        for attr in iter {
3444            if let Nl80211Attrs::Mdid(val) = attr? {
3445                return Ok(val);
3446            }
3447        }
3448        Err(ErrorContext::new_missing(
3449            "Nl80211Attrs",
3450            "Mdid",
3451            self.orig_loc,
3452            self.buf.as_ptr() as usize,
3453        ))
3454    }
3455    pub fn get_ie_ric(&self) -> Result<&'a [u8], ErrorContext> {
3456        let mut iter = self.clone();
3457        iter.pos = 0;
3458        for attr in iter {
3459            if let Nl80211Attrs::IeRic(val) = attr? {
3460                return Ok(val);
3461            }
3462        }
3463        Err(ErrorContext::new_missing(
3464            "Nl80211Attrs",
3465            "IeRic",
3466            self.orig_loc,
3467            self.buf.as_ptr() as usize,
3468        ))
3469    }
3470    pub fn get_crit_prot_id(&self) -> Result<u16, ErrorContext> {
3471        let mut iter = self.clone();
3472        iter.pos = 0;
3473        for attr in iter {
3474            if let Nl80211Attrs::CritProtId(val) = attr? {
3475                return Ok(val);
3476            }
3477        }
3478        Err(ErrorContext::new_missing(
3479            "Nl80211Attrs",
3480            "CritProtId",
3481            self.orig_loc,
3482            self.buf.as_ptr() as usize,
3483        ))
3484    }
3485    pub fn get_max_crit_prot_duration(&self) -> Result<u16, ErrorContext> {
3486        let mut iter = self.clone();
3487        iter.pos = 0;
3488        for attr in iter {
3489            if let Nl80211Attrs::MaxCritProtDuration(val) = attr? {
3490                return Ok(val);
3491            }
3492        }
3493        Err(ErrorContext::new_missing(
3494            "Nl80211Attrs",
3495            "MaxCritProtDuration",
3496            self.orig_loc,
3497            self.buf.as_ptr() as usize,
3498        ))
3499    }
3500    pub fn get_peer_aid(&self) -> Result<u16, ErrorContext> {
3501        let mut iter = self.clone();
3502        iter.pos = 0;
3503        for attr in iter {
3504            if let Nl80211Attrs::PeerAid(val) = attr? {
3505                return Ok(val);
3506            }
3507        }
3508        Err(ErrorContext::new_missing(
3509            "Nl80211Attrs",
3510            "PeerAid",
3511            self.orig_loc,
3512            self.buf.as_ptr() as usize,
3513        ))
3514    }
3515    pub fn get_coalesce_rule(&self) -> Result<&'a [u8], ErrorContext> {
3516        let mut iter = self.clone();
3517        iter.pos = 0;
3518        for attr in iter {
3519            if let Nl80211Attrs::CoalesceRule(val) = attr? {
3520                return Ok(val);
3521            }
3522        }
3523        Err(ErrorContext::new_missing(
3524            "Nl80211Attrs",
3525            "CoalesceRule",
3526            self.orig_loc,
3527            self.buf.as_ptr() as usize,
3528        ))
3529    }
3530    pub fn get_ch_switch_count(&self) -> Result<u32, ErrorContext> {
3531        let mut iter = self.clone();
3532        iter.pos = 0;
3533        for attr in iter {
3534            if let Nl80211Attrs::ChSwitchCount(val) = attr? {
3535                return Ok(val);
3536            }
3537        }
3538        Err(ErrorContext::new_missing(
3539            "Nl80211Attrs",
3540            "ChSwitchCount",
3541            self.orig_loc,
3542            self.buf.as_ptr() as usize,
3543        ))
3544    }
3545    pub fn get_ch_switch_block_tx(&self) -> Result<(), ErrorContext> {
3546        let mut iter = self.clone();
3547        iter.pos = 0;
3548        for attr in iter {
3549            if let Nl80211Attrs::ChSwitchBlockTx(val) = attr? {
3550                return Ok(val);
3551            }
3552        }
3553        Err(ErrorContext::new_missing(
3554            "Nl80211Attrs",
3555            "ChSwitchBlockTx",
3556            self.orig_loc,
3557            self.buf.as_ptr() as usize,
3558        ))
3559    }
3560    pub fn get_csa_ies(&self) -> Result<&'a [u8], ErrorContext> {
3561        let mut iter = self.clone();
3562        iter.pos = 0;
3563        for attr in iter {
3564            if let Nl80211Attrs::CsaIes(val) = attr? {
3565                return Ok(val);
3566            }
3567        }
3568        Err(ErrorContext::new_missing(
3569            "Nl80211Attrs",
3570            "CsaIes",
3571            self.orig_loc,
3572            self.buf.as_ptr() as usize,
3573        ))
3574    }
3575    pub fn get_cntdwn_offs_beacon(&self) -> Result<&'a [u8], ErrorContext> {
3576        let mut iter = self.clone();
3577        iter.pos = 0;
3578        for attr in iter {
3579            if let Nl80211Attrs::CntdwnOffsBeacon(val) = attr? {
3580                return Ok(val);
3581            }
3582        }
3583        Err(ErrorContext::new_missing(
3584            "Nl80211Attrs",
3585            "CntdwnOffsBeacon",
3586            self.orig_loc,
3587            self.buf.as_ptr() as usize,
3588        ))
3589    }
3590    pub fn get_cntdwn_offs_presp(&self) -> Result<&'a [u8], ErrorContext> {
3591        let mut iter = self.clone();
3592        iter.pos = 0;
3593        for attr in iter {
3594            if let Nl80211Attrs::CntdwnOffsPresp(val) = attr? {
3595                return Ok(val);
3596            }
3597        }
3598        Err(ErrorContext::new_missing(
3599            "Nl80211Attrs",
3600            "CntdwnOffsPresp",
3601            self.orig_loc,
3602            self.buf.as_ptr() as usize,
3603        ))
3604    }
3605    pub fn get_rxmgmt_flags(&self) -> Result<&'a [u8], ErrorContext> {
3606        let mut iter = self.clone();
3607        iter.pos = 0;
3608        for attr in iter {
3609            if let Nl80211Attrs::RxmgmtFlags(val) = attr? {
3610                return Ok(val);
3611            }
3612        }
3613        Err(ErrorContext::new_missing(
3614            "Nl80211Attrs",
3615            "RxmgmtFlags",
3616            self.orig_loc,
3617            self.buf.as_ptr() as usize,
3618        ))
3619    }
3620    pub fn get_sta_supported_channels(&self) -> Result<&'a [u8], ErrorContext> {
3621        let mut iter = self.clone();
3622        iter.pos = 0;
3623        for attr in iter {
3624            if let Nl80211Attrs::StaSupportedChannels(val) = attr? {
3625                return Ok(val);
3626            }
3627        }
3628        Err(ErrorContext::new_missing(
3629            "Nl80211Attrs",
3630            "StaSupportedChannels",
3631            self.orig_loc,
3632            self.buf.as_ptr() as usize,
3633        ))
3634    }
3635    pub fn get_sta_supported_oper_classes(&self) -> Result<&'a [u8], ErrorContext> {
3636        let mut iter = self.clone();
3637        iter.pos = 0;
3638        for attr in iter {
3639            if let Nl80211Attrs::StaSupportedOperClasses(val) = attr? {
3640                return Ok(val);
3641            }
3642        }
3643        Err(ErrorContext::new_missing(
3644            "Nl80211Attrs",
3645            "StaSupportedOperClasses",
3646            self.orig_loc,
3647            self.buf.as_ptr() as usize,
3648        ))
3649    }
3650    pub fn get_handle_dfs(&self) -> Result<(), ErrorContext> {
3651        let mut iter = self.clone();
3652        iter.pos = 0;
3653        for attr in iter {
3654            if let Nl80211Attrs::HandleDfs(val) = attr? {
3655                return Ok(val);
3656            }
3657        }
3658        Err(ErrorContext::new_missing(
3659            "Nl80211Attrs",
3660            "HandleDfs",
3661            self.orig_loc,
3662            self.buf.as_ptr() as usize,
3663        ))
3664    }
3665    pub fn get_support_5_mhz(&self) -> Result<(), ErrorContext> {
3666        let mut iter = self.clone();
3667        iter.pos = 0;
3668        for attr in iter {
3669            if let Nl80211Attrs::Support5Mhz(val) = attr? {
3670                return Ok(val);
3671            }
3672        }
3673        Err(ErrorContext::new_missing(
3674            "Nl80211Attrs",
3675            "Support5Mhz",
3676            self.orig_loc,
3677            self.buf.as_ptr() as usize,
3678        ))
3679    }
3680    pub fn get_support_10_mhz(&self) -> Result<(), ErrorContext> {
3681        let mut iter = self.clone();
3682        iter.pos = 0;
3683        for attr in iter {
3684            if let Nl80211Attrs::Support10Mhz(val) = attr? {
3685                return Ok(val);
3686            }
3687        }
3688        Err(ErrorContext::new_missing(
3689            "Nl80211Attrs",
3690            "Support10Mhz",
3691            self.orig_loc,
3692            self.buf.as_ptr() as usize,
3693        ))
3694    }
3695    pub fn get_opmode_notif(&self) -> Result<u8, ErrorContext> {
3696        let mut iter = self.clone();
3697        iter.pos = 0;
3698        for attr in iter {
3699            if let Nl80211Attrs::OpmodeNotif(val) = attr? {
3700                return Ok(val);
3701            }
3702        }
3703        Err(ErrorContext::new_missing(
3704            "Nl80211Attrs",
3705            "OpmodeNotif",
3706            self.orig_loc,
3707            self.buf.as_ptr() as usize,
3708        ))
3709    }
3710    pub fn get_vendor_id(&self) -> Result<u32, ErrorContext> {
3711        let mut iter = self.clone();
3712        iter.pos = 0;
3713        for attr in iter {
3714            if let Nl80211Attrs::VendorId(val) = attr? {
3715                return Ok(val);
3716            }
3717        }
3718        Err(ErrorContext::new_missing(
3719            "Nl80211Attrs",
3720            "VendorId",
3721            self.orig_loc,
3722            self.buf.as_ptr() as usize,
3723        ))
3724    }
3725    pub fn get_vendor_subcmd(&self) -> Result<u32, ErrorContext> {
3726        let mut iter = self.clone();
3727        iter.pos = 0;
3728        for attr in iter {
3729            if let Nl80211Attrs::VendorSubcmd(val) = attr? {
3730                return Ok(val);
3731            }
3732        }
3733        Err(ErrorContext::new_missing(
3734            "Nl80211Attrs",
3735            "VendorSubcmd",
3736            self.orig_loc,
3737            self.buf.as_ptr() as usize,
3738        ))
3739    }
3740    pub fn get_vendor_data(&self) -> Result<&'a [u8], ErrorContext> {
3741        let mut iter = self.clone();
3742        iter.pos = 0;
3743        for attr in iter {
3744            if let Nl80211Attrs::VendorData(val) = attr? {
3745                return Ok(val);
3746            }
3747        }
3748        Err(ErrorContext::new_missing(
3749            "Nl80211Attrs",
3750            "VendorData",
3751            self.orig_loc,
3752            self.buf.as_ptr() as usize,
3753        ))
3754    }
3755    pub fn get_vendor_events(&self) -> Result<&'a [u8], ErrorContext> {
3756        let mut iter = self.clone();
3757        iter.pos = 0;
3758        for attr in iter {
3759            if let Nl80211Attrs::VendorEvents(val) = attr? {
3760                return Ok(val);
3761            }
3762        }
3763        Err(ErrorContext::new_missing(
3764            "Nl80211Attrs",
3765            "VendorEvents",
3766            self.orig_loc,
3767            self.buf.as_ptr() as usize,
3768        ))
3769    }
3770    pub fn get_qos_map(&self) -> Result<&'a [u8], ErrorContext> {
3771        let mut iter = self.clone();
3772        iter.pos = 0;
3773        for attr in iter {
3774            if let Nl80211Attrs::QosMap(val) = attr? {
3775                return Ok(val);
3776            }
3777        }
3778        Err(ErrorContext::new_missing(
3779            "Nl80211Attrs",
3780            "QosMap",
3781            self.orig_loc,
3782            self.buf.as_ptr() as usize,
3783        ))
3784    }
3785    pub fn get_mac_hint(&self) -> Result<&'a [u8], ErrorContext> {
3786        let mut iter = self.clone();
3787        iter.pos = 0;
3788        for attr in iter {
3789            if let Nl80211Attrs::MacHint(val) = attr? {
3790                return Ok(val);
3791            }
3792        }
3793        Err(ErrorContext::new_missing(
3794            "Nl80211Attrs",
3795            "MacHint",
3796            self.orig_loc,
3797            self.buf.as_ptr() as usize,
3798        ))
3799    }
3800    pub fn get_wiphy_freq_hint(&self) -> Result<u32, ErrorContext> {
3801        let mut iter = self.clone();
3802        iter.pos = 0;
3803        for attr in iter {
3804            if let Nl80211Attrs::WiphyFreqHint(val) = attr? {
3805                return Ok(val);
3806            }
3807        }
3808        Err(ErrorContext::new_missing(
3809            "Nl80211Attrs",
3810            "WiphyFreqHint",
3811            self.orig_loc,
3812            self.buf.as_ptr() as usize,
3813        ))
3814    }
3815    pub fn get_max_ap_assoc_sta(&self) -> Result<u32, ErrorContext> {
3816        let mut iter = self.clone();
3817        iter.pos = 0;
3818        for attr in iter {
3819            if let Nl80211Attrs::MaxApAssocSta(val) = attr? {
3820                return Ok(val);
3821            }
3822        }
3823        Err(ErrorContext::new_missing(
3824            "Nl80211Attrs",
3825            "MaxApAssocSta",
3826            self.orig_loc,
3827            self.buf.as_ptr() as usize,
3828        ))
3829    }
3830    pub fn get_tdls_peer_capability(&self) -> Result<u32, ErrorContext> {
3831        let mut iter = self.clone();
3832        iter.pos = 0;
3833        for attr in iter {
3834            if let Nl80211Attrs::TdlsPeerCapability(val) = attr? {
3835                return Ok(val);
3836            }
3837        }
3838        Err(ErrorContext::new_missing(
3839            "Nl80211Attrs",
3840            "TdlsPeerCapability",
3841            self.orig_loc,
3842            self.buf.as_ptr() as usize,
3843        ))
3844    }
3845    pub fn get_socket_owner(&self) -> Result<(), ErrorContext> {
3846        let mut iter = self.clone();
3847        iter.pos = 0;
3848        for attr in iter {
3849            if let Nl80211Attrs::SocketOwner(val) = attr? {
3850                return Ok(val);
3851            }
3852        }
3853        Err(ErrorContext::new_missing(
3854            "Nl80211Attrs",
3855            "SocketOwner",
3856            self.orig_loc,
3857            self.buf.as_ptr() as usize,
3858        ))
3859    }
3860    pub fn get_csa_c_offsets_tx(&self) -> Result<&'a [u8], ErrorContext> {
3861        let mut iter = self.clone();
3862        iter.pos = 0;
3863        for attr in iter {
3864            if let Nl80211Attrs::CsaCOffsetsTx(val) = attr? {
3865                return Ok(val);
3866            }
3867        }
3868        Err(ErrorContext::new_missing(
3869            "Nl80211Attrs",
3870            "CsaCOffsetsTx",
3871            self.orig_loc,
3872            self.buf.as_ptr() as usize,
3873        ))
3874    }
3875    pub fn get_max_csa_counters(&self) -> Result<u8, ErrorContext> {
3876        let mut iter = self.clone();
3877        iter.pos = 0;
3878        for attr in iter {
3879            if let Nl80211Attrs::MaxCsaCounters(val) = attr? {
3880                return Ok(val);
3881            }
3882        }
3883        Err(ErrorContext::new_missing(
3884            "Nl80211Attrs",
3885            "MaxCsaCounters",
3886            self.orig_loc,
3887            self.buf.as_ptr() as usize,
3888        ))
3889    }
3890    pub fn get_tdls_initiator(&self) -> Result<(), ErrorContext> {
3891        let mut iter = self.clone();
3892        iter.pos = 0;
3893        for attr in iter {
3894            if let Nl80211Attrs::TdlsInitiator(val) = attr? {
3895                return Ok(val);
3896            }
3897        }
3898        Err(ErrorContext::new_missing(
3899            "Nl80211Attrs",
3900            "TdlsInitiator",
3901            self.orig_loc,
3902            self.buf.as_ptr() as usize,
3903        ))
3904    }
3905    pub fn get_use_rrm(&self) -> Result<(), ErrorContext> {
3906        let mut iter = self.clone();
3907        iter.pos = 0;
3908        for attr in iter {
3909            if let Nl80211Attrs::UseRrm(val) = attr? {
3910                return Ok(val);
3911            }
3912        }
3913        Err(ErrorContext::new_missing(
3914            "Nl80211Attrs",
3915            "UseRrm",
3916            self.orig_loc,
3917            self.buf.as_ptr() as usize,
3918        ))
3919    }
3920    pub fn get_wiphy_dyn_ack(&self) -> Result<(), ErrorContext> {
3921        let mut iter = self.clone();
3922        iter.pos = 0;
3923        for attr in iter {
3924            if let Nl80211Attrs::WiphyDynAck(val) = attr? {
3925                return Ok(val);
3926            }
3927        }
3928        Err(ErrorContext::new_missing(
3929            "Nl80211Attrs",
3930            "WiphyDynAck",
3931            self.orig_loc,
3932            self.buf.as_ptr() as usize,
3933        ))
3934    }
3935    pub fn get_tsid(&self) -> Result<u8, ErrorContext> {
3936        let mut iter = self.clone();
3937        iter.pos = 0;
3938        for attr in iter {
3939            if let Nl80211Attrs::Tsid(val) = attr? {
3940                return Ok(val);
3941            }
3942        }
3943        Err(ErrorContext::new_missing(
3944            "Nl80211Attrs",
3945            "Tsid",
3946            self.orig_loc,
3947            self.buf.as_ptr() as usize,
3948        ))
3949    }
3950    pub fn get_user_prio(&self) -> Result<u8, ErrorContext> {
3951        let mut iter = self.clone();
3952        iter.pos = 0;
3953        for attr in iter {
3954            if let Nl80211Attrs::UserPrio(val) = attr? {
3955                return Ok(val);
3956            }
3957        }
3958        Err(ErrorContext::new_missing(
3959            "Nl80211Attrs",
3960            "UserPrio",
3961            self.orig_loc,
3962            self.buf.as_ptr() as usize,
3963        ))
3964    }
3965    pub fn get_admitted_time(&self) -> Result<u16, ErrorContext> {
3966        let mut iter = self.clone();
3967        iter.pos = 0;
3968        for attr in iter {
3969            if let Nl80211Attrs::AdmittedTime(val) = attr? {
3970                return Ok(val);
3971            }
3972        }
3973        Err(ErrorContext::new_missing(
3974            "Nl80211Attrs",
3975            "AdmittedTime",
3976            self.orig_loc,
3977            self.buf.as_ptr() as usize,
3978        ))
3979    }
3980    pub fn get_smps_mode(&self) -> Result<u8, ErrorContext> {
3981        let mut iter = self.clone();
3982        iter.pos = 0;
3983        for attr in iter {
3984            if let Nl80211Attrs::SmpsMode(val) = attr? {
3985                return Ok(val);
3986            }
3987        }
3988        Err(ErrorContext::new_missing(
3989            "Nl80211Attrs",
3990            "SmpsMode",
3991            self.orig_loc,
3992            self.buf.as_ptr() as usize,
3993        ))
3994    }
3995    pub fn get_oper_class(&self) -> Result<u8, ErrorContext> {
3996        let mut iter = self.clone();
3997        iter.pos = 0;
3998        for attr in iter {
3999            if let Nl80211Attrs::OperClass(val) = attr? {
4000                return Ok(val);
4001            }
4002        }
4003        Err(ErrorContext::new_missing(
4004            "Nl80211Attrs",
4005            "OperClass",
4006            self.orig_loc,
4007            self.buf.as_ptr() as usize,
4008        ))
4009    }
4010    pub fn get_mac_mask(&self) -> Result<&'a [u8], ErrorContext> {
4011        let mut iter = self.clone();
4012        iter.pos = 0;
4013        for attr in iter {
4014            if let Nl80211Attrs::MacMask(val) = attr? {
4015                return Ok(val);
4016            }
4017        }
4018        Err(ErrorContext::new_missing(
4019            "Nl80211Attrs",
4020            "MacMask",
4021            self.orig_loc,
4022            self.buf.as_ptr() as usize,
4023        ))
4024    }
4025    pub fn get_wiphy_self_managed_reg(&self) -> Result<(), ErrorContext> {
4026        let mut iter = self.clone();
4027        iter.pos = 0;
4028        for attr in iter {
4029            if let Nl80211Attrs::WiphySelfManagedReg(val) = attr? {
4030                return Ok(val);
4031            }
4032        }
4033        Err(ErrorContext::new_missing(
4034            "Nl80211Attrs",
4035            "WiphySelfManagedReg",
4036            self.orig_loc,
4037            self.buf.as_ptr() as usize,
4038        ))
4039    }
4040    pub fn get_ext_features(&self) -> Result<&'a [u8], ErrorContext> {
4041        let mut iter = self.clone();
4042        iter.pos = 0;
4043        for attr in iter {
4044            if let Nl80211Attrs::ExtFeatures(val) = attr? {
4045                return Ok(val);
4046            }
4047        }
4048        Err(ErrorContext::new_missing(
4049            "Nl80211Attrs",
4050            "ExtFeatures",
4051            self.orig_loc,
4052            self.buf.as_ptr() as usize,
4053        ))
4054    }
4055    pub fn get_survey_radio_stats(&self) -> Result<&'a [u8], ErrorContext> {
4056        let mut iter = self.clone();
4057        iter.pos = 0;
4058        for attr in iter {
4059            if let Nl80211Attrs::SurveyRadioStats(val) = attr? {
4060                return Ok(val);
4061            }
4062        }
4063        Err(ErrorContext::new_missing(
4064            "Nl80211Attrs",
4065            "SurveyRadioStats",
4066            self.orig_loc,
4067            self.buf.as_ptr() as usize,
4068        ))
4069    }
4070    pub fn get_netns_fd(&self) -> Result<u32, ErrorContext> {
4071        let mut iter = self.clone();
4072        iter.pos = 0;
4073        for attr in iter {
4074            if let Nl80211Attrs::NetnsFd(val) = attr? {
4075                return Ok(val);
4076            }
4077        }
4078        Err(ErrorContext::new_missing(
4079            "Nl80211Attrs",
4080            "NetnsFd",
4081            self.orig_loc,
4082            self.buf.as_ptr() as usize,
4083        ))
4084    }
4085    pub fn get_sched_scan_delay(&self) -> Result<u32, ErrorContext> {
4086        let mut iter = self.clone();
4087        iter.pos = 0;
4088        for attr in iter {
4089            if let Nl80211Attrs::SchedScanDelay(val) = attr? {
4090                return Ok(val);
4091            }
4092        }
4093        Err(ErrorContext::new_missing(
4094            "Nl80211Attrs",
4095            "SchedScanDelay",
4096            self.orig_loc,
4097            self.buf.as_ptr() as usize,
4098        ))
4099    }
4100    pub fn get_reg_indoor(&self) -> Result<(), ErrorContext> {
4101        let mut iter = self.clone();
4102        iter.pos = 0;
4103        for attr in iter {
4104            if let Nl80211Attrs::RegIndoor(val) = attr? {
4105                return Ok(val);
4106            }
4107        }
4108        Err(ErrorContext::new_missing(
4109            "Nl80211Attrs",
4110            "RegIndoor",
4111            self.orig_loc,
4112            self.buf.as_ptr() as usize,
4113        ))
4114    }
4115    pub fn get_max_num_sched_scan_plans(&self) -> Result<u32, ErrorContext> {
4116        let mut iter = self.clone();
4117        iter.pos = 0;
4118        for attr in iter {
4119            if let Nl80211Attrs::MaxNumSchedScanPlans(val) = attr? {
4120                return Ok(val);
4121            }
4122        }
4123        Err(ErrorContext::new_missing(
4124            "Nl80211Attrs",
4125            "MaxNumSchedScanPlans",
4126            self.orig_loc,
4127            self.buf.as_ptr() as usize,
4128        ))
4129    }
4130    pub fn get_max_scan_plan_interval(&self) -> Result<u32, ErrorContext> {
4131        let mut iter = self.clone();
4132        iter.pos = 0;
4133        for attr in iter {
4134            if let Nl80211Attrs::MaxScanPlanInterval(val) = attr? {
4135                return Ok(val);
4136            }
4137        }
4138        Err(ErrorContext::new_missing(
4139            "Nl80211Attrs",
4140            "MaxScanPlanInterval",
4141            self.orig_loc,
4142            self.buf.as_ptr() as usize,
4143        ))
4144    }
4145    pub fn get_max_scan_plan_iterations(&self) -> Result<u32, ErrorContext> {
4146        let mut iter = self.clone();
4147        iter.pos = 0;
4148        for attr in iter {
4149            if let Nl80211Attrs::MaxScanPlanIterations(val) = attr? {
4150                return Ok(val);
4151            }
4152        }
4153        Err(ErrorContext::new_missing(
4154            "Nl80211Attrs",
4155            "MaxScanPlanIterations",
4156            self.orig_loc,
4157            self.buf.as_ptr() as usize,
4158        ))
4159    }
4160    pub fn get_sched_scan_plans(&self) -> Result<&'a [u8], ErrorContext> {
4161        let mut iter = self.clone();
4162        iter.pos = 0;
4163        for attr in iter {
4164            if let Nl80211Attrs::SchedScanPlans(val) = attr? {
4165                return Ok(val);
4166            }
4167        }
4168        Err(ErrorContext::new_missing(
4169            "Nl80211Attrs",
4170            "SchedScanPlans",
4171            self.orig_loc,
4172            self.buf.as_ptr() as usize,
4173        ))
4174    }
4175    pub fn get_pbss(&self) -> Result<(), ErrorContext> {
4176        let mut iter = self.clone();
4177        iter.pos = 0;
4178        for attr in iter {
4179            if let Nl80211Attrs::Pbss(val) = attr? {
4180                return Ok(val);
4181            }
4182        }
4183        Err(ErrorContext::new_missing(
4184            "Nl80211Attrs",
4185            "Pbss",
4186            self.orig_loc,
4187            self.buf.as_ptr() as usize,
4188        ))
4189    }
4190    pub fn get_bss_select(&self) -> Result<&'a [u8], ErrorContext> {
4191        let mut iter = self.clone();
4192        iter.pos = 0;
4193        for attr in iter {
4194            if let Nl80211Attrs::BssSelect(val) = attr? {
4195                return Ok(val);
4196            }
4197        }
4198        Err(ErrorContext::new_missing(
4199            "Nl80211Attrs",
4200            "BssSelect",
4201            self.orig_loc,
4202            self.buf.as_ptr() as usize,
4203        ))
4204    }
4205    pub fn get_sta_support_p2p_ps(&self) -> Result<u8, ErrorContext> {
4206        let mut iter = self.clone();
4207        iter.pos = 0;
4208        for attr in iter {
4209            if let Nl80211Attrs::StaSupportP2pPs(val) = attr? {
4210                return Ok(val);
4211            }
4212        }
4213        Err(ErrorContext::new_missing(
4214            "Nl80211Attrs",
4215            "StaSupportP2pPs",
4216            self.orig_loc,
4217            self.buf.as_ptr() as usize,
4218        ))
4219    }
4220    pub fn get_pad(&self) -> Result<&'a [u8], ErrorContext> {
4221        let mut iter = self.clone();
4222        iter.pos = 0;
4223        for attr in iter {
4224            if let Nl80211Attrs::Pad(val) = attr? {
4225                return Ok(val);
4226            }
4227        }
4228        Err(ErrorContext::new_missing(
4229            "Nl80211Attrs",
4230            "Pad",
4231            self.orig_loc,
4232            self.buf.as_ptr() as usize,
4233        ))
4234    }
4235    pub fn get_iftype_ext_capa(&self) -> Result<&'a [u8], ErrorContext> {
4236        let mut iter = self.clone();
4237        iter.pos = 0;
4238        for attr in iter {
4239            if let Nl80211Attrs::IftypeExtCapa(val) = attr? {
4240                return Ok(val);
4241            }
4242        }
4243        Err(ErrorContext::new_missing(
4244            "Nl80211Attrs",
4245            "IftypeExtCapa",
4246            self.orig_loc,
4247            self.buf.as_ptr() as usize,
4248        ))
4249    }
4250    pub fn get_mu_mimo_group_data(&self) -> Result<&'a [u8], ErrorContext> {
4251        let mut iter = self.clone();
4252        iter.pos = 0;
4253        for attr in iter {
4254            if let Nl80211Attrs::MuMimoGroupData(val) = attr? {
4255                return Ok(val);
4256            }
4257        }
4258        Err(ErrorContext::new_missing(
4259            "Nl80211Attrs",
4260            "MuMimoGroupData",
4261            self.orig_loc,
4262            self.buf.as_ptr() as usize,
4263        ))
4264    }
4265    pub fn get_mu_mimo_follow_mac_addr(&self) -> Result<&'a [u8], ErrorContext> {
4266        let mut iter = self.clone();
4267        iter.pos = 0;
4268        for attr in iter {
4269            if let Nl80211Attrs::MuMimoFollowMacAddr(val) = attr? {
4270                return Ok(val);
4271            }
4272        }
4273        Err(ErrorContext::new_missing(
4274            "Nl80211Attrs",
4275            "MuMimoFollowMacAddr",
4276            self.orig_loc,
4277            self.buf.as_ptr() as usize,
4278        ))
4279    }
4280    pub fn get_scan_start_time_tsf(&self) -> Result<u64, ErrorContext> {
4281        let mut iter = self.clone();
4282        iter.pos = 0;
4283        for attr in iter {
4284            if let Nl80211Attrs::ScanStartTimeTsf(val) = attr? {
4285                return Ok(val);
4286            }
4287        }
4288        Err(ErrorContext::new_missing(
4289            "Nl80211Attrs",
4290            "ScanStartTimeTsf",
4291            self.orig_loc,
4292            self.buf.as_ptr() as usize,
4293        ))
4294    }
4295    pub fn get_scan_start_time_tsf_bssid(&self) -> Result<&'a [u8], ErrorContext> {
4296        let mut iter = self.clone();
4297        iter.pos = 0;
4298        for attr in iter {
4299            if let Nl80211Attrs::ScanStartTimeTsfBssid(val) = attr? {
4300                return Ok(val);
4301            }
4302        }
4303        Err(ErrorContext::new_missing(
4304            "Nl80211Attrs",
4305            "ScanStartTimeTsfBssid",
4306            self.orig_loc,
4307            self.buf.as_ptr() as usize,
4308        ))
4309    }
4310    pub fn get_measurement_duration(&self) -> Result<u16, ErrorContext> {
4311        let mut iter = self.clone();
4312        iter.pos = 0;
4313        for attr in iter {
4314            if let Nl80211Attrs::MeasurementDuration(val) = attr? {
4315                return Ok(val);
4316            }
4317        }
4318        Err(ErrorContext::new_missing(
4319            "Nl80211Attrs",
4320            "MeasurementDuration",
4321            self.orig_loc,
4322            self.buf.as_ptr() as usize,
4323        ))
4324    }
4325    pub fn get_measurement_duration_mandatory(&self) -> Result<(), ErrorContext> {
4326        let mut iter = self.clone();
4327        iter.pos = 0;
4328        for attr in iter {
4329            if let Nl80211Attrs::MeasurementDurationMandatory(val) = attr? {
4330                return Ok(val);
4331            }
4332        }
4333        Err(ErrorContext::new_missing(
4334            "Nl80211Attrs",
4335            "MeasurementDurationMandatory",
4336            self.orig_loc,
4337            self.buf.as_ptr() as usize,
4338        ))
4339    }
4340    pub fn get_mesh_peer_aid(&self) -> Result<u16, ErrorContext> {
4341        let mut iter = self.clone();
4342        iter.pos = 0;
4343        for attr in iter {
4344            if let Nl80211Attrs::MeshPeerAid(val) = attr? {
4345                return Ok(val);
4346            }
4347        }
4348        Err(ErrorContext::new_missing(
4349            "Nl80211Attrs",
4350            "MeshPeerAid",
4351            self.orig_loc,
4352            self.buf.as_ptr() as usize,
4353        ))
4354    }
4355    pub fn get_nan_master_pref(&self) -> Result<u8, ErrorContext> {
4356        let mut iter = self.clone();
4357        iter.pos = 0;
4358        for attr in iter {
4359            if let Nl80211Attrs::NanMasterPref(val) = attr? {
4360                return Ok(val);
4361            }
4362        }
4363        Err(ErrorContext::new_missing(
4364            "Nl80211Attrs",
4365            "NanMasterPref",
4366            self.orig_loc,
4367            self.buf.as_ptr() as usize,
4368        ))
4369    }
4370    pub fn get_bands(&self) -> Result<u32, ErrorContext> {
4371        let mut iter = self.clone();
4372        iter.pos = 0;
4373        for attr in iter {
4374            if let Nl80211Attrs::Bands(val) = attr? {
4375                return Ok(val);
4376            }
4377        }
4378        Err(ErrorContext::new_missing(
4379            "Nl80211Attrs",
4380            "Bands",
4381            self.orig_loc,
4382            self.buf.as_ptr() as usize,
4383        ))
4384    }
4385    pub fn get_nan_func(&self) -> Result<&'a [u8], ErrorContext> {
4386        let mut iter = self.clone();
4387        iter.pos = 0;
4388        for attr in iter {
4389            if let Nl80211Attrs::NanFunc(val) = attr? {
4390                return Ok(val);
4391            }
4392        }
4393        Err(ErrorContext::new_missing(
4394            "Nl80211Attrs",
4395            "NanFunc",
4396            self.orig_loc,
4397            self.buf.as_ptr() as usize,
4398        ))
4399    }
4400    pub fn get_nan_match(&self) -> Result<&'a [u8], ErrorContext> {
4401        let mut iter = self.clone();
4402        iter.pos = 0;
4403        for attr in iter {
4404            if let Nl80211Attrs::NanMatch(val) = attr? {
4405                return Ok(val);
4406            }
4407        }
4408        Err(ErrorContext::new_missing(
4409            "Nl80211Attrs",
4410            "NanMatch",
4411            self.orig_loc,
4412            self.buf.as_ptr() as usize,
4413        ))
4414    }
4415    pub fn get_fils_kek(&self) -> Result<&'a [u8], ErrorContext> {
4416        let mut iter = self.clone();
4417        iter.pos = 0;
4418        for attr in iter {
4419            if let Nl80211Attrs::FilsKek(val) = attr? {
4420                return Ok(val);
4421            }
4422        }
4423        Err(ErrorContext::new_missing(
4424            "Nl80211Attrs",
4425            "FilsKek",
4426            self.orig_loc,
4427            self.buf.as_ptr() as usize,
4428        ))
4429    }
4430    pub fn get_fils_nonces(&self) -> Result<&'a [u8], ErrorContext> {
4431        let mut iter = self.clone();
4432        iter.pos = 0;
4433        for attr in iter {
4434            if let Nl80211Attrs::FilsNonces(val) = attr? {
4435                return Ok(val);
4436            }
4437        }
4438        Err(ErrorContext::new_missing(
4439            "Nl80211Attrs",
4440            "FilsNonces",
4441            self.orig_loc,
4442            self.buf.as_ptr() as usize,
4443        ))
4444    }
4445    pub fn get_multicast_to_unicast_enabled(&self) -> Result<(), ErrorContext> {
4446        let mut iter = self.clone();
4447        iter.pos = 0;
4448        for attr in iter {
4449            if let Nl80211Attrs::MulticastToUnicastEnabled(val) = attr? {
4450                return Ok(val);
4451            }
4452        }
4453        Err(ErrorContext::new_missing(
4454            "Nl80211Attrs",
4455            "MulticastToUnicastEnabled",
4456            self.orig_loc,
4457            self.buf.as_ptr() as usize,
4458        ))
4459    }
4460    pub fn get_bssid(&self) -> Result<&'a [u8], ErrorContext> {
4461        let mut iter = self.clone();
4462        iter.pos = 0;
4463        for attr in iter {
4464            if let Nl80211Attrs::Bssid(val) = attr? {
4465                return Ok(val);
4466            }
4467        }
4468        Err(ErrorContext::new_missing(
4469            "Nl80211Attrs",
4470            "Bssid",
4471            self.orig_loc,
4472            self.buf.as_ptr() as usize,
4473        ))
4474    }
4475    pub fn get_sched_scan_relative_rssi(&self) -> Result<i8, ErrorContext> {
4476        let mut iter = self.clone();
4477        iter.pos = 0;
4478        for attr in iter {
4479            if let Nl80211Attrs::SchedScanRelativeRssi(val) = attr? {
4480                return Ok(val);
4481            }
4482        }
4483        Err(ErrorContext::new_missing(
4484            "Nl80211Attrs",
4485            "SchedScanRelativeRssi",
4486            self.orig_loc,
4487            self.buf.as_ptr() as usize,
4488        ))
4489    }
4490    pub fn get_sched_scan_rssi_adjust(&self) -> Result<&'a [u8], ErrorContext> {
4491        let mut iter = self.clone();
4492        iter.pos = 0;
4493        for attr in iter {
4494            if let Nl80211Attrs::SchedScanRssiAdjust(val) = attr? {
4495                return Ok(val);
4496            }
4497        }
4498        Err(ErrorContext::new_missing(
4499            "Nl80211Attrs",
4500            "SchedScanRssiAdjust",
4501            self.orig_loc,
4502            self.buf.as_ptr() as usize,
4503        ))
4504    }
4505    pub fn get_timeout_reason(&self) -> Result<u32, ErrorContext> {
4506        let mut iter = self.clone();
4507        iter.pos = 0;
4508        for attr in iter {
4509            if let Nl80211Attrs::TimeoutReason(val) = attr? {
4510                return Ok(val);
4511            }
4512        }
4513        Err(ErrorContext::new_missing(
4514            "Nl80211Attrs",
4515            "TimeoutReason",
4516            self.orig_loc,
4517            self.buf.as_ptr() as usize,
4518        ))
4519    }
4520    pub fn get_fils_erp_username(&self) -> Result<&'a [u8], ErrorContext> {
4521        let mut iter = self.clone();
4522        iter.pos = 0;
4523        for attr in iter {
4524            if let Nl80211Attrs::FilsErpUsername(val) = attr? {
4525                return Ok(val);
4526            }
4527        }
4528        Err(ErrorContext::new_missing(
4529            "Nl80211Attrs",
4530            "FilsErpUsername",
4531            self.orig_loc,
4532            self.buf.as_ptr() as usize,
4533        ))
4534    }
4535    pub fn get_fils_erp_realm(&self) -> Result<&'a [u8], ErrorContext> {
4536        let mut iter = self.clone();
4537        iter.pos = 0;
4538        for attr in iter {
4539            if let Nl80211Attrs::FilsErpRealm(val) = attr? {
4540                return Ok(val);
4541            }
4542        }
4543        Err(ErrorContext::new_missing(
4544            "Nl80211Attrs",
4545            "FilsErpRealm",
4546            self.orig_loc,
4547            self.buf.as_ptr() as usize,
4548        ))
4549    }
4550    pub fn get_fils_erp_next_seq_num(&self) -> Result<u16, ErrorContext> {
4551        let mut iter = self.clone();
4552        iter.pos = 0;
4553        for attr in iter {
4554            if let Nl80211Attrs::FilsErpNextSeqNum(val) = attr? {
4555                return Ok(val);
4556            }
4557        }
4558        Err(ErrorContext::new_missing(
4559            "Nl80211Attrs",
4560            "FilsErpNextSeqNum",
4561            self.orig_loc,
4562            self.buf.as_ptr() as usize,
4563        ))
4564    }
4565    pub fn get_fils_erp_rrk(&self) -> Result<&'a [u8], ErrorContext> {
4566        let mut iter = self.clone();
4567        iter.pos = 0;
4568        for attr in iter {
4569            if let Nl80211Attrs::FilsErpRrk(val) = attr? {
4570                return Ok(val);
4571            }
4572        }
4573        Err(ErrorContext::new_missing(
4574            "Nl80211Attrs",
4575            "FilsErpRrk",
4576            self.orig_loc,
4577            self.buf.as_ptr() as usize,
4578        ))
4579    }
4580    pub fn get_fils_cache_id(&self) -> Result<&'a [u8], ErrorContext> {
4581        let mut iter = self.clone();
4582        iter.pos = 0;
4583        for attr in iter {
4584            if let Nl80211Attrs::FilsCacheId(val) = attr? {
4585                return Ok(val);
4586            }
4587        }
4588        Err(ErrorContext::new_missing(
4589            "Nl80211Attrs",
4590            "FilsCacheId",
4591            self.orig_loc,
4592            self.buf.as_ptr() as usize,
4593        ))
4594    }
4595    pub fn get_pmk(&self) -> Result<&'a [u8], ErrorContext> {
4596        let mut iter = self.clone();
4597        iter.pos = 0;
4598        for attr in iter {
4599            if let Nl80211Attrs::Pmk(val) = attr? {
4600                return Ok(val);
4601            }
4602        }
4603        Err(ErrorContext::new_missing(
4604            "Nl80211Attrs",
4605            "Pmk",
4606            self.orig_loc,
4607            self.buf.as_ptr() as usize,
4608        ))
4609    }
4610    pub fn get_sched_scan_multi(&self) -> Result<(), ErrorContext> {
4611        let mut iter = self.clone();
4612        iter.pos = 0;
4613        for attr in iter {
4614            if let Nl80211Attrs::SchedScanMulti(val) = attr? {
4615                return Ok(val);
4616            }
4617        }
4618        Err(ErrorContext::new_missing(
4619            "Nl80211Attrs",
4620            "SchedScanMulti",
4621            self.orig_loc,
4622            self.buf.as_ptr() as usize,
4623        ))
4624    }
4625    pub fn get_sched_scan_max_reqs(&self) -> Result<u32, ErrorContext> {
4626        let mut iter = self.clone();
4627        iter.pos = 0;
4628        for attr in iter {
4629            if let Nl80211Attrs::SchedScanMaxReqs(val) = attr? {
4630                return Ok(val);
4631            }
4632        }
4633        Err(ErrorContext::new_missing(
4634            "Nl80211Attrs",
4635            "SchedScanMaxReqs",
4636            self.orig_loc,
4637            self.buf.as_ptr() as usize,
4638        ))
4639    }
4640    pub fn get_want_1x_4way_hs(&self) -> Result<(), ErrorContext> {
4641        let mut iter = self.clone();
4642        iter.pos = 0;
4643        for attr in iter {
4644            if let Nl80211Attrs::Want1x4wayHs(val) = attr? {
4645                return Ok(val);
4646            }
4647        }
4648        Err(ErrorContext::new_missing(
4649            "Nl80211Attrs",
4650            "Want1x4wayHs",
4651            self.orig_loc,
4652            self.buf.as_ptr() as usize,
4653        ))
4654    }
4655    pub fn get_pmkr0_name(&self) -> Result<&'a [u8], ErrorContext> {
4656        let mut iter = self.clone();
4657        iter.pos = 0;
4658        for attr in iter {
4659            if let Nl80211Attrs::Pmkr0Name(val) = attr? {
4660                return Ok(val);
4661            }
4662        }
4663        Err(ErrorContext::new_missing(
4664            "Nl80211Attrs",
4665            "Pmkr0Name",
4666            self.orig_loc,
4667            self.buf.as_ptr() as usize,
4668        ))
4669    }
4670    pub fn get_port_authorized(&self) -> Result<&'a [u8], ErrorContext> {
4671        let mut iter = self.clone();
4672        iter.pos = 0;
4673        for attr in iter {
4674            if let Nl80211Attrs::PortAuthorized(val) = attr? {
4675                return Ok(val);
4676            }
4677        }
4678        Err(ErrorContext::new_missing(
4679            "Nl80211Attrs",
4680            "PortAuthorized",
4681            self.orig_loc,
4682            self.buf.as_ptr() as usize,
4683        ))
4684    }
4685    pub fn get_external_auth_action(&self) -> Result<u32, ErrorContext> {
4686        let mut iter = self.clone();
4687        iter.pos = 0;
4688        for attr in iter {
4689            if let Nl80211Attrs::ExternalAuthAction(val) = attr? {
4690                return Ok(val);
4691            }
4692        }
4693        Err(ErrorContext::new_missing(
4694            "Nl80211Attrs",
4695            "ExternalAuthAction",
4696            self.orig_loc,
4697            self.buf.as_ptr() as usize,
4698        ))
4699    }
4700    pub fn get_external_auth_support(&self) -> Result<(), ErrorContext> {
4701        let mut iter = self.clone();
4702        iter.pos = 0;
4703        for attr in iter {
4704            if let Nl80211Attrs::ExternalAuthSupport(val) = attr? {
4705                return Ok(val);
4706            }
4707        }
4708        Err(ErrorContext::new_missing(
4709            "Nl80211Attrs",
4710            "ExternalAuthSupport",
4711            self.orig_loc,
4712            self.buf.as_ptr() as usize,
4713        ))
4714    }
4715    pub fn get_nss(&self) -> Result<u8, ErrorContext> {
4716        let mut iter = self.clone();
4717        iter.pos = 0;
4718        for attr in iter {
4719            if let Nl80211Attrs::Nss(val) = attr? {
4720                return Ok(val);
4721            }
4722        }
4723        Err(ErrorContext::new_missing(
4724            "Nl80211Attrs",
4725            "Nss",
4726            self.orig_loc,
4727            self.buf.as_ptr() as usize,
4728        ))
4729    }
4730    pub fn get_ack_signal(&self) -> Result<i32, ErrorContext> {
4731        let mut iter = self.clone();
4732        iter.pos = 0;
4733        for attr in iter {
4734            if let Nl80211Attrs::AckSignal(val) = attr? {
4735                return Ok(val);
4736            }
4737        }
4738        Err(ErrorContext::new_missing(
4739            "Nl80211Attrs",
4740            "AckSignal",
4741            self.orig_loc,
4742            self.buf.as_ptr() as usize,
4743        ))
4744    }
4745    pub fn get_control_port_over_nl80211(&self) -> Result<(), ErrorContext> {
4746        let mut iter = self.clone();
4747        iter.pos = 0;
4748        for attr in iter {
4749            if let Nl80211Attrs::ControlPortOverNl80211(val) = attr? {
4750                return Ok(val);
4751            }
4752        }
4753        Err(ErrorContext::new_missing(
4754            "Nl80211Attrs",
4755            "ControlPortOverNl80211",
4756            self.orig_loc,
4757            self.buf.as_ptr() as usize,
4758        ))
4759    }
4760    pub fn get_txq_stats(&self) -> Result<IterableTxqStatsAttrs<'a>, ErrorContext> {
4761        let mut iter = self.clone();
4762        iter.pos = 0;
4763        for attr in iter {
4764            if let Nl80211Attrs::TxqStats(val) = attr? {
4765                return Ok(val);
4766            }
4767        }
4768        Err(ErrorContext::new_missing(
4769            "Nl80211Attrs",
4770            "TxqStats",
4771            self.orig_loc,
4772            self.buf.as_ptr() as usize,
4773        ))
4774    }
4775    pub fn get_txq_limit(&self) -> Result<u32, ErrorContext> {
4776        let mut iter = self.clone();
4777        iter.pos = 0;
4778        for attr in iter {
4779            if let Nl80211Attrs::TxqLimit(val) = attr? {
4780                return Ok(val);
4781            }
4782        }
4783        Err(ErrorContext::new_missing(
4784            "Nl80211Attrs",
4785            "TxqLimit",
4786            self.orig_loc,
4787            self.buf.as_ptr() as usize,
4788        ))
4789    }
4790    pub fn get_txq_memory_limit(&self) -> Result<u32, ErrorContext> {
4791        let mut iter = self.clone();
4792        iter.pos = 0;
4793        for attr in iter {
4794            if let Nl80211Attrs::TxqMemoryLimit(val) = attr? {
4795                return Ok(val);
4796            }
4797        }
4798        Err(ErrorContext::new_missing(
4799            "Nl80211Attrs",
4800            "TxqMemoryLimit",
4801            self.orig_loc,
4802            self.buf.as_ptr() as usize,
4803        ))
4804    }
4805    pub fn get_txq_quantum(&self) -> Result<u32, ErrorContext> {
4806        let mut iter = self.clone();
4807        iter.pos = 0;
4808        for attr in iter {
4809            if let Nl80211Attrs::TxqQuantum(val) = attr? {
4810                return Ok(val);
4811            }
4812        }
4813        Err(ErrorContext::new_missing(
4814            "Nl80211Attrs",
4815            "TxqQuantum",
4816            self.orig_loc,
4817            self.buf.as_ptr() as usize,
4818        ))
4819    }
4820    pub fn get_he_capability(&self) -> Result<&'a [u8], ErrorContext> {
4821        let mut iter = self.clone();
4822        iter.pos = 0;
4823        for attr in iter {
4824            if let Nl80211Attrs::HeCapability(val) = attr? {
4825                return Ok(val);
4826            }
4827        }
4828        Err(ErrorContext::new_missing(
4829            "Nl80211Attrs",
4830            "HeCapability",
4831            self.orig_loc,
4832            self.buf.as_ptr() as usize,
4833        ))
4834    }
4835    pub fn get_ftm_responder(&self) -> Result<&'a [u8], ErrorContext> {
4836        let mut iter = self.clone();
4837        iter.pos = 0;
4838        for attr in iter {
4839            if let Nl80211Attrs::FtmResponder(val) = attr? {
4840                return Ok(val);
4841            }
4842        }
4843        Err(ErrorContext::new_missing(
4844            "Nl80211Attrs",
4845            "FtmResponder",
4846            self.orig_loc,
4847            self.buf.as_ptr() as usize,
4848        ))
4849    }
4850    pub fn get_ftm_responder_stats(&self) -> Result<&'a [u8], ErrorContext> {
4851        let mut iter = self.clone();
4852        iter.pos = 0;
4853        for attr in iter {
4854            if let Nl80211Attrs::FtmResponderStats(val) = attr? {
4855                return Ok(val);
4856            }
4857        }
4858        Err(ErrorContext::new_missing(
4859            "Nl80211Attrs",
4860            "FtmResponderStats",
4861            self.orig_loc,
4862            self.buf.as_ptr() as usize,
4863        ))
4864    }
4865    pub fn get_timeout(&self) -> Result<u32, ErrorContext> {
4866        let mut iter = self.clone();
4867        iter.pos = 0;
4868        for attr in iter {
4869            if let Nl80211Attrs::Timeout(val) = attr? {
4870                return Ok(val);
4871            }
4872        }
4873        Err(ErrorContext::new_missing(
4874            "Nl80211Attrs",
4875            "Timeout",
4876            self.orig_loc,
4877            self.buf.as_ptr() as usize,
4878        ))
4879    }
4880    pub fn get_peer_measurements(&self) -> Result<&'a [u8], ErrorContext> {
4881        let mut iter = self.clone();
4882        iter.pos = 0;
4883        for attr in iter {
4884            if let Nl80211Attrs::PeerMeasurements(val) = attr? {
4885                return Ok(val);
4886            }
4887        }
4888        Err(ErrorContext::new_missing(
4889            "Nl80211Attrs",
4890            "PeerMeasurements",
4891            self.orig_loc,
4892            self.buf.as_ptr() as usize,
4893        ))
4894    }
4895    pub fn get_airtime_weight(&self) -> Result<u16, ErrorContext> {
4896        let mut iter = self.clone();
4897        iter.pos = 0;
4898        for attr in iter {
4899            if let Nl80211Attrs::AirtimeWeight(val) = attr? {
4900                return Ok(val);
4901            }
4902        }
4903        Err(ErrorContext::new_missing(
4904            "Nl80211Attrs",
4905            "AirtimeWeight",
4906            self.orig_loc,
4907            self.buf.as_ptr() as usize,
4908        ))
4909    }
4910    pub fn get_sta_tx_power_setting(&self) -> Result<u8, ErrorContext> {
4911        let mut iter = self.clone();
4912        iter.pos = 0;
4913        for attr in iter {
4914            if let Nl80211Attrs::StaTxPowerSetting(val) = attr? {
4915                return Ok(val);
4916            }
4917        }
4918        Err(ErrorContext::new_missing(
4919            "Nl80211Attrs",
4920            "StaTxPowerSetting",
4921            self.orig_loc,
4922            self.buf.as_ptr() as usize,
4923        ))
4924    }
4925    pub fn get_sta_tx_power(&self) -> Result<i16, ErrorContext> {
4926        let mut iter = self.clone();
4927        iter.pos = 0;
4928        for attr in iter {
4929            if let Nl80211Attrs::StaTxPower(val) = attr? {
4930                return Ok(val);
4931            }
4932        }
4933        Err(ErrorContext::new_missing(
4934            "Nl80211Attrs",
4935            "StaTxPower",
4936            self.orig_loc,
4937            self.buf.as_ptr() as usize,
4938        ))
4939    }
4940    pub fn get_sae_password(&self) -> Result<&'a [u8], ErrorContext> {
4941        let mut iter = self.clone();
4942        iter.pos = 0;
4943        for attr in iter {
4944            if let Nl80211Attrs::SaePassword(val) = attr? {
4945                return Ok(val);
4946            }
4947        }
4948        Err(ErrorContext::new_missing(
4949            "Nl80211Attrs",
4950            "SaePassword",
4951            self.orig_loc,
4952            self.buf.as_ptr() as usize,
4953        ))
4954    }
4955    pub fn get_twt_responder(&self) -> Result<(), ErrorContext> {
4956        let mut iter = self.clone();
4957        iter.pos = 0;
4958        for attr in iter {
4959            if let Nl80211Attrs::TwtResponder(val) = attr? {
4960                return Ok(val);
4961            }
4962        }
4963        Err(ErrorContext::new_missing(
4964            "Nl80211Attrs",
4965            "TwtResponder",
4966            self.orig_loc,
4967            self.buf.as_ptr() as usize,
4968        ))
4969    }
4970    pub fn get_he_obss_pd(&self) -> Result<&'a [u8], ErrorContext> {
4971        let mut iter = self.clone();
4972        iter.pos = 0;
4973        for attr in iter {
4974            if let Nl80211Attrs::HeObssPd(val) = attr? {
4975                return Ok(val);
4976            }
4977        }
4978        Err(ErrorContext::new_missing(
4979            "Nl80211Attrs",
4980            "HeObssPd",
4981            self.orig_loc,
4982            self.buf.as_ptr() as usize,
4983        ))
4984    }
4985    pub fn get_wiphy_edmg_channels(&self) -> Result<u8, ErrorContext> {
4986        let mut iter = self.clone();
4987        iter.pos = 0;
4988        for attr in iter {
4989            if let Nl80211Attrs::WiphyEdmgChannels(val) = attr? {
4990                return Ok(val);
4991            }
4992        }
4993        Err(ErrorContext::new_missing(
4994            "Nl80211Attrs",
4995            "WiphyEdmgChannels",
4996            self.orig_loc,
4997            self.buf.as_ptr() as usize,
4998        ))
4999    }
5000    pub fn get_wiphy_edmg_bw_config(&self) -> Result<u8, ErrorContext> {
5001        let mut iter = self.clone();
5002        iter.pos = 0;
5003        for attr in iter {
5004            if let Nl80211Attrs::WiphyEdmgBwConfig(val) = attr? {
5005                return Ok(val);
5006            }
5007        }
5008        Err(ErrorContext::new_missing(
5009            "Nl80211Attrs",
5010            "WiphyEdmgBwConfig",
5011            self.orig_loc,
5012            self.buf.as_ptr() as usize,
5013        ))
5014    }
5015    pub fn get_vlan_id(&self) -> Result<u16, ErrorContext> {
5016        let mut iter = self.clone();
5017        iter.pos = 0;
5018        for attr in iter {
5019            if let Nl80211Attrs::VlanId(val) = attr? {
5020                return Ok(val);
5021            }
5022        }
5023        Err(ErrorContext::new_missing(
5024            "Nl80211Attrs",
5025            "VlanId",
5026            self.orig_loc,
5027            self.buf.as_ptr() as usize,
5028        ))
5029    }
5030    pub fn get_he_bss_color(&self) -> Result<&'a [u8], ErrorContext> {
5031        let mut iter = self.clone();
5032        iter.pos = 0;
5033        for attr in iter {
5034            if let Nl80211Attrs::HeBssColor(val) = attr? {
5035                return Ok(val);
5036            }
5037        }
5038        Err(ErrorContext::new_missing(
5039            "Nl80211Attrs",
5040            "HeBssColor",
5041            self.orig_loc,
5042            self.buf.as_ptr() as usize,
5043        ))
5044    }
5045    pub fn get_iftype_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
5046        let mut iter = self.clone();
5047        iter.pos = 0;
5048        for attr in iter {
5049            if let Nl80211Attrs::IftypeAkmSuites(val) = attr? {
5050                return Ok(val);
5051            }
5052        }
5053        Err(ErrorContext::new_missing(
5054            "Nl80211Attrs",
5055            "IftypeAkmSuites",
5056            self.orig_loc,
5057            self.buf.as_ptr() as usize,
5058        ))
5059    }
5060    pub fn get_tid_config(&self) -> Result<&'a [u8], ErrorContext> {
5061        let mut iter = self.clone();
5062        iter.pos = 0;
5063        for attr in iter {
5064            if let Nl80211Attrs::TidConfig(val) = attr? {
5065                return Ok(val);
5066            }
5067        }
5068        Err(ErrorContext::new_missing(
5069            "Nl80211Attrs",
5070            "TidConfig",
5071            self.orig_loc,
5072            self.buf.as_ptr() as usize,
5073        ))
5074    }
5075    pub fn get_control_port_no_preauth(&self) -> Result<(), ErrorContext> {
5076        let mut iter = self.clone();
5077        iter.pos = 0;
5078        for attr in iter {
5079            if let Nl80211Attrs::ControlPortNoPreauth(val) = attr? {
5080                return Ok(val);
5081            }
5082        }
5083        Err(ErrorContext::new_missing(
5084            "Nl80211Attrs",
5085            "ControlPortNoPreauth",
5086            self.orig_loc,
5087            self.buf.as_ptr() as usize,
5088        ))
5089    }
5090    pub fn get_pmk_lifetime(&self) -> Result<u32, ErrorContext> {
5091        let mut iter = self.clone();
5092        iter.pos = 0;
5093        for attr in iter {
5094            if let Nl80211Attrs::PmkLifetime(val) = attr? {
5095                return Ok(val);
5096            }
5097        }
5098        Err(ErrorContext::new_missing(
5099            "Nl80211Attrs",
5100            "PmkLifetime",
5101            self.orig_loc,
5102            self.buf.as_ptr() as usize,
5103        ))
5104    }
5105    pub fn get_pmk_reauth_threshold(&self) -> Result<u8, ErrorContext> {
5106        let mut iter = self.clone();
5107        iter.pos = 0;
5108        for attr in iter {
5109            if let Nl80211Attrs::PmkReauthThreshold(val) = attr? {
5110                return Ok(val);
5111            }
5112        }
5113        Err(ErrorContext::new_missing(
5114            "Nl80211Attrs",
5115            "PmkReauthThreshold",
5116            self.orig_loc,
5117            self.buf.as_ptr() as usize,
5118        ))
5119    }
5120    pub fn get_receive_multicast(&self) -> Result<(), ErrorContext> {
5121        let mut iter = self.clone();
5122        iter.pos = 0;
5123        for attr in iter {
5124            if let Nl80211Attrs::ReceiveMulticast(val) = attr? {
5125                return Ok(val);
5126            }
5127        }
5128        Err(ErrorContext::new_missing(
5129            "Nl80211Attrs",
5130            "ReceiveMulticast",
5131            self.orig_loc,
5132            self.buf.as_ptr() as usize,
5133        ))
5134    }
5135    pub fn get_wiphy_freq_offset(&self) -> Result<u32, ErrorContext> {
5136        let mut iter = self.clone();
5137        iter.pos = 0;
5138        for attr in iter {
5139            if let Nl80211Attrs::WiphyFreqOffset(val) = attr? {
5140                return Ok(val);
5141            }
5142        }
5143        Err(ErrorContext::new_missing(
5144            "Nl80211Attrs",
5145            "WiphyFreqOffset",
5146            self.orig_loc,
5147            self.buf.as_ptr() as usize,
5148        ))
5149    }
5150    pub fn get_center_freq1_offset(&self) -> Result<u32, ErrorContext> {
5151        let mut iter = self.clone();
5152        iter.pos = 0;
5153        for attr in iter {
5154            if let Nl80211Attrs::CenterFreq1Offset(val) = attr? {
5155                return Ok(val);
5156            }
5157        }
5158        Err(ErrorContext::new_missing(
5159            "Nl80211Attrs",
5160            "CenterFreq1Offset",
5161            self.orig_loc,
5162            self.buf.as_ptr() as usize,
5163        ))
5164    }
5165    pub fn get_scan_freq_khz(&self) -> Result<&'a [u8], ErrorContext> {
5166        let mut iter = self.clone();
5167        iter.pos = 0;
5168        for attr in iter {
5169            if let Nl80211Attrs::ScanFreqKhz(val) = attr? {
5170                return Ok(val);
5171            }
5172        }
5173        Err(ErrorContext::new_missing(
5174            "Nl80211Attrs",
5175            "ScanFreqKhz",
5176            self.orig_loc,
5177            self.buf.as_ptr() as usize,
5178        ))
5179    }
5180    pub fn get_he_6ghz_capability(&self) -> Result<&'a [u8], ErrorContext> {
5181        let mut iter = self.clone();
5182        iter.pos = 0;
5183        for attr in iter {
5184            if let Nl80211Attrs::He6ghzCapability(val) = attr? {
5185                return Ok(val);
5186            }
5187        }
5188        Err(ErrorContext::new_missing(
5189            "Nl80211Attrs",
5190            "He6ghzCapability",
5191            self.orig_loc,
5192            self.buf.as_ptr() as usize,
5193        ))
5194    }
5195    pub fn get_fils_discovery(&self) -> Result<&'a [u8], ErrorContext> {
5196        let mut iter = self.clone();
5197        iter.pos = 0;
5198        for attr in iter {
5199            if let Nl80211Attrs::FilsDiscovery(val) = attr? {
5200                return Ok(val);
5201            }
5202        }
5203        Err(ErrorContext::new_missing(
5204            "Nl80211Attrs",
5205            "FilsDiscovery",
5206            self.orig_loc,
5207            self.buf.as_ptr() as usize,
5208        ))
5209    }
5210    pub fn get_unsol_bcast_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
5211        let mut iter = self.clone();
5212        iter.pos = 0;
5213        for attr in iter {
5214            if let Nl80211Attrs::UnsolBcastProbeResp(val) = attr? {
5215                return Ok(val);
5216            }
5217        }
5218        Err(ErrorContext::new_missing(
5219            "Nl80211Attrs",
5220            "UnsolBcastProbeResp",
5221            self.orig_loc,
5222            self.buf.as_ptr() as usize,
5223        ))
5224    }
5225    pub fn get_s1g_capability(&self) -> Result<&'a [u8], ErrorContext> {
5226        let mut iter = self.clone();
5227        iter.pos = 0;
5228        for attr in iter {
5229            if let Nl80211Attrs::S1gCapability(val) = attr? {
5230                return Ok(val);
5231            }
5232        }
5233        Err(ErrorContext::new_missing(
5234            "Nl80211Attrs",
5235            "S1gCapability",
5236            self.orig_loc,
5237            self.buf.as_ptr() as usize,
5238        ))
5239    }
5240    pub fn get_s1g_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
5241        let mut iter = self.clone();
5242        iter.pos = 0;
5243        for attr in iter {
5244            if let Nl80211Attrs::S1gCapabilityMask(val) = attr? {
5245                return Ok(val);
5246            }
5247        }
5248        Err(ErrorContext::new_missing(
5249            "Nl80211Attrs",
5250            "S1gCapabilityMask",
5251            self.orig_loc,
5252            self.buf.as_ptr() as usize,
5253        ))
5254    }
5255    pub fn get_sae_pwe(&self) -> Result<u8, ErrorContext> {
5256        let mut iter = self.clone();
5257        iter.pos = 0;
5258        for attr in iter {
5259            if let Nl80211Attrs::SaePwe(val) = attr? {
5260                return Ok(val);
5261            }
5262        }
5263        Err(ErrorContext::new_missing(
5264            "Nl80211Attrs",
5265            "SaePwe",
5266            self.orig_loc,
5267            self.buf.as_ptr() as usize,
5268        ))
5269    }
5270    pub fn get_reconnect_requested(&self) -> Result<&'a [u8], ErrorContext> {
5271        let mut iter = self.clone();
5272        iter.pos = 0;
5273        for attr in iter {
5274            if let Nl80211Attrs::ReconnectRequested(val) = attr? {
5275                return Ok(val);
5276            }
5277        }
5278        Err(ErrorContext::new_missing(
5279            "Nl80211Attrs",
5280            "ReconnectRequested",
5281            self.orig_loc,
5282            self.buf.as_ptr() as usize,
5283        ))
5284    }
5285    pub fn get_sar_spec(&self) -> Result<IterableSarAttributes<'a>, ErrorContext> {
5286        let mut iter = self.clone();
5287        iter.pos = 0;
5288        for attr in iter {
5289            if let Nl80211Attrs::SarSpec(val) = attr? {
5290                return Ok(val);
5291            }
5292        }
5293        Err(ErrorContext::new_missing(
5294            "Nl80211Attrs",
5295            "SarSpec",
5296            self.orig_loc,
5297            self.buf.as_ptr() as usize,
5298        ))
5299    }
5300    pub fn get_disable_he(&self) -> Result<(), ErrorContext> {
5301        let mut iter = self.clone();
5302        iter.pos = 0;
5303        for attr in iter {
5304            if let Nl80211Attrs::DisableHe(val) = attr? {
5305                return Ok(val);
5306            }
5307        }
5308        Err(ErrorContext::new_missing(
5309            "Nl80211Attrs",
5310            "DisableHe",
5311            self.orig_loc,
5312            self.buf.as_ptr() as usize,
5313        ))
5314    }
5315    pub fn get_obss_color_bitmap(&self) -> Result<u64, ErrorContext> {
5316        let mut iter = self.clone();
5317        iter.pos = 0;
5318        for attr in iter {
5319            if let Nl80211Attrs::ObssColorBitmap(val) = attr? {
5320                return Ok(val);
5321            }
5322        }
5323        Err(ErrorContext::new_missing(
5324            "Nl80211Attrs",
5325            "ObssColorBitmap",
5326            self.orig_loc,
5327            self.buf.as_ptr() as usize,
5328        ))
5329    }
5330    pub fn get_color_change_count(&self) -> Result<u8, ErrorContext> {
5331        let mut iter = self.clone();
5332        iter.pos = 0;
5333        for attr in iter {
5334            if let Nl80211Attrs::ColorChangeCount(val) = attr? {
5335                return Ok(val);
5336            }
5337        }
5338        Err(ErrorContext::new_missing(
5339            "Nl80211Attrs",
5340            "ColorChangeCount",
5341            self.orig_loc,
5342            self.buf.as_ptr() as usize,
5343        ))
5344    }
5345    pub fn get_color_change_color(&self) -> Result<u8, ErrorContext> {
5346        let mut iter = self.clone();
5347        iter.pos = 0;
5348        for attr in iter {
5349            if let Nl80211Attrs::ColorChangeColor(val) = attr? {
5350                return Ok(val);
5351            }
5352        }
5353        Err(ErrorContext::new_missing(
5354            "Nl80211Attrs",
5355            "ColorChangeColor",
5356            self.orig_loc,
5357            self.buf.as_ptr() as usize,
5358        ))
5359    }
5360    pub fn get_color_change_elems(&self) -> Result<&'a [u8], ErrorContext> {
5361        let mut iter = self.clone();
5362        iter.pos = 0;
5363        for attr in iter {
5364            if let Nl80211Attrs::ColorChangeElems(val) = attr? {
5365                return Ok(val);
5366            }
5367        }
5368        Err(ErrorContext::new_missing(
5369            "Nl80211Attrs",
5370            "ColorChangeElems",
5371            self.orig_loc,
5372            self.buf.as_ptr() as usize,
5373        ))
5374    }
5375    pub fn get_mbssid_config(&self) -> Result<&'a [u8], ErrorContext> {
5376        let mut iter = self.clone();
5377        iter.pos = 0;
5378        for attr in iter {
5379            if let Nl80211Attrs::MbssidConfig(val) = attr? {
5380                return Ok(val);
5381            }
5382        }
5383        Err(ErrorContext::new_missing(
5384            "Nl80211Attrs",
5385            "MbssidConfig",
5386            self.orig_loc,
5387            self.buf.as_ptr() as usize,
5388        ))
5389    }
5390    pub fn get_mbssid_elems(&self) -> Result<&'a [u8], ErrorContext> {
5391        let mut iter = self.clone();
5392        iter.pos = 0;
5393        for attr in iter {
5394            if let Nl80211Attrs::MbssidElems(val) = attr? {
5395                return Ok(val);
5396            }
5397        }
5398        Err(ErrorContext::new_missing(
5399            "Nl80211Attrs",
5400            "MbssidElems",
5401            self.orig_loc,
5402            self.buf.as_ptr() as usize,
5403        ))
5404    }
5405    pub fn get_radar_background(&self) -> Result<(), ErrorContext> {
5406        let mut iter = self.clone();
5407        iter.pos = 0;
5408        for attr in iter {
5409            if let Nl80211Attrs::RadarBackground(val) = attr? {
5410                return Ok(val);
5411            }
5412        }
5413        Err(ErrorContext::new_missing(
5414            "Nl80211Attrs",
5415            "RadarBackground",
5416            self.orig_loc,
5417            self.buf.as_ptr() as usize,
5418        ))
5419    }
5420    pub fn get_ap_settings_flags(&self) -> Result<u32, ErrorContext> {
5421        let mut iter = self.clone();
5422        iter.pos = 0;
5423        for attr in iter {
5424            if let Nl80211Attrs::ApSettingsFlags(val) = attr? {
5425                return Ok(val);
5426            }
5427        }
5428        Err(ErrorContext::new_missing(
5429            "Nl80211Attrs",
5430            "ApSettingsFlags",
5431            self.orig_loc,
5432            self.buf.as_ptr() as usize,
5433        ))
5434    }
5435    pub fn get_eht_capability(&self) -> Result<&'a [u8], ErrorContext> {
5436        let mut iter = self.clone();
5437        iter.pos = 0;
5438        for attr in iter {
5439            if let Nl80211Attrs::EhtCapability(val) = attr? {
5440                return Ok(val);
5441            }
5442        }
5443        Err(ErrorContext::new_missing(
5444            "Nl80211Attrs",
5445            "EhtCapability",
5446            self.orig_loc,
5447            self.buf.as_ptr() as usize,
5448        ))
5449    }
5450    pub fn get_disable_eht(&self) -> Result<(), ErrorContext> {
5451        let mut iter = self.clone();
5452        iter.pos = 0;
5453        for attr in iter {
5454            if let Nl80211Attrs::DisableEht(val) = attr? {
5455                return Ok(val);
5456            }
5457        }
5458        Err(ErrorContext::new_missing(
5459            "Nl80211Attrs",
5460            "DisableEht",
5461            self.orig_loc,
5462            self.buf.as_ptr() as usize,
5463        ))
5464    }
5465    pub fn get_mlo_links(&self) -> Result<&'a [u8], ErrorContext> {
5466        let mut iter = self.clone();
5467        iter.pos = 0;
5468        for attr in iter {
5469            if let Nl80211Attrs::MloLinks(val) = attr? {
5470                return Ok(val);
5471            }
5472        }
5473        Err(ErrorContext::new_missing(
5474            "Nl80211Attrs",
5475            "MloLinks",
5476            self.orig_loc,
5477            self.buf.as_ptr() as usize,
5478        ))
5479    }
5480    pub fn get_mlo_link_id(&self) -> Result<u8, ErrorContext> {
5481        let mut iter = self.clone();
5482        iter.pos = 0;
5483        for attr in iter {
5484            if let Nl80211Attrs::MloLinkId(val) = attr? {
5485                return Ok(val);
5486            }
5487        }
5488        Err(ErrorContext::new_missing(
5489            "Nl80211Attrs",
5490            "MloLinkId",
5491            self.orig_loc,
5492            self.buf.as_ptr() as usize,
5493        ))
5494    }
5495    pub fn get_mld_addr(&self) -> Result<&'a [u8], ErrorContext> {
5496        let mut iter = self.clone();
5497        iter.pos = 0;
5498        for attr in iter {
5499            if let Nl80211Attrs::MldAddr(val) = attr? {
5500                return Ok(val);
5501            }
5502        }
5503        Err(ErrorContext::new_missing(
5504            "Nl80211Attrs",
5505            "MldAddr",
5506            self.orig_loc,
5507            self.buf.as_ptr() as usize,
5508        ))
5509    }
5510    pub fn get_mlo_support(&self) -> Result<(), ErrorContext> {
5511        let mut iter = self.clone();
5512        iter.pos = 0;
5513        for attr in iter {
5514            if let Nl80211Attrs::MloSupport(val) = attr? {
5515                return Ok(val);
5516            }
5517        }
5518        Err(ErrorContext::new_missing(
5519            "Nl80211Attrs",
5520            "MloSupport",
5521            self.orig_loc,
5522            self.buf.as_ptr() as usize,
5523        ))
5524    }
5525    pub fn get_max_num_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
5526        let mut iter = self.clone();
5527        iter.pos = 0;
5528        for attr in iter {
5529            if let Nl80211Attrs::MaxNumAkmSuites(val) = attr? {
5530                return Ok(val);
5531            }
5532        }
5533        Err(ErrorContext::new_missing(
5534            "Nl80211Attrs",
5535            "MaxNumAkmSuites",
5536            self.orig_loc,
5537            self.buf.as_ptr() as usize,
5538        ))
5539    }
5540    pub fn get_eml_capability(&self) -> Result<u16, ErrorContext> {
5541        let mut iter = self.clone();
5542        iter.pos = 0;
5543        for attr in iter {
5544            if let Nl80211Attrs::EmlCapability(val) = attr? {
5545                return Ok(val);
5546            }
5547        }
5548        Err(ErrorContext::new_missing(
5549            "Nl80211Attrs",
5550            "EmlCapability",
5551            self.orig_loc,
5552            self.buf.as_ptr() as usize,
5553        ))
5554    }
5555    pub fn get_mld_capa_and_ops(&self) -> Result<u16, ErrorContext> {
5556        let mut iter = self.clone();
5557        iter.pos = 0;
5558        for attr in iter {
5559            if let Nl80211Attrs::MldCapaAndOps(val) = attr? {
5560                return Ok(val);
5561            }
5562        }
5563        Err(ErrorContext::new_missing(
5564            "Nl80211Attrs",
5565            "MldCapaAndOps",
5566            self.orig_loc,
5567            self.buf.as_ptr() as usize,
5568        ))
5569    }
5570    pub fn get_tx_hw_timestamp(&self) -> Result<u64, ErrorContext> {
5571        let mut iter = self.clone();
5572        iter.pos = 0;
5573        for attr in iter {
5574            if let Nl80211Attrs::TxHwTimestamp(val) = attr? {
5575                return Ok(val);
5576            }
5577        }
5578        Err(ErrorContext::new_missing(
5579            "Nl80211Attrs",
5580            "TxHwTimestamp",
5581            self.orig_loc,
5582            self.buf.as_ptr() as usize,
5583        ))
5584    }
5585    pub fn get_rx_hw_timestamp(&self) -> Result<u64, ErrorContext> {
5586        let mut iter = self.clone();
5587        iter.pos = 0;
5588        for attr in iter {
5589            if let Nl80211Attrs::RxHwTimestamp(val) = attr? {
5590                return Ok(val);
5591            }
5592        }
5593        Err(ErrorContext::new_missing(
5594            "Nl80211Attrs",
5595            "RxHwTimestamp",
5596            self.orig_loc,
5597            self.buf.as_ptr() as usize,
5598        ))
5599    }
5600    pub fn get_td_bitmap(&self) -> Result<&'a [u8], ErrorContext> {
5601        let mut iter = self.clone();
5602        iter.pos = 0;
5603        for attr in iter {
5604            if let Nl80211Attrs::TdBitmap(val) = attr? {
5605                return Ok(val);
5606            }
5607        }
5608        Err(ErrorContext::new_missing(
5609            "Nl80211Attrs",
5610            "TdBitmap",
5611            self.orig_loc,
5612            self.buf.as_ptr() as usize,
5613        ))
5614    }
5615    pub fn get_punct_bitmap(&self) -> Result<u32, ErrorContext> {
5616        let mut iter = self.clone();
5617        iter.pos = 0;
5618        for attr in iter {
5619            if let Nl80211Attrs::PunctBitmap(val) = attr? {
5620                return Ok(val);
5621            }
5622        }
5623        Err(ErrorContext::new_missing(
5624            "Nl80211Attrs",
5625            "PunctBitmap",
5626            self.orig_loc,
5627            self.buf.as_ptr() as usize,
5628        ))
5629    }
5630    pub fn get_max_hw_timestamp_peers(&self) -> Result<u16, ErrorContext> {
5631        let mut iter = self.clone();
5632        iter.pos = 0;
5633        for attr in iter {
5634            if let Nl80211Attrs::MaxHwTimestampPeers(val) = attr? {
5635                return Ok(val);
5636            }
5637        }
5638        Err(ErrorContext::new_missing(
5639            "Nl80211Attrs",
5640            "MaxHwTimestampPeers",
5641            self.orig_loc,
5642            self.buf.as_ptr() as usize,
5643        ))
5644    }
5645    pub fn get_hw_timestamp_enabled(&self) -> Result<(), ErrorContext> {
5646        let mut iter = self.clone();
5647        iter.pos = 0;
5648        for attr in iter {
5649            if let Nl80211Attrs::HwTimestampEnabled(val) = attr? {
5650                return Ok(val);
5651            }
5652        }
5653        Err(ErrorContext::new_missing(
5654            "Nl80211Attrs",
5655            "HwTimestampEnabled",
5656            self.orig_loc,
5657            self.buf.as_ptr() as usize,
5658        ))
5659    }
5660    pub fn get_ema_rnr_elems(&self) -> Result<&'a [u8], ErrorContext> {
5661        let mut iter = self.clone();
5662        iter.pos = 0;
5663        for attr in iter {
5664            if let Nl80211Attrs::EmaRnrElems(val) = attr? {
5665                return Ok(val);
5666            }
5667        }
5668        Err(ErrorContext::new_missing(
5669            "Nl80211Attrs",
5670            "EmaRnrElems",
5671            self.orig_loc,
5672            self.buf.as_ptr() as usize,
5673        ))
5674    }
5675    pub fn get_mlo_link_disabled(&self) -> Result<(), ErrorContext> {
5676        let mut iter = self.clone();
5677        iter.pos = 0;
5678        for attr in iter {
5679            if let Nl80211Attrs::MloLinkDisabled(val) = attr? {
5680                return Ok(val);
5681            }
5682        }
5683        Err(ErrorContext::new_missing(
5684            "Nl80211Attrs",
5685            "MloLinkDisabled",
5686            self.orig_loc,
5687            self.buf.as_ptr() as usize,
5688        ))
5689    }
5690    pub fn get_bss_dump_include_use_data(&self) -> Result<(), ErrorContext> {
5691        let mut iter = self.clone();
5692        iter.pos = 0;
5693        for attr in iter {
5694            if let Nl80211Attrs::BssDumpIncludeUseData(val) = attr? {
5695                return Ok(val);
5696            }
5697        }
5698        Err(ErrorContext::new_missing(
5699            "Nl80211Attrs",
5700            "BssDumpIncludeUseData",
5701            self.orig_loc,
5702            self.buf.as_ptr() as usize,
5703        ))
5704    }
5705    pub fn get_mlo_ttlm_dlink(&self) -> Result<u16, ErrorContext> {
5706        let mut iter = self.clone();
5707        iter.pos = 0;
5708        for attr in iter {
5709            if let Nl80211Attrs::MloTtlmDlink(val) = attr? {
5710                return Ok(val);
5711            }
5712        }
5713        Err(ErrorContext::new_missing(
5714            "Nl80211Attrs",
5715            "MloTtlmDlink",
5716            self.orig_loc,
5717            self.buf.as_ptr() as usize,
5718        ))
5719    }
5720    pub fn get_mlo_ttlm_ulink(&self) -> Result<u16, ErrorContext> {
5721        let mut iter = self.clone();
5722        iter.pos = 0;
5723        for attr in iter {
5724            if let Nl80211Attrs::MloTtlmUlink(val) = attr? {
5725                return Ok(val);
5726            }
5727        }
5728        Err(ErrorContext::new_missing(
5729            "Nl80211Attrs",
5730            "MloTtlmUlink",
5731            self.orig_loc,
5732            self.buf.as_ptr() as usize,
5733        ))
5734    }
5735    pub fn get_assoc_spp_amsdu(&self) -> Result<(), ErrorContext> {
5736        let mut iter = self.clone();
5737        iter.pos = 0;
5738        for attr in iter {
5739            if let Nl80211Attrs::AssocSppAmsdu(val) = attr? {
5740                return Ok(val);
5741            }
5742        }
5743        Err(ErrorContext::new_missing(
5744            "Nl80211Attrs",
5745            "AssocSppAmsdu",
5746            self.orig_loc,
5747            self.buf.as_ptr() as usize,
5748        ))
5749    }
5750    pub fn get_wiphy_radios(&self) -> Result<&'a [u8], ErrorContext> {
5751        let mut iter = self.clone();
5752        iter.pos = 0;
5753        for attr in iter {
5754            if let Nl80211Attrs::WiphyRadios(val) = attr? {
5755                return Ok(val);
5756            }
5757        }
5758        Err(ErrorContext::new_missing(
5759            "Nl80211Attrs",
5760            "WiphyRadios",
5761            self.orig_loc,
5762            self.buf.as_ptr() as usize,
5763        ))
5764    }
5765    pub fn get_wiphy_interface_combinations(&self) -> Result<&'a [u8], ErrorContext> {
5766        let mut iter = self.clone();
5767        iter.pos = 0;
5768        for attr in iter {
5769            if let Nl80211Attrs::WiphyInterfaceCombinations(val) = attr? {
5770                return Ok(val);
5771            }
5772        }
5773        Err(ErrorContext::new_missing(
5774            "Nl80211Attrs",
5775            "WiphyInterfaceCombinations",
5776            self.orig_loc,
5777            self.buf.as_ptr() as usize,
5778        ))
5779    }
5780    pub fn get_vif_radio_mask(&self) -> Result<u32, ErrorContext> {
5781        let mut iter = self.clone();
5782        iter.pos = 0;
5783        for attr in iter {
5784            if let Nl80211Attrs::VifRadioMask(val) = attr? {
5785                return Ok(val);
5786            }
5787        }
5788        Err(ErrorContext::new_missing(
5789            "Nl80211Attrs",
5790            "VifRadioMask",
5791            self.orig_loc,
5792            self.buf.as_ptr() as usize,
5793        ))
5794    }
5795}
5796#[derive(Clone, Copy, Default)]
5797pub struct IterableArrayU32<'a> {
5798    buf: &'a [u8],
5799    pos: usize,
5800    orig_loc: usize,
5801}
5802impl<'a> IterableArrayU32<'a> {
5803    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
5804        Self {
5805            buf,
5806            pos: 0,
5807            orig_loc,
5808        }
5809    }
5810    pub fn get_buf(&self) -> &'a [u8] {
5811        self.buf
5812    }
5813}
5814impl<'a> Iterator for IterableArrayU32<'a> {
5815    type Item = Result<u32, ErrorContext>;
5816    fn next(&mut self) -> Option<Self::Item> {
5817        if self.buf.len() == self.pos {
5818            return None;
5819        }
5820        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
5821            {
5822                let Some(res) = parse_u32(next) else { break };
5823                return Some(Ok(res));
5824            }
5825        }
5826        Some(Err(ErrorContext::new(
5827            "u32",
5828            None,
5829            self.orig_loc,
5830            self.buf.as_ptr().wrapping_add(self.pos) as usize,
5831        )))
5832    }
5833}
5834impl<'a> IfCombinationAttributes<'a> {
5835    pub fn new_array(buf: &[u8]) -> IterableArrayIfCombinationAttributes<'_> {
5836        IterableArrayIfCombinationAttributes::with_loc(buf, buf.as_ptr() as usize)
5837    }
5838}
5839#[derive(Clone, Copy, Default)]
5840pub struct IterableArrayIfCombinationAttributes<'a> {
5841    buf: &'a [u8],
5842    pos: usize,
5843    orig_loc: usize,
5844}
5845impl<'a> IterableArrayIfCombinationAttributes<'a> {
5846    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
5847        Self {
5848            buf,
5849            pos: 0,
5850            orig_loc,
5851        }
5852    }
5853    pub fn get_buf(&self) -> &'a [u8] {
5854        self.buf
5855    }
5856}
5857impl<'a> Iterator for IterableArrayIfCombinationAttributes<'a> {
5858    type Item = Result<IterableIfCombinationAttributes<'a>, ErrorContext>;
5859    fn next(&mut self) -> Option<Self::Item> {
5860        if self.buf.len() == self.pos {
5861            return None;
5862        }
5863        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
5864            {
5865                return Some(Ok(IterableIfCombinationAttributes::with_loc(
5866                    next,
5867                    self.orig_loc,
5868                )));
5869            }
5870        }
5871        Some(Err(ErrorContext::new(
5872            "IfCombinationAttributes",
5873            None,
5874            self.orig_loc,
5875            self.buf.as_ptr().wrapping_add(self.pos) as usize,
5876        )))
5877    }
5878}
5879impl Nl80211Attrs<'_> {
5880    pub fn new<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
5881        IterableNl80211Attrs::with_loc(buf, buf.as_ptr() as usize)
5882    }
5883    fn attr_from_type(r#type: u16) -> Option<&'static str> {
5884        let res = match r#type {
5885            1u16 => "Wiphy",
5886            2u16 => "WiphyName",
5887            3u16 => "Ifindex",
5888            4u16 => "Ifname",
5889            5u16 => "Iftype",
5890            6u16 => "Mac",
5891            7u16 => "KeyData",
5892            8u16 => "KeyIdx",
5893            9u16 => "KeyCipher",
5894            10u16 => "KeySeq",
5895            11u16 => "KeyDefault",
5896            12u16 => "BeaconInterval",
5897            13u16 => "DtimPeriod",
5898            14u16 => "BeaconHead",
5899            15u16 => "BeaconTail",
5900            16u16 => "StaAid",
5901            17u16 => "StaFlags",
5902            18u16 => "StaListenInterval",
5903            19u16 => "StaSupportedRates",
5904            20u16 => "StaVlan",
5905            21u16 => "StaInfo",
5906            22u16 => "WiphyBands",
5907            23u16 => "MntrFlags",
5908            24u16 => "MeshId",
5909            25u16 => "StaPlinkAction",
5910            26u16 => "MpathNextHop",
5911            27u16 => "MpathInfo",
5912            28u16 => "BssCtsProt",
5913            29u16 => "BssShortPreamble",
5914            30u16 => "BssShortSlotTime",
5915            31u16 => "HtCapability",
5916            32u16 => "SupportedIftypes",
5917            33u16 => "RegAlpha2",
5918            34u16 => "RegRules",
5919            35u16 => "MeshConfig",
5920            36u16 => "BssBasicRates",
5921            37u16 => "WiphyTxqParams",
5922            38u16 => "WiphyFreq",
5923            39u16 => "WiphyChannelType",
5924            40u16 => "KeyDefaultMgmt",
5925            41u16 => "MgmtSubtype",
5926            42u16 => "Ie",
5927            43u16 => "MaxNumScanSsids",
5928            44u16 => "ScanFrequencies",
5929            45u16 => "ScanSsids",
5930            46u16 => "Generation",
5931            47u16 => "Bss",
5932            48u16 => "RegInitiator",
5933            49u16 => "RegType",
5934            50u16 => "SupportedCommands",
5935            51u16 => "Frame",
5936            52u16 => "Ssid",
5937            53u16 => "AuthType",
5938            54u16 => "ReasonCode",
5939            55u16 => "KeyType",
5940            56u16 => "MaxScanIeLen",
5941            57u16 => "CipherSuites",
5942            58u16 => "FreqBefore",
5943            59u16 => "FreqAfter",
5944            60u16 => "FreqFixed",
5945            61u16 => "WiphyRetryShort",
5946            62u16 => "WiphyRetryLong",
5947            63u16 => "WiphyFragThreshold",
5948            64u16 => "WiphyRtsThreshold",
5949            65u16 => "TimedOut",
5950            66u16 => "UseMfp",
5951            67u16 => "StaFlags2",
5952            68u16 => "ControlPort",
5953            69u16 => "Testdata",
5954            70u16 => "Privacy",
5955            71u16 => "DisconnectedByAp",
5956            72u16 => "StatusCode",
5957            73u16 => "CipherSuitesPairwise",
5958            74u16 => "CipherSuiteGroup",
5959            75u16 => "WpaVersions",
5960            76u16 => "AkmSuites",
5961            77u16 => "ReqIe",
5962            78u16 => "RespIe",
5963            79u16 => "PrevBssid",
5964            80u16 => "Key",
5965            81u16 => "Keys",
5966            82u16 => "Pid",
5967            83u16 => "4addr",
5968            84u16 => "SurveyInfo",
5969            85u16 => "Pmkid",
5970            86u16 => "MaxNumPmkids",
5971            87u16 => "Duration",
5972            88u16 => "Cookie",
5973            89u16 => "WiphyCoverageClass",
5974            90u16 => "TxRates",
5975            91u16 => "FrameMatch",
5976            92u16 => "Ack",
5977            93u16 => "PsState",
5978            94u16 => "Cqm",
5979            95u16 => "LocalStateChange",
5980            96u16 => "ApIsolate",
5981            97u16 => "WiphyTxPowerSetting",
5982            98u16 => "WiphyTxPowerLevel",
5983            99u16 => "TxFrameTypes",
5984            100u16 => "RxFrameTypes",
5985            101u16 => "FrameType",
5986            102u16 => "ControlPortEthertype",
5987            103u16 => "ControlPortNoEncrypt",
5988            104u16 => "SupportIbssRsn",
5989            105u16 => "WiphyAntennaTx",
5990            106u16 => "WiphyAntennaRx",
5991            107u16 => "McastRate",
5992            108u16 => "OffchannelTxOk",
5993            109u16 => "BssHtOpmode",
5994            110u16 => "KeyDefaultTypes",
5995            111u16 => "MaxRemainOnChannelDuration",
5996            112u16 => "MeshSetup",
5997            113u16 => "WiphyAntennaAvailTx",
5998            114u16 => "WiphyAntennaAvailRx",
5999            115u16 => "SupportMeshAuth",
6000            116u16 => "StaPlinkState",
6001            117u16 => "WowlanTriggers",
6002            118u16 => "WowlanTriggersSupported",
6003            119u16 => "SchedScanInterval",
6004            120u16 => "InterfaceCombinations",
6005            121u16 => "SoftwareIftypes",
6006            122u16 => "RekeyData",
6007            123u16 => "MaxNumSchedScanSsids",
6008            124u16 => "MaxSchedScanIeLen",
6009            125u16 => "ScanSuppRates",
6010            126u16 => "HiddenSsid",
6011            127u16 => "IeProbeResp",
6012            128u16 => "IeAssocResp",
6013            129u16 => "StaWme",
6014            130u16 => "SupportApUapsd",
6015            131u16 => "RoamSupport",
6016            132u16 => "SchedScanMatch",
6017            133u16 => "MaxMatchSets",
6018            134u16 => "PmksaCandidate",
6019            135u16 => "TxNoCckRate",
6020            136u16 => "TdlsAction",
6021            137u16 => "TdlsDialogToken",
6022            138u16 => "TdlsOperation",
6023            139u16 => "TdlsSupport",
6024            140u16 => "TdlsExternalSetup",
6025            141u16 => "DeviceApSme",
6026            142u16 => "DontWaitForAck",
6027            143u16 => "FeatureFlags",
6028            144u16 => "ProbeRespOffload",
6029            145u16 => "ProbeResp",
6030            146u16 => "DfsRegion",
6031            147u16 => "DisableHt",
6032            148u16 => "HtCapabilityMask",
6033            149u16 => "NoackMap",
6034            150u16 => "InactivityTimeout",
6035            151u16 => "RxSignalDbm",
6036            152u16 => "BgScanPeriod",
6037            153u16 => "Wdev",
6038            154u16 => "UserRegHintType",
6039            155u16 => "ConnFailedReason",
6040            156u16 => "AuthData",
6041            157u16 => "VhtCapability",
6042            158u16 => "ScanFlags",
6043            159u16 => "ChannelWidth",
6044            160u16 => "CenterFreq1",
6045            161u16 => "CenterFreq2",
6046            162u16 => "P2pCtwindow",
6047            163u16 => "P2pOppps",
6048            164u16 => "LocalMeshPowerMode",
6049            165u16 => "AclPolicy",
6050            166u16 => "MacAddrs",
6051            167u16 => "MacAclMax",
6052            168u16 => "RadarEvent",
6053            169u16 => "ExtCapa",
6054            170u16 => "ExtCapaMask",
6055            171u16 => "StaCapability",
6056            172u16 => "StaExtCapability",
6057            173u16 => "ProtocolFeatures",
6058            174u16 => "SplitWiphyDump",
6059            175u16 => "DisableVht",
6060            176u16 => "VhtCapabilityMask",
6061            177u16 => "Mdid",
6062            178u16 => "IeRic",
6063            179u16 => "CritProtId",
6064            180u16 => "MaxCritProtDuration",
6065            181u16 => "PeerAid",
6066            182u16 => "CoalesceRule",
6067            183u16 => "ChSwitchCount",
6068            184u16 => "ChSwitchBlockTx",
6069            185u16 => "CsaIes",
6070            186u16 => "CntdwnOffsBeacon",
6071            187u16 => "CntdwnOffsPresp",
6072            188u16 => "RxmgmtFlags",
6073            189u16 => "StaSupportedChannels",
6074            190u16 => "StaSupportedOperClasses",
6075            191u16 => "HandleDfs",
6076            192u16 => "Support5Mhz",
6077            193u16 => "Support10Mhz",
6078            194u16 => "OpmodeNotif",
6079            195u16 => "VendorId",
6080            196u16 => "VendorSubcmd",
6081            197u16 => "VendorData",
6082            198u16 => "VendorEvents",
6083            199u16 => "QosMap",
6084            200u16 => "MacHint",
6085            201u16 => "WiphyFreqHint",
6086            202u16 => "MaxApAssocSta",
6087            203u16 => "TdlsPeerCapability",
6088            204u16 => "SocketOwner",
6089            205u16 => "CsaCOffsetsTx",
6090            206u16 => "MaxCsaCounters",
6091            207u16 => "TdlsInitiator",
6092            208u16 => "UseRrm",
6093            209u16 => "WiphyDynAck",
6094            210u16 => "Tsid",
6095            211u16 => "UserPrio",
6096            212u16 => "AdmittedTime",
6097            213u16 => "SmpsMode",
6098            214u16 => "OperClass",
6099            215u16 => "MacMask",
6100            216u16 => "WiphySelfManagedReg",
6101            217u16 => "ExtFeatures",
6102            218u16 => "SurveyRadioStats",
6103            219u16 => "NetnsFd",
6104            220u16 => "SchedScanDelay",
6105            221u16 => "RegIndoor",
6106            222u16 => "MaxNumSchedScanPlans",
6107            223u16 => "MaxScanPlanInterval",
6108            224u16 => "MaxScanPlanIterations",
6109            225u16 => "SchedScanPlans",
6110            226u16 => "Pbss",
6111            227u16 => "BssSelect",
6112            228u16 => "StaSupportP2pPs",
6113            229u16 => "Pad",
6114            230u16 => "IftypeExtCapa",
6115            231u16 => "MuMimoGroupData",
6116            232u16 => "MuMimoFollowMacAddr",
6117            233u16 => "ScanStartTimeTsf",
6118            234u16 => "ScanStartTimeTsfBssid",
6119            235u16 => "MeasurementDuration",
6120            236u16 => "MeasurementDurationMandatory",
6121            237u16 => "MeshPeerAid",
6122            238u16 => "NanMasterPref",
6123            239u16 => "Bands",
6124            240u16 => "NanFunc",
6125            241u16 => "NanMatch",
6126            242u16 => "FilsKek",
6127            243u16 => "FilsNonces",
6128            244u16 => "MulticastToUnicastEnabled",
6129            245u16 => "Bssid",
6130            246u16 => "SchedScanRelativeRssi",
6131            247u16 => "SchedScanRssiAdjust",
6132            248u16 => "TimeoutReason",
6133            249u16 => "FilsErpUsername",
6134            250u16 => "FilsErpRealm",
6135            251u16 => "FilsErpNextSeqNum",
6136            252u16 => "FilsErpRrk",
6137            253u16 => "FilsCacheId",
6138            254u16 => "Pmk",
6139            255u16 => "SchedScanMulti",
6140            256u16 => "SchedScanMaxReqs",
6141            257u16 => "Want1x4wayHs",
6142            258u16 => "Pmkr0Name",
6143            259u16 => "PortAuthorized",
6144            260u16 => "ExternalAuthAction",
6145            261u16 => "ExternalAuthSupport",
6146            262u16 => "Nss",
6147            263u16 => "AckSignal",
6148            264u16 => "ControlPortOverNl80211",
6149            265u16 => "TxqStats",
6150            266u16 => "TxqLimit",
6151            267u16 => "TxqMemoryLimit",
6152            268u16 => "TxqQuantum",
6153            269u16 => "HeCapability",
6154            270u16 => "FtmResponder",
6155            271u16 => "FtmResponderStats",
6156            272u16 => "Timeout",
6157            273u16 => "PeerMeasurements",
6158            274u16 => "AirtimeWeight",
6159            275u16 => "StaTxPowerSetting",
6160            276u16 => "StaTxPower",
6161            277u16 => "SaePassword",
6162            278u16 => "TwtResponder",
6163            279u16 => "HeObssPd",
6164            280u16 => "WiphyEdmgChannels",
6165            281u16 => "WiphyEdmgBwConfig",
6166            282u16 => "VlanId",
6167            283u16 => "HeBssColor",
6168            284u16 => "IftypeAkmSuites",
6169            285u16 => "TidConfig",
6170            286u16 => "ControlPortNoPreauth",
6171            287u16 => "PmkLifetime",
6172            288u16 => "PmkReauthThreshold",
6173            289u16 => "ReceiveMulticast",
6174            290u16 => "WiphyFreqOffset",
6175            291u16 => "CenterFreq1Offset",
6176            292u16 => "ScanFreqKhz",
6177            293u16 => "He6ghzCapability",
6178            294u16 => "FilsDiscovery",
6179            295u16 => "UnsolBcastProbeResp",
6180            296u16 => "S1gCapability",
6181            297u16 => "S1gCapabilityMask",
6182            298u16 => "SaePwe",
6183            299u16 => "ReconnectRequested",
6184            300u16 => "SarSpec",
6185            301u16 => "DisableHe",
6186            302u16 => "ObssColorBitmap",
6187            303u16 => "ColorChangeCount",
6188            304u16 => "ColorChangeColor",
6189            305u16 => "ColorChangeElems",
6190            306u16 => "MbssidConfig",
6191            307u16 => "MbssidElems",
6192            308u16 => "RadarBackground",
6193            309u16 => "ApSettingsFlags",
6194            310u16 => "EhtCapability",
6195            311u16 => "DisableEht",
6196            312u16 => "MloLinks",
6197            313u16 => "MloLinkId",
6198            314u16 => "MldAddr",
6199            315u16 => "MloSupport",
6200            316u16 => "MaxNumAkmSuites",
6201            317u16 => "EmlCapability",
6202            318u16 => "MldCapaAndOps",
6203            319u16 => "TxHwTimestamp",
6204            320u16 => "RxHwTimestamp",
6205            321u16 => "TdBitmap",
6206            322u16 => "PunctBitmap",
6207            323u16 => "MaxHwTimestampPeers",
6208            324u16 => "HwTimestampEnabled",
6209            325u16 => "EmaRnrElems",
6210            326u16 => "MloLinkDisabled",
6211            327u16 => "BssDumpIncludeUseData",
6212            328u16 => "MloTtlmDlink",
6213            329u16 => "MloTtlmUlink",
6214            330u16 => "AssocSppAmsdu",
6215            331u16 => "WiphyRadios",
6216            332u16 => "WiphyInterfaceCombinations",
6217            333u16 => "VifRadioMask",
6218            _ => return None,
6219        };
6220        Some(res)
6221    }
6222}
6223#[derive(Clone, Copy, Default)]
6224pub struct IterableNl80211Attrs<'a> {
6225    buf: &'a [u8],
6226    pos: usize,
6227    orig_loc: usize,
6228}
6229impl<'a> IterableNl80211Attrs<'a> {
6230    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
6231        Self {
6232            buf,
6233            pos: 0,
6234            orig_loc,
6235        }
6236    }
6237    pub fn get_buf(&self) -> &'a [u8] {
6238        self.buf
6239    }
6240}
6241impl<'a> Iterator for IterableNl80211Attrs<'a> {
6242    type Item = Result<Nl80211Attrs<'a>, ErrorContext>;
6243    fn next(&mut self) -> Option<Self::Item> {
6244        let pos = self.pos;
6245        let mut r#type;
6246        loop {
6247            r#type = None;
6248            if self.buf.len() == self.pos {
6249                return None;
6250            }
6251            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
6252                break;
6253            };
6254            r#type = Some(header.r#type);
6255            let res = match header.r#type {
6256                1u16 => Nl80211Attrs::Wiphy({
6257                    let res = parse_u32(next);
6258                    let Some(val) = res else { break };
6259                    val
6260                }),
6261                2u16 => Nl80211Attrs::WiphyName({
6262                    let res = CStr::from_bytes_with_nul(next).ok();
6263                    let Some(val) = res else { break };
6264                    val
6265                }),
6266                3u16 => Nl80211Attrs::Ifindex({
6267                    let res = parse_u32(next);
6268                    let Some(val) = res else { break };
6269                    val
6270                }),
6271                4u16 => Nl80211Attrs::Ifname({
6272                    let res = CStr::from_bytes_with_nul(next).ok();
6273                    let Some(val) = res else { break };
6274                    val
6275                }),
6276                5u16 => Nl80211Attrs::Iftype({
6277                    let res = parse_u32(next);
6278                    let Some(val) = res else { break };
6279                    val
6280                }),
6281                6u16 => Nl80211Attrs::Mac({
6282                    let res = Some(next);
6283                    let Some(val) = res else { break };
6284                    val
6285                }),
6286                7u16 => Nl80211Attrs::KeyData({
6287                    let res = Some(next);
6288                    let Some(val) = res else { break };
6289                    val
6290                }),
6291                8u16 => Nl80211Attrs::KeyIdx({
6292                    let res = parse_u8(next);
6293                    let Some(val) = res else { break };
6294                    val
6295                }),
6296                9u16 => Nl80211Attrs::KeyCipher({
6297                    let res = parse_u32(next);
6298                    let Some(val) = res else { break };
6299                    val
6300                }),
6301                10u16 => Nl80211Attrs::KeySeq({
6302                    let res = Some(next);
6303                    let Some(val) = res else { break };
6304                    val
6305                }),
6306                11u16 => Nl80211Attrs::KeyDefault(()),
6307                12u16 => Nl80211Attrs::BeaconInterval({
6308                    let res = parse_u32(next);
6309                    let Some(val) = res else { break };
6310                    val
6311                }),
6312                13u16 => Nl80211Attrs::DtimPeriod({
6313                    let res = parse_u32(next);
6314                    let Some(val) = res else { break };
6315                    val
6316                }),
6317                14u16 => Nl80211Attrs::BeaconHead({
6318                    let res = Some(next);
6319                    let Some(val) = res else { break };
6320                    val
6321                }),
6322                15u16 => Nl80211Attrs::BeaconTail({
6323                    let res = Some(next);
6324                    let Some(val) = res else { break };
6325                    val
6326                }),
6327                16u16 => Nl80211Attrs::StaAid({
6328                    let res = parse_u16(next);
6329                    let Some(val) = res else { break };
6330                    val
6331                }),
6332                17u16 => Nl80211Attrs::StaFlags({
6333                    let res = Some(next);
6334                    let Some(val) = res else { break };
6335                    val
6336                }),
6337                18u16 => Nl80211Attrs::StaListenInterval({
6338                    let res = parse_u16(next);
6339                    let Some(val) = res else { break };
6340                    val
6341                }),
6342                19u16 => Nl80211Attrs::StaSupportedRates({
6343                    let res = Some(next);
6344                    let Some(val) = res else { break };
6345                    val
6346                }),
6347                20u16 => Nl80211Attrs::StaVlan({
6348                    let res = parse_u32(next);
6349                    let Some(val) = res else { break };
6350                    val
6351                }),
6352                21u16 => Nl80211Attrs::StaInfo({
6353                    let res = Some(next);
6354                    let Some(val) = res else { break };
6355                    val
6356                }),
6357                22u16 => Nl80211Attrs::WiphyBands({
6358                    let res = Some(IterableWiphyBands::with_loc(next, self.orig_loc));
6359                    let Some(val) = res else { break };
6360                    val
6361                }),
6362                23u16 => Nl80211Attrs::MntrFlags({
6363                    let res = Some(next);
6364                    let Some(val) = res else { break };
6365                    val
6366                }),
6367                24u16 => Nl80211Attrs::MeshId({
6368                    let res = Some(next);
6369                    let Some(val) = res else { break };
6370                    val
6371                }),
6372                25u16 => Nl80211Attrs::StaPlinkAction({
6373                    let res = parse_u8(next);
6374                    let Some(val) = res else { break };
6375                    val
6376                }),
6377                26u16 => Nl80211Attrs::MpathNextHop({
6378                    let res = Some(next);
6379                    let Some(val) = res else { break };
6380                    val
6381                }),
6382                27u16 => Nl80211Attrs::MpathInfo({
6383                    let res = Some(next);
6384                    let Some(val) = res else { break };
6385                    val
6386                }),
6387                28u16 => Nl80211Attrs::BssCtsProt({
6388                    let res = parse_u8(next);
6389                    let Some(val) = res else { break };
6390                    val
6391                }),
6392                29u16 => Nl80211Attrs::BssShortPreamble({
6393                    let res = parse_u8(next);
6394                    let Some(val) = res else { break };
6395                    val
6396                }),
6397                30u16 => Nl80211Attrs::BssShortSlotTime({
6398                    let res = parse_u8(next);
6399                    let Some(val) = res else { break };
6400                    val
6401                }),
6402                31u16 => Nl80211Attrs::HtCapability({
6403                    let res = Some(next);
6404                    let Some(val) = res else { break };
6405                    val
6406                }),
6407                32u16 => Nl80211Attrs::SupportedIftypes({
6408                    let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
6409                    let Some(val) = res else { break };
6410                    val
6411                }),
6412                33u16 => Nl80211Attrs::RegAlpha2({
6413                    let res = Some(next);
6414                    let Some(val) = res else { break };
6415                    val
6416                }),
6417                34u16 => Nl80211Attrs::RegRules({
6418                    let res = Some(next);
6419                    let Some(val) = res else { break };
6420                    val
6421                }),
6422                35u16 => Nl80211Attrs::MeshConfig({
6423                    let res = Some(next);
6424                    let Some(val) = res else { break };
6425                    val
6426                }),
6427                36u16 => Nl80211Attrs::BssBasicRates({
6428                    let res = Some(next);
6429                    let Some(val) = res else { break };
6430                    val
6431                }),
6432                37u16 => Nl80211Attrs::WiphyTxqParams({
6433                    let res = Some(next);
6434                    let Some(val) = res else { break };
6435                    val
6436                }),
6437                38u16 => Nl80211Attrs::WiphyFreq({
6438                    let res = parse_u32(next);
6439                    let Some(val) = res else { break };
6440                    val
6441                }),
6442                39u16 => Nl80211Attrs::WiphyChannelType({
6443                    let res = parse_u32(next);
6444                    let Some(val) = res else { break };
6445                    val
6446                }),
6447                40u16 => Nl80211Attrs::KeyDefaultMgmt(()),
6448                41u16 => Nl80211Attrs::MgmtSubtype({
6449                    let res = parse_u8(next);
6450                    let Some(val) = res else { break };
6451                    val
6452                }),
6453                42u16 => Nl80211Attrs::Ie({
6454                    let res = Some(next);
6455                    let Some(val) = res else { break };
6456                    val
6457                }),
6458                43u16 => Nl80211Attrs::MaxNumScanSsids({
6459                    let res = parse_u8(next);
6460                    let Some(val) = res else { break };
6461                    val
6462                }),
6463                44u16 => Nl80211Attrs::ScanFrequencies({
6464                    let res = Some(next);
6465                    let Some(val) = res else { break };
6466                    val
6467                }),
6468                45u16 => Nl80211Attrs::ScanSsids({
6469                    let res = Some(next);
6470                    let Some(val) = res else { break };
6471                    val
6472                }),
6473                46u16 => Nl80211Attrs::Generation({
6474                    let res = parse_u32(next);
6475                    let Some(val) = res else { break };
6476                    val
6477                }),
6478                47u16 => Nl80211Attrs::Bss({
6479                    let res = Some(next);
6480                    let Some(val) = res else { break };
6481                    val
6482                }),
6483                48u16 => Nl80211Attrs::RegInitiator({
6484                    let res = parse_u8(next);
6485                    let Some(val) = res else { break };
6486                    val
6487                }),
6488                49u16 => Nl80211Attrs::RegType({
6489                    let res = parse_u8(next);
6490                    let Some(val) = res else { break };
6491                    val
6492                }),
6493                50u16 => Nl80211Attrs::SupportedCommands({
6494                    let res = Some(IterableArrayU32::with_loc(next, self.orig_loc));
6495                    let Some(val) = res else { break };
6496                    val
6497                }),
6498                51u16 => Nl80211Attrs::Frame({
6499                    let res = Some(next);
6500                    let Some(val) = res else { break };
6501                    val
6502                }),
6503                52u16 => Nl80211Attrs::Ssid({
6504                    let res = Some(next);
6505                    let Some(val) = res else { break };
6506                    val
6507                }),
6508                53u16 => Nl80211Attrs::AuthType({
6509                    let res = parse_u32(next);
6510                    let Some(val) = res else { break };
6511                    val
6512                }),
6513                54u16 => Nl80211Attrs::ReasonCode({
6514                    let res = parse_u16(next);
6515                    let Some(val) = res else { break };
6516                    val
6517                }),
6518                55u16 => Nl80211Attrs::KeyType({
6519                    let res = parse_u32(next);
6520                    let Some(val) = res else { break };
6521                    val
6522                }),
6523                56u16 => Nl80211Attrs::MaxScanIeLen({
6524                    let res = parse_u16(next);
6525                    let Some(val) = res else { break };
6526                    val
6527                }),
6528                57u16 => Nl80211Attrs::CipherSuites({
6529                    let res = Some(next);
6530                    let Some(val) = res else { break };
6531                    val
6532                }),
6533                58u16 => Nl80211Attrs::FreqBefore({
6534                    let res = Some(next);
6535                    let Some(val) = res else { break };
6536                    val
6537                }),
6538                59u16 => Nl80211Attrs::FreqAfter({
6539                    let res = Some(next);
6540                    let Some(val) = res else { break };
6541                    val
6542                }),
6543                60u16 => Nl80211Attrs::FreqFixed(()),
6544                61u16 => Nl80211Attrs::WiphyRetryShort({
6545                    let res = parse_u8(next);
6546                    let Some(val) = res else { break };
6547                    val
6548                }),
6549                62u16 => Nl80211Attrs::WiphyRetryLong({
6550                    let res = parse_u8(next);
6551                    let Some(val) = res else { break };
6552                    val
6553                }),
6554                63u16 => Nl80211Attrs::WiphyFragThreshold({
6555                    let res = parse_u32(next);
6556                    let Some(val) = res else { break };
6557                    val
6558                }),
6559                64u16 => Nl80211Attrs::WiphyRtsThreshold({
6560                    let res = parse_u32(next);
6561                    let Some(val) = res else { break };
6562                    val
6563                }),
6564                65u16 => Nl80211Attrs::TimedOut(()),
6565                66u16 => Nl80211Attrs::UseMfp({
6566                    let res = parse_u32(next);
6567                    let Some(val) = res else { break };
6568                    val
6569                }),
6570                67u16 => Nl80211Attrs::StaFlags2({
6571                    let res = PushStaFlagUpdate::new_from_slice(next);
6572                    let Some(val) = res else { break };
6573                    val
6574                }),
6575                68u16 => Nl80211Attrs::ControlPort(()),
6576                69u16 => Nl80211Attrs::Testdata({
6577                    let res = Some(next);
6578                    let Some(val) = res else { break };
6579                    val
6580                }),
6581                70u16 => Nl80211Attrs::Privacy(()),
6582                71u16 => Nl80211Attrs::DisconnectedByAp(()),
6583                72u16 => Nl80211Attrs::StatusCode({
6584                    let res = parse_u16(next);
6585                    let Some(val) = res else { break };
6586                    val
6587                }),
6588                73u16 => Nl80211Attrs::CipherSuitesPairwise({
6589                    let res = Some(next);
6590                    let Some(val) = res else { break };
6591                    val
6592                }),
6593                74u16 => Nl80211Attrs::CipherSuiteGroup({
6594                    let res = parse_u32(next);
6595                    let Some(val) = res else { break };
6596                    val
6597                }),
6598                75u16 => Nl80211Attrs::WpaVersions({
6599                    let res = parse_u32(next);
6600                    let Some(val) = res else { break };
6601                    val
6602                }),
6603                76u16 => Nl80211Attrs::AkmSuites({
6604                    let res = Some(next);
6605                    let Some(val) = res else { break };
6606                    val
6607                }),
6608                77u16 => Nl80211Attrs::ReqIe({
6609                    let res = Some(next);
6610                    let Some(val) = res else { break };
6611                    val
6612                }),
6613                78u16 => Nl80211Attrs::RespIe({
6614                    let res = Some(next);
6615                    let Some(val) = res else { break };
6616                    val
6617                }),
6618                79u16 => Nl80211Attrs::PrevBssid({
6619                    let res = Some(next);
6620                    let Some(val) = res else { break };
6621                    val
6622                }),
6623                80u16 => Nl80211Attrs::Key({
6624                    let res = Some(next);
6625                    let Some(val) = res else { break };
6626                    val
6627                }),
6628                81u16 => Nl80211Attrs::Keys({
6629                    let res = Some(next);
6630                    let Some(val) = res else { break };
6631                    val
6632                }),
6633                82u16 => Nl80211Attrs::Pid({
6634                    let res = parse_u32(next);
6635                    let Some(val) = res else { break };
6636                    val
6637                }),
6638                83u16 => Nl80211Attrs::_4addr({
6639                    let res = parse_u8(next);
6640                    let Some(val) = res else { break };
6641                    val
6642                }),
6643                84u16 => Nl80211Attrs::SurveyInfo({
6644                    let res = Some(next);
6645                    let Some(val) = res else { break };
6646                    val
6647                }),
6648                85u16 => Nl80211Attrs::Pmkid({
6649                    let res = Some(next);
6650                    let Some(val) = res else { break };
6651                    val
6652                }),
6653                86u16 => Nl80211Attrs::MaxNumPmkids({
6654                    let res = parse_u8(next);
6655                    let Some(val) = res else { break };
6656                    val
6657                }),
6658                87u16 => Nl80211Attrs::Duration({
6659                    let res = parse_u32(next);
6660                    let Some(val) = res else { break };
6661                    val
6662                }),
6663                88u16 => Nl80211Attrs::Cookie({
6664                    let res = parse_u64(next);
6665                    let Some(val) = res else { break };
6666                    val
6667                }),
6668                89u16 => Nl80211Attrs::WiphyCoverageClass({
6669                    let res = parse_u8(next);
6670                    let Some(val) = res else { break };
6671                    val
6672                }),
6673                90u16 => Nl80211Attrs::TxRates({
6674                    let res = Some(next);
6675                    let Some(val) = res else { break };
6676                    val
6677                }),
6678                91u16 => Nl80211Attrs::FrameMatch({
6679                    let res = Some(next);
6680                    let Some(val) = res else { break };
6681                    val
6682                }),
6683                92u16 => Nl80211Attrs::Ack(()),
6684                93u16 => Nl80211Attrs::PsState({
6685                    let res = parse_u32(next);
6686                    let Some(val) = res else { break };
6687                    val
6688                }),
6689                94u16 => Nl80211Attrs::Cqm({
6690                    let res = Some(next);
6691                    let Some(val) = res else { break };
6692                    val
6693                }),
6694                95u16 => Nl80211Attrs::LocalStateChange(()),
6695                96u16 => Nl80211Attrs::ApIsolate({
6696                    let res = parse_u8(next);
6697                    let Some(val) = res else { break };
6698                    val
6699                }),
6700                97u16 => Nl80211Attrs::WiphyTxPowerSetting({
6701                    let res = parse_u32(next);
6702                    let Some(val) = res else { break };
6703                    val
6704                }),
6705                98u16 => Nl80211Attrs::WiphyTxPowerLevel({
6706                    let res = parse_u32(next);
6707                    let Some(val) = res else { break };
6708                    val
6709                }),
6710                99u16 => Nl80211Attrs::TxFrameTypes({
6711                    let res = Some(IterableIftypeAttrs::with_loc(next, self.orig_loc));
6712                    let Some(val) = res else { break };
6713                    val
6714                }),
6715                100u16 => Nl80211Attrs::RxFrameTypes({
6716                    let res = Some(IterableIftypeAttrs::with_loc(next, self.orig_loc));
6717                    let Some(val) = res else { break };
6718                    val
6719                }),
6720                101u16 => Nl80211Attrs::FrameType({
6721                    let res = parse_u16(next);
6722                    let Some(val) = res else { break };
6723                    val
6724                }),
6725                102u16 => Nl80211Attrs::ControlPortEthertype(()),
6726                103u16 => Nl80211Attrs::ControlPortNoEncrypt(()),
6727                104u16 => Nl80211Attrs::SupportIbssRsn(()),
6728                105u16 => Nl80211Attrs::WiphyAntennaTx({
6729                    let res = parse_u32(next);
6730                    let Some(val) = res else { break };
6731                    val
6732                }),
6733                106u16 => Nl80211Attrs::WiphyAntennaRx({
6734                    let res = parse_u32(next);
6735                    let Some(val) = res else { break };
6736                    val
6737                }),
6738                107u16 => Nl80211Attrs::McastRate({
6739                    let res = parse_u32(next);
6740                    let Some(val) = res else { break };
6741                    val
6742                }),
6743                108u16 => Nl80211Attrs::OffchannelTxOk(()),
6744                109u16 => Nl80211Attrs::BssHtOpmode({
6745                    let res = parse_u16(next);
6746                    let Some(val) = res else { break };
6747                    val
6748                }),
6749                110u16 => Nl80211Attrs::KeyDefaultTypes({
6750                    let res = Some(next);
6751                    let Some(val) = res else { break };
6752                    val
6753                }),
6754                111u16 => Nl80211Attrs::MaxRemainOnChannelDuration({
6755                    let res = parse_u32(next);
6756                    let Some(val) = res else { break };
6757                    val
6758                }),
6759                112u16 => Nl80211Attrs::MeshSetup({
6760                    let res = Some(next);
6761                    let Some(val) = res else { break };
6762                    val
6763                }),
6764                113u16 => Nl80211Attrs::WiphyAntennaAvailTx({
6765                    let res = parse_u32(next);
6766                    let Some(val) = res else { break };
6767                    val
6768                }),
6769                114u16 => Nl80211Attrs::WiphyAntennaAvailRx({
6770                    let res = parse_u32(next);
6771                    let Some(val) = res else { break };
6772                    val
6773                }),
6774                115u16 => Nl80211Attrs::SupportMeshAuth(()),
6775                116u16 => Nl80211Attrs::StaPlinkState({
6776                    let res = parse_u8(next);
6777                    let Some(val) = res else { break };
6778                    val
6779                }),
6780                117u16 => Nl80211Attrs::WowlanTriggers({
6781                    let res = Some(next);
6782                    let Some(val) = res else { break };
6783                    val
6784                }),
6785                118u16 => Nl80211Attrs::WowlanTriggersSupported({
6786                    let res = Some(IterableWowlanTriggersAttrs::with_loc(next, self.orig_loc));
6787                    let Some(val) = res else { break };
6788                    val
6789                }),
6790                119u16 => Nl80211Attrs::SchedScanInterval({
6791                    let res = parse_u32(next);
6792                    let Some(val) = res else { break };
6793                    val
6794                }),
6795                120u16 => Nl80211Attrs::InterfaceCombinations({
6796                    let res = Some(IterableArrayIfCombinationAttributes::with_loc(
6797                        next,
6798                        self.orig_loc,
6799                    ));
6800                    let Some(val) = res else { break };
6801                    val
6802                }),
6803                121u16 => Nl80211Attrs::SoftwareIftypes({
6804                    let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
6805                    let Some(val) = res else { break };
6806                    val
6807                }),
6808                122u16 => Nl80211Attrs::RekeyData({
6809                    let res = Some(next);
6810                    let Some(val) = res else { break };
6811                    val
6812                }),
6813                123u16 => Nl80211Attrs::MaxNumSchedScanSsids({
6814                    let res = parse_u8(next);
6815                    let Some(val) = res else { break };
6816                    val
6817                }),
6818                124u16 => Nl80211Attrs::MaxSchedScanIeLen({
6819                    let res = parse_u16(next);
6820                    let Some(val) = res else { break };
6821                    val
6822                }),
6823                125u16 => Nl80211Attrs::ScanSuppRates({
6824                    let res = Some(next);
6825                    let Some(val) = res else { break };
6826                    val
6827                }),
6828                126u16 => Nl80211Attrs::HiddenSsid({
6829                    let res = parse_u32(next);
6830                    let Some(val) = res else { break };
6831                    val
6832                }),
6833                127u16 => Nl80211Attrs::IeProbeResp({
6834                    let res = Some(next);
6835                    let Some(val) = res else { break };
6836                    val
6837                }),
6838                128u16 => Nl80211Attrs::IeAssocResp({
6839                    let res = Some(next);
6840                    let Some(val) = res else { break };
6841                    val
6842                }),
6843                129u16 => Nl80211Attrs::StaWme({
6844                    let res = Some(next);
6845                    let Some(val) = res else { break };
6846                    val
6847                }),
6848                130u16 => Nl80211Attrs::SupportApUapsd(()),
6849                131u16 => Nl80211Attrs::RoamSupport(()),
6850                132u16 => Nl80211Attrs::SchedScanMatch({
6851                    let res = Some(next);
6852                    let Some(val) = res else { break };
6853                    val
6854                }),
6855                133u16 => Nl80211Attrs::MaxMatchSets({
6856                    let res = parse_u8(next);
6857                    let Some(val) = res else { break };
6858                    val
6859                }),
6860                134u16 => Nl80211Attrs::PmksaCandidate({
6861                    let res = Some(next);
6862                    let Some(val) = res else { break };
6863                    val
6864                }),
6865                135u16 => Nl80211Attrs::TxNoCckRate(()),
6866                136u16 => Nl80211Attrs::TdlsAction({
6867                    let res = parse_u8(next);
6868                    let Some(val) = res else { break };
6869                    val
6870                }),
6871                137u16 => Nl80211Attrs::TdlsDialogToken({
6872                    let res = parse_u8(next);
6873                    let Some(val) = res else { break };
6874                    val
6875                }),
6876                138u16 => Nl80211Attrs::TdlsOperation({
6877                    let res = parse_u8(next);
6878                    let Some(val) = res else { break };
6879                    val
6880                }),
6881                139u16 => Nl80211Attrs::TdlsSupport(()),
6882                140u16 => Nl80211Attrs::TdlsExternalSetup(()),
6883                141u16 => Nl80211Attrs::DeviceApSme({
6884                    let res = parse_u32(next);
6885                    let Some(val) = res else { break };
6886                    val
6887                }),
6888                142u16 => Nl80211Attrs::DontWaitForAck(()),
6889                143u16 => Nl80211Attrs::FeatureFlags({
6890                    let res = parse_u32(next);
6891                    let Some(val) = res else { break };
6892                    val
6893                }),
6894                144u16 => Nl80211Attrs::ProbeRespOffload({
6895                    let res = parse_u32(next);
6896                    let Some(val) = res else { break };
6897                    val
6898                }),
6899                145u16 => Nl80211Attrs::ProbeResp({
6900                    let res = Some(next);
6901                    let Some(val) = res else { break };
6902                    val
6903                }),
6904                146u16 => Nl80211Attrs::DfsRegion({
6905                    let res = parse_u8(next);
6906                    let Some(val) = res else { break };
6907                    val
6908                }),
6909                147u16 => Nl80211Attrs::DisableHt(()),
6910                148u16 => Nl80211Attrs::HtCapabilityMask({
6911                    let res = Some(next);
6912                    let Some(val) = res else { break };
6913                    val
6914                }),
6915                149u16 => Nl80211Attrs::NoackMap({
6916                    let res = parse_u16(next);
6917                    let Some(val) = res else { break };
6918                    val
6919                }),
6920                150u16 => Nl80211Attrs::InactivityTimeout({
6921                    let res = parse_u16(next);
6922                    let Some(val) = res else { break };
6923                    val
6924                }),
6925                151u16 => Nl80211Attrs::RxSignalDbm({
6926                    let res = parse_u32(next);
6927                    let Some(val) = res else { break };
6928                    val
6929                }),
6930                152u16 => Nl80211Attrs::BgScanPeriod({
6931                    let res = parse_u16(next);
6932                    let Some(val) = res else { break };
6933                    val
6934                }),
6935                153u16 => Nl80211Attrs::Wdev({
6936                    let res = parse_u64(next);
6937                    let Some(val) = res else { break };
6938                    val
6939                }),
6940                154u16 => Nl80211Attrs::UserRegHintType({
6941                    let res = parse_u32(next);
6942                    let Some(val) = res else { break };
6943                    val
6944                }),
6945                155u16 => Nl80211Attrs::ConnFailedReason({
6946                    let res = parse_u32(next);
6947                    let Some(val) = res else { break };
6948                    val
6949                }),
6950                156u16 => Nl80211Attrs::AuthData({
6951                    let res = Some(next);
6952                    let Some(val) = res else { break };
6953                    val
6954                }),
6955                157u16 => Nl80211Attrs::VhtCapability({
6956                    let res = Some(next);
6957                    let Some(val) = res else { break };
6958                    val
6959                }),
6960                158u16 => Nl80211Attrs::ScanFlags({
6961                    let res = parse_u32(next);
6962                    let Some(val) = res else { break };
6963                    val
6964                }),
6965                159u16 => Nl80211Attrs::ChannelWidth({
6966                    let res = parse_u32(next);
6967                    let Some(val) = res else { break };
6968                    val
6969                }),
6970                160u16 => Nl80211Attrs::CenterFreq1({
6971                    let res = parse_u32(next);
6972                    let Some(val) = res else { break };
6973                    val
6974                }),
6975                161u16 => Nl80211Attrs::CenterFreq2({
6976                    let res = parse_u32(next);
6977                    let Some(val) = res else { break };
6978                    val
6979                }),
6980                162u16 => Nl80211Attrs::P2pCtwindow({
6981                    let res = parse_u8(next);
6982                    let Some(val) = res else { break };
6983                    val
6984                }),
6985                163u16 => Nl80211Attrs::P2pOppps({
6986                    let res = parse_u8(next);
6987                    let Some(val) = res else { break };
6988                    val
6989                }),
6990                164u16 => Nl80211Attrs::LocalMeshPowerMode({
6991                    let res = parse_u32(next);
6992                    let Some(val) = res else { break };
6993                    val
6994                }),
6995                165u16 => Nl80211Attrs::AclPolicy({
6996                    let res = parse_u32(next);
6997                    let Some(val) = res else { break };
6998                    val
6999                }),
7000                166u16 => Nl80211Attrs::MacAddrs({
7001                    let res = Some(next);
7002                    let Some(val) = res else { break };
7003                    val
7004                }),
7005                167u16 => Nl80211Attrs::MacAclMax({
7006                    let res = parse_u32(next);
7007                    let Some(val) = res else { break };
7008                    val
7009                }),
7010                168u16 => Nl80211Attrs::RadarEvent({
7011                    let res = parse_u32(next);
7012                    let Some(val) = res else { break };
7013                    val
7014                }),
7015                169u16 => Nl80211Attrs::ExtCapa({
7016                    let res = Some(next);
7017                    let Some(val) = res else { break };
7018                    val
7019                }),
7020                170u16 => Nl80211Attrs::ExtCapaMask({
7021                    let res = Some(next);
7022                    let Some(val) = res else { break };
7023                    val
7024                }),
7025                171u16 => Nl80211Attrs::StaCapability({
7026                    let res = parse_u16(next);
7027                    let Some(val) = res else { break };
7028                    val
7029                }),
7030                172u16 => Nl80211Attrs::StaExtCapability({
7031                    let res = Some(next);
7032                    let Some(val) = res else { break };
7033                    val
7034                }),
7035                173u16 => Nl80211Attrs::ProtocolFeatures({
7036                    let res = parse_u32(next);
7037                    let Some(val) = res else { break };
7038                    val
7039                }),
7040                174u16 => Nl80211Attrs::SplitWiphyDump(()),
7041                175u16 => Nl80211Attrs::DisableVht(()),
7042                176u16 => Nl80211Attrs::VhtCapabilityMask({
7043                    let res = Some(next);
7044                    let Some(val) = res else { break };
7045                    val
7046                }),
7047                177u16 => Nl80211Attrs::Mdid({
7048                    let res = parse_u16(next);
7049                    let Some(val) = res else { break };
7050                    val
7051                }),
7052                178u16 => Nl80211Attrs::IeRic({
7053                    let res = Some(next);
7054                    let Some(val) = res else { break };
7055                    val
7056                }),
7057                179u16 => Nl80211Attrs::CritProtId({
7058                    let res = parse_u16(next);
7059                    let Some(val) = res else { break };
7060                    val
7061                }),
7062                180u16 => Nl80211Attrs::MaxCritProtDuration({
7063                    let res = parse_u16(next);
7064                    let Some(val) = res else { break };
7065                    val
7066                }),
7067                181u16 => Nl80211Attrs::PeerAid({
7068                    let res = parse_u16(next);
7069                    let Some(val) = res else { break };
7070                    val
7071                }),
7072                182u16 => Nl80211Attrs::CoalesceRule({
7073                    let res = Some(next);
7074                    let Some(val) = res else { break };
7075                    val
7076                }),
7077                183u16 => Nl80211Attrs::ChSwitchCount({
7078                    let res = parse_u32(next);
7079                    let Some(val) = res else { break };
7080                    val
7081                }),
7082                184u16 => Nl80211Attrs::ChSwitchBlockTx(()),
7083                185u16 => Nl80211Attrs::CsaIes({
7084                    let res = Some(next);
7085                    let Some(val) = res else { break };
7086                    val
7087                }),
7088                186u16 => Nl80211Attrs::CntdwnOffsBeacon({
7089                    let res = Some(next);
7090                    let Some(val) = res else { break };
7091                    val
7092                }),
7093                187u16 => Nl80211Attrs::CntdwnOffsPresp({
7094                    let res = Some(next);
7095                    let Some(val) = res else { break };
7096                    val
7097                }),
7098                188u16 => Nl80211Attrs::RxmgmtFlags({
7099                    let res = Some(next);
7100                    let Some(val) = res else { break };
7101                    val
7102                }),
7103                189u16 => Nl80211Attrs::StaSupportedChannels({
7104                    let res = Some(next);
7105                    let Some(val) = res else { break };
7106                    val
7107                }),
7108                190u16 => Nl80211Attrs::StaSupportedOperClasses({
7109                    let res = Some(next);
7110                    let Some(val) = res else { break };
7111                    val
7112                }),
7113                191u16 => Nl80211Attrs::HandleDfs(()),
7114                192u16 => Nl80211Attrs::Support5Mhz(()),
7115                193u16 => Nl80211Attrs::Support10Mhz(()),
7116                194u16 => Nl80211Attrs::OpmodeNotif({
7117                    let res = parse_u8(next);
7118                    let Some(val) = res else { break };
7119                    val
7120                }),
7121                195u16 => Nl80211Attrs::VendorId({
7122                    let res = parse_u32(next);
7123                    let Some(val) = res else { break };
7124                    val
7125                }),
7126                196u16 => Nl80211Attrs::VendorSubcmd({
7127                    let res = parse_u32(next);
7128                    let Some(val) = res else { break };
7129                    val
7130                }),
7131                197u16 => Nl80211Attrs::VendorData({
7132                    let res = Some(next);
7133                    let Some(val) = res else { break };
7134                    val
7135                }),
7136                198u16 => Nl80211Attrs::VendorEvents({
7137                    let res = Some(next);
7138                    let Some(val) = res else { break };
7139                    val
7140                }),
7141                199u16 => Nl80211Attrs::QosMap({
7142                    let res = Some(next);
7143                    let Some(val) = res else { break };
7144                    val
7145                }),
7146                200u16 => Nl80211Attrs::MacHint({
7147                    let res = Some(next);
7148                    let Some(val) = res else { break };
7149                    val
7150                }),
7151                201u16 => Nl80211Attrs::WiphyFreqHint({
7152                    let res = parse_u32(next);
7153                    let Some(val) = res else { break };
7154                    val
7155                }),
7156                202u16 => Nl80211Attrs::MaxApAssocSta({
7157                    let res = parse_u32(next);
7158                    let Some(val) = res else { break };
7159                    val
7160                }),
7161                203u16 => Nl80211Attrs::TdlsPeerCapability({
7162                    let res = parse_u32(next);
7163                    let Some(val) = res else { break };
7164                    val
7165                }),
7166                204u16 => Nl80211Attrs::SocketOwner(()),
7167                205u16 => Nl80211Attrs::CsaCOffsetsTx({
7168                    let res = Some(next);
7169                    let Some(val) = res else { break };
7170                    val
7171                }),
7172                206u16 => Nl80211Attrs::MaxCsaCounters({
7173                    let res = parse_u8(next);
7174                    let Some(val) = res else { break };
7175                    val
7176                }),
7177                207u16 => Nl80211Attrs::TdlsInitiator(()),
7178                208u16 => Nl80211Attrs::UseRrm(()),
7179                209u16 => Nl80211Attrs::WiphyDynAck(()),
7180                210u16 => Nl80211Attrs::Tsid({
7181                    let res = parse_u8(next);
7182                    let Some(val) = res else { break };
7183                    val
7184                }),
7185                211u16 => Nl80211Attrs::UserPrio({
7186                    let res = parse_u8(next);
7187                    let Some(val) = res else { break };
7188                    val
7189                }),
7190                212u16 => Nl80211Attrs::AdmittedTime({
7191                    let res = parse_u16(next);
7192                    let Some(val) = res else { break };
7193                    val
7194                }),
7195                213u16 => Nl80211Attrs::SmpsMode({
7196                    let res = parse_u8(next);
7197                    let Some(val) = res else { break };
7198                    val
7199                }),
7200                214u16 => Nl80211Attrs::OperClass({
7201                    let res = parse_u8(next);
7202                    let Some(val) = res else { break };
7203                    val
7204                }),
7205                215u16 => Nl80211Attrs::MacMask({
7206                    let res = Some(next);
7207                    let Some(val) = res else { break };
7208                    val
7209                }),
7210                216u16 => Nl80211Attrs::WiphySelfManagedReg(()),
7211                217u16 => Nl80211Attrs::ExtFeatures({
7212                    let res = Some(next);
7213                    let Some(val) = res else { break };
7214                    val
7215                }),
7216                218u16 => Nl80211Attrs::SurveyRadioStats({
7217                    let res = Some(next);
7218                    let Some(val) = res else { break };
7219                    val
7220                }),
7221                219u16 => Nl80211Attrs::NetnsFd({
7222                    let res = parse_u32(next);
7223                    let Some(val) = res else { break };
7224                    val
7225                }),
7226                220u16 => Nl80211Attrs::SchedScanDelay({
7227                    let res = parse_u32(next);
7228                    let Some(val) = res else { break };
7229                    val
7230                }),
7231                221u16 => Nl80211Attrs::RegIndoor(()),
7232                222u16 => Nl80211Attrs::MaxNumSchedScanPlans({
7233                    let res = parse_u32(next);
7234                    let Some(val) = res else { break };
7235                    val
7236                }),
7237                223u16 => Nl80211Attrs::MaxScanPlanInterval({
7238                    let res = parse_u32(next);
7239                    let Some(val) = res else { break };
7240                    val
7241                }),
7242                224u16 => Nl80211Attrs::MaxScanPlanIterations({
7243                    let res = parse_u32(next);
7244                    let Some(val) = res else { break };
7245                    val
7246                }),
7247                225u16 => Nl80211Attrs::SchedScanPlans({
7248                    let res = Some(next);
7249                    let Some(val) = res else { break };
7250                    val
7251                }),
7252                226u16 => Nl80211Attrs::Pbss(()),
7253                227u16 => Nl80211Attrs::BssSelect({
7254                    let res = Some(next);
7255                    let Some(val) = res else { break };
7256                    val
7257                }),
7258                228u16 => Nl80211Attrs::StaSupportP2pPs({
7259                    let res = parse_u8(next);
7260                    let Some(val) = res else { break };
7261                    val
7262                }),
7263                229u16 => Nl80211Attrs::Pad({
7264                    let res = Some(next);
7265                    let Some(val) = res else { break };
7266                    val
7267                }),
7268                230u16 => Nl80211Attrs::IftypeExtCapa({
7269                    let res = Some(next);
7270                    let Some(val) = res else { break };
7271                    val
7272                }),
7273                231u16 => Nl80211Attrs::MuMimoGroupData({
7274                    let res = Some(next);
7275                    let Some(val) = res else { break };
7276                    val
7277                }),
7278                232u16 => Nl80211Attrs::MuMimoFollowMacAddr({
7279                    let res = Some(next);
7280                    let Some(val) = res else { break };
7281                    val
7282                }),
7283                233u16 => Nl80211Attrs::ScanStartTimeTsf({
7284                    let res = parse_u64(next);
7285                    let Some(val) = res else { break };
7286                    val
7287                }),
7288                234u16 => Nl80211Attrs::ScanStartTimeTsfBssid({
7289                    let res = Some(next);
7290                    let Some(val) = res else { break };
7291                    val
7292                }),
7293                235u16 => Nl80211Attrs::MeasurementDuration({
7294                    let res = parse_u16(next);
7295                    let Some(val) = res else { break };
7296                    val
7297                }),
7298                236u16 => Nl80211Attrs::MeasurementDurationMandatory(()),
7299                237u16 => Nl80211Attrs::MeshPeerAid({
7300                    let res = parse_u16(next);
7301                    let Some(val) = res else { break };
7302                    val
7303                }),
7304                238u16 => Nl80211Attrs::NanMasterPref({
7305                    let res = parse_u8(next);
7306                    let Some(val) = res else { break };
7307                    val
7308                }),
7309                239u16 => Nl80211Attrs::Bands({
7310                    let res = parse_u32(next);
7311                    let Some(val) = res else { break };
7312                    val
7313                }),
7314                240u16 => Nl80211Attrs::NanFunc({
7315                    let res = Some(next);
7316                    let Some(val) = res else { break };
7317                    val
7318                }),
7319                241u16 => Nl80211Attrs::NanMatch({
7320                    let res = Some(next);
7321                    let Some(val) = res else { break };
7322                    val
7323                }),
7324                242u16 => Nl80211Attrs::FilsKek({
7325                    let res = Some(next);
7326                    let Some(val) = res else { break };
7327                    val
7328                }),
7329                243u16 => Nl80211Attrs::FilsNonces({
7330                    let res = Some(next);
7331                    let Some(val) = res else { break };
7332                    val
7333                }),
7334                244u16 => Nl80211Attrs::MulticastToUnicastEnabled(()),
7335                245u16 => Nl80211Attrs::Bssid({
7336                    let res = Some(next);
7337                    let Some(val) = res else { break };
7338                    val
7339                }),
7340                246u16 => Nl80211Attrs::SchedScanRelativeRssi({
7341                    let res = parse_i8(next);
7342                    let Some(val) = res else { break };
7343                    val
7344                }),
7345                247u16 => Nl80211Attrs::SchedScanRssiAdjust({
7346                    let res = Some(next);
7347                    let Some(val) = res else { break };
7348                    val
7349                }),
7350                248u16 => Nl80211Attrs::TimeoutReason({
7351                    let res = parse_u32(next);
7352                    let Some(val) = res else { break };
7353                    val
7354                }),
7355                249u16 => Nl80211Attrs::FilsErpUsername({
7356                    let res = Some(next);
7357                    let Some(val) = res else { break };
7358                    val
7359                }),
7360                250u16 => Nl80211Attrs::FilsErpRealm({
7361                    let res = Some(next);
7362                    let Some(val) = res else { break };
7363                    val
7364                }),
7365                251u16 => Nl80211Attrs::FilsErpNextSeqNum({
7366                    let res = parse_u16(next);
7367                    let Some(val) = res else { break };
7368                    val
7369                }),
7370                252u16 => Nl80211Attrs::FilsErpRrk({
7371                    let res = Some(next);
7372                    let Some(val) = res else { break };
7373                    val
7374                }),
7375                253u16 => Nl80211Attrs::FilsCacheId({
7376                    let res = Some(next);
7377                    let Some(val) = res else { break };
7378                    val
7379                }),
7380                254u16 => Nl80211Attrs::Pmk({
7381                    let res = Some(next);
7382                    let Some(val) = res else { break };
7383                    val
7384                }),
7385                255u16 => Nl80211Attrs::SchedScanMulti(()),
7386                256u16 => Nl80211Attrs::SchedScanMaxReqs({
7387                    let res = parse_u32(next);
7388                    let Some(val) = res else { break };
7389                    val
7390                }),
7391                257u16 => Nl80211Attrs::Want1x4wayHs(()),
7392                258u16 => Nl80211Attrs::Pmkr0Name({
7393                    let res = Some(next);
7394                    let Some(val) = res else { break };
7395                    val
7396                }),
7397                259u16 => Nl80211Attrs::PortAuthorized({
7398                    let res = Some(next);
7399                    let Some(val) = res else { break };
7400                    val
7401                }),
7402                260u16 => Nl80211Attrs::ExternalAuthAction({
7403                    let res = parse_u32(next);
7404                    let Some(val) = res else { break };
7405                    val
7406                }),
7407                261u16 => Nl80211Attrs::ExternalAuthSupport(()),
7408                262u16 => Nl80211Attrs::Nss({
7409                    let res = parse_u8(next);
7410                    let Some(val) = res else { break };
7411                    val
7412                }),
7413                263u16 => Nl80211Attrs::AckSignal({
7414                    let res = parse_i32(next);
7415                    let Some(val) = res else { break };
7416                    val
7417                }),
7418                264u16 => Nl80211Attrs::ControlPortOverNl80211(()),
7419                265u16 => Nl80211Attrs::TxqStats({
7420                    let res = Some(IterableTxqStatsAttrs::with_loc(next, self.orig_loc));
7421                    let Some(val) = res else { break };
7422                    val
7423                }),
7424                266u16 => Nl80211Attrs::TxqLimit({
7425                    let res = parse_u32(next);
7426                    let Some(val) = res else { break };
7427                    val
7428                }),
7429                267u16 => Nl80211Attrs::TxqMemoryLimit({
7430                    let res = parse_u32(next);
7431                    let Some(val) = res else { break };
7432                    val
7433                }),
7434                268u16 => Nl80211Attrs::TxqQuantum({
7435                    let res = parse_u32(next);
7436                    let Some(val) = res else { break };
7437                    val
7438                }),
7439                269u16 => Nl80211Attrs::HeCapability({
7440                    let res = Some(next);
7441                    let Some(val) = res else { break };
7442                    val
7443                }),
7444                270u16 => Nl80211Attrs::FtmResponder({
7445                    let res = Some(next);
7446                    let Some(val) = res else { break };
7447                    val
7448                }),
7449                271u16 => Nl80211Attrs::FtmResponderStats({
7450                    let res = Some(next);
7451                    let Some(val) = res else { break };
7452                    val
7453                }),
7454                272u16 => Nl80211Attrs::Timeout({
7455                    let res = parse_u32(next);
7456                    let Some(val) = res else { break };
7457                    val
7458                }),
7459                273u16 => Nl80211Attrs::PeerMeasurements({
7460                    let res = Some(next);
7461                    let Some(val) = res else { break };
7462                    val
7463                }),
7464                274u16 => Nl80211Attrs::AirtimeWeight({
7465                    let res = parse_u16(next);
7466                    let Some(val) = res else { break };
7467                    val
7468                }),
7469                275u16 => Nl80211Attrs::StaTxPowerSetting({
7470                    let res = parse_u8(next);
7471                    let Some(val) = res else { break };
7472                    val
7473                }),
7474                276u16 => Nl80211Attrs::StaTxPower({
7475                    let res = parse_i16(next);
7476                    let Some(val) = res else { break };
7477                    val
7478                }),
7479                277u16 => Nl80211Attrs::SaePassword({
7480                    let res = Some(next);
7481                    let Some(val) = res else { break };
7482                    val
7483                }),
7484                278u16 => Nl80211Attrs::TwtResponder(()),
7485                279u16 => Nl80211Attrs::HeObssPd({
7486                    let res = Some(next);
7487                    let Some(val) = res else { break };
7488                    val
7489                }),
7490                280u16 => Nl80211Attrs::WiphyEdmgChannels({
7491                    let res = parse_u8(next);
7492                    let Some(val) = res else { break };
7493                    val
7494                }),
7495                281u16 => Nl80211Attrs::WiphyEdmgBwConfig({
7496                    let res = parse_u8(next);
7497                    let Some(val) = res else { break };
7498                    val
7499                }),
7500                282u16 => Nl80211Attrs::VlanId({
7501                    let res = parse_u16(next);
7502                    let Some(val) = res else { break };
7503                    val
7504                }),
7505                283u16 => Nl80211Attrs::HeBssColor({
7506                    let res = Some(next);
7507                    let Some(val) = res else { break };
7508                    val
7509                }),
7510                284u16 => Nl80211Attrs::IftypeAkmSuites({
7511                    let res = Some(next);
7512                    let Some(val) = res else { break };
7513                    val
7514                }),
7515                285u16 => Nl80211Attrs::TidConfig({
7516                    let res = Some(next);
7517                    let Some(val) = res else { break };
7518                    val
7519                }),
7520                286u16 => Nl80211Attrs::ControlPortNoPreauth(()),
7521                287u16 => Nl80211Attrs::PmkLifetime({
7522                    let res = parse_u32(next);
7523                    let Some(val) = res else { break };
7524                    val
7525                }),
7526                288u16 => Nl80211Attrs::PmkReauthThreshold({
7527                    let res = parse_u8(next);
7528                    let Some(val) = res else { break };
7529                    val
7530                }),
7531                289u16 => Nl80211Attrs::ReceiveMulticast(()),
7532                290u16 => Nl80211Attrs::WiphyFreqOffset({
7533                    let res = parse_u32(next);
7534                    let Some(val) = res else { break };
7535                    val
7536                }),
7537                291u16 => Nl80211Attrs::CenterFreq1Offset({
7538                    let res = parse_u32(next);
7539                    let Some(val) = res else { break };
7540                    val
7541                }),
7542                292u16 => Nl80211Attrs::ScanFreqKhz({
7543                    let res = Some(next);
7544                    let Some(val) = res else { break };
7545                    val
7546                }),
7547                293u16 => Nl80211Attrs::He6ghzCapability({
7548                    let res = Some(next);
7549                    let Some(val) = res else { break };
7550                    val
7551                }),
7552                294u16 => Nl80211Attrs::FilsDiscovery({
7553                    let res = Some(next);
7554                    let Some(val) = res else { break };
7555                    val
7556                }),
7557                295u16 => Nl80211Attrs::UnsolBcastProbeResp({
7558                    let res = Some(next);
7559                    let Some(val) = res else { break };
7560                    val
7561                }),
7562                296u16 => Nl80211Attrs::S1gCapability({
7563                    let res = Some(next);
7564                    let Some(val) = res else { break };
7565                    val
7566                }),
7567                297u16 => Nl80211Attrs::S1gCapabilityMask({
7568                    let res = Some(next);
7569                    let Some(val) = res else { break };
7570                    val
7571                }),
7572                298u16 => Nl80211Attrs::SaePwe({
7573                    let res = parse_u8(next);
7574                    let Some(val) = res else { break };
7575                    val
7576                }),
7577                299u16 => Nl80211Attrs::ReconnectRequested({
7578                    let res = Some(next);
7579                    let Some(val) = res else { break };
7580                    val
7581                }),
7582                300u16 => Nl80211Attrs::SarSpec({
7583                    let res = Some(IterableSarAttributes::with_loc(next, self.orig_loc));
7584                    let Some(val) = res else { break };
7585                    val
7586                }),
7587                301u16 => Nl80211Attrs::DisableHe(()),
7588                302u16 => Nl80211Attrs::ObssColorBitmap({
7589                    let res = parse_u64(next);
7590                    let Some(val) = res else { break };
7591                    val
7592                }),
7593                303u16 => Nl80211Attrs::ColorChangeCount({
7594                    let res = parse_u8(next);
7595                    let Some(val) = res else { break };
7596                    val
7597                }),
7598                304u16 => Nl80211Attrs::ColorChangeColor({
7599                    let res = parse_u8(next);
7600                    let Some(val) = res else { break };
7601                    val
7602                }),
7603                305u16 => Nl80211Attrs::ColorChangeElems({
7604                    let res = Some(next);
7605                    let Some(val) = res else { break };
7606                    val
7607                }),
7608                306u16 => Nl80211Attrs::MbssidConfig({
7609                    let res = Some(next);
7610                    let Some(val) = res else { break };
7611                    val
7612                }),
7613                307u16 => Nl80211Attrs::MbssidElems({
7614                    let res = Some(next);
7615                    let Some(val) = res else { break };
7616                    val
7617                }),
7618                308u16 => Nl80211Attrs::RadarBackground(()),
7619                309u16 => Nl80211Attrs::ApSettingsFlags({
7620                    let res = parse_u32(next);
7621                    let Some(val) = res else { break };
7622                    val
7623                }),
7624                310u16 => Nl80211Attrs::EhtCapability({
7625                    let res = Some(next);
7626                    let Some(val) = res else { break };
7627                    val
7628                }),
7629                311u16 => Nl80211Attrs::DisableEht(()),
7630                312u16 => Nl80211Attrs::MloLinks({
7631                    let res = Some(next);
7632                    let Some(val) = res else { break };
7633                    val
7634                }),
7635                313u16 => Nl80211Attrs::MloLinkId({
7636                    let res = parse_u8(next);
7637                    let Some(val) = res else { break };
7638                    val
7639                }),
7640                314u16 => Nl80211Attrs::MldAddr({
7641                    let res = Some(next);
7642                    let Some(val) = res else { break };
7643                    val
7644                }),
7645                315u16 => Nl80211Attrs::MloSupport(()),
7646                316u16 => Nl80211Attrs::MaxNumAkmSuites({
7647                    let res = Some(next);
7648                    let Some(val) = res else { break };
7649                    val
7650                }),
7651                317u16 => Nl80211Attrs::EmlCapability({
7652                    let res = parse_u16(next);
7653                    let Some(val) = res else { break };
7654                    val
7655                }),
7656                318u16 => Nl80211Attrs::MldCapaAndOps({
7657                    let res = parse_u16(next);
7658                    let Some(val) = res else { break };
7659                    val
7660                }),
7661                319u16 => Nl80211Attrs::TxHwTimestamp({
7662                    let res = parse_u64(next);
7663                    let Some(val) = res else { break };
7664                    val
7665                }),
7666                320u16 => Nl80211Attrs::RxHwTimestamp({
7667                    let res = parse_u64(next);
7668                    let Some(val) = res else { break };
7669                    val
7670                }),
7671                321u16 => Nl80211Attrs::TdBitmap({
7672                    let res = Some(next);
7673                    let Some(val) = res else { break };
7674                    val
7675                }),
7676                322u16 => Nl80211Attrs::PunctBitmap({
7677                    let res = parse_u32(next);
7678                    let Some(val) = res else { break };
7679                    val
7680                }),
7681                323u16 => Nl80211Attrs::MaxHwTimestampPeers({
7682                    let res = parse_u16(next);
7683                    let Some(val) = res else { break };
7684                    val
7685                }),
7686                324u16 => Nl80211Attrs::HwTimestampEnabled(()),
7687                325u16 => Nl80211Attrs::EmaRnrElems({
7688                    let res = Some(next);
7689                    let Some(val) = res else { break };
7690                    val
7691                }),
7692                326u16 => Nl80211Attrs::MloLinkDisabled(()),
7693                327u16 => Nl80211Attrs::BssDumpIncludeUseData(()),
7694                328u16 => Nl80211Attrs::MloTtlmDlink({
7695                    let res = parse_u16(next);
7696                    let Some(val) = res else { break };
7697                    val
7698                }),
7699                329u16 => Nl80211Attrs::MloTtlmUlink({
7700                    let res = parse_u16(next);
7701                    let Some(val) = res else { break };
7702                    val
7703                }),
7704                330u16 => Nl80211Attrs::AssocSppAmsdu(()),
7705                331u16 => Nl80211Attrs::WiphyRadios({
7706                    let res = Some(next);
7707                    let Some(val) = res else { break };
7708                    val
7709                }),
7710                332u16 => Nl80211Attrs::WiphyInterfaceCombinations({
7711                    let res = Some(next);
7712                    let Some(val) = res else { break };
7713                    val
7714                }),
7715                333u16 => Nl80211Attrs::VifRadioMask({
7716                    let res = parse_u32(next);
7717                    let Some(val) = res else { break };
7718                    val
7719                }),
7720                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
7721                n => continue,
7722            };
7723            return Some(Ok(res));
7724        }
7725        Some(Err(ErrorContext::new(
7726            "Nl80211Attrs",
7727            r#type.and_then(|t| Nl80211Attrs::attr_from_type(t)),
7728            self.orig_loc,
7729            self.buf.as_ptr().wrapping_add(pos) as usize,
7730        )))
7731    }
7732}
7733impl std::fmt::Debug for IterableArrayU32<'_> {
7734    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7735        fmt.debug_list()
7736            .entries(self.clone().map(FlattenErrorContext))
7737            .finish()
7738    }
7739}
7740impl std::fmt::Debug for IterableArrayIfCombinationAttributes<'_> {
7741    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7742        fmt.debug_list()
7743            .entries(self.clone().map(FlattenErrorContext))
7744            .finish()
7745    }
7746}
7747impl<'a> std::fmt::Debug for IterableNl80211Attrs<'_> {
7748    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7749        let mut fmt = f.debug_struct("Nl80211Attrs");
7750        for attr in self.clone() {
7751            let attr = match attr {
7752                Ok(a) => a,
7753                Err(err) => {
7754                    fmt.finish()?;
7755                    f.write_str("Err(")?;
7756                    err.fmt(f)?;
7757                    return f.write_str(")");
7758                }
7759            };
7760            match attr {
7761                Nl80211Attrs::Wiphy(val) => fmt.field("Wiphy", &val),
7762                Nl80211Attrs::WiphyName(val) => fmt.field("WiphyName", &val),
7763                Nl80211Attrs::Ifindex(val) => fmt.field("Ifindex", &val),
7764                Nl80211Attrs::Ifname(val) => fmt.field("Ifname", &val),
7765                Nl80211Attrs::Iftype(val) => fmt.field("Iftype", &val),
7766                Nl80211Attrs::Mac(val) => fmt.field("Mac", &val),
7767                Nl80211Attrs::KeyData(val) => fmt.field("KeyData", &val),
7768                Nl80211Attrs::KeyIdx(val) => fmt.field("KeyIdx", &val),
7769                Nl80211Attrs::KeyCipher(val) => fmt.field("KeyCipher", &val),
7770                Nl80211Attrs::KeySeq(val) => fmt.field("KeySeq", &val),
7771                Nl80211Attrs::KeyDefault(val) => fmt.field("KeyDefault", &val),
7772                Nl80211Attrs::BeaconInterval(val) => fmt.field("BeaconInterval", &val),
7773                Nl80211Attrs::DtimPeriod(val) => fmt.field("DtimPeriod", &val),
7774                Nl80211Attrs::BeaconHead(val) => fmt.field("BeaconHead", &val),
7775                Nl80211Attrs::BeaconTail(val) => fmt.field("BeaconTail", &val),
7776                Nl80211Attrs::StaAid(val) => fmt.field("StaAid", &val),
7777                Nl80211Attrs::StaFlags(val) => fmt.field("StaFlags", &val),
7778                Nl80211Attrs::StaListenInterval(val) => fmt.field("StaListenInterval", &val),
7779                Nl80211Attrs::StaSupportedRates(val) => fmt.field("StaSupportedRates", &val),
7780                Nl80211Attrs::StaVlan(val) => fmt.field("StaVlan", &val),
7781                Nl80211Attrs::StaInfo(val) => fmt.field("StaInfo", &val),
7782                Nl80211Attrs::WiphyBands(val) => fmt.field("WiphyBands", &val),
7783                Nl80211Attrs::MntrFlags(val) => fmt.field("MntrFlags", &val),
7784                Nl80211Attrs::MeshId(val) => fmt.field("MeshId", &val),
7785                Nl80211Attrs::StaPlinkAction(val) => fmt.field("StaPlinkAction", &val),
7786                Nl80211Attrs::MpathNextHop(val) => fmt.field("MpathNextHop", &val),
7787                Nl80211Attrs::MpathInfo(val) => fmt.field("MpathInfo", &val),
7788                Nl80211Attrs::BssCtsProt(val) => fmt.field("BssCtsProt", &val),
7789                Nl80211Attrs::BssShortPreamble(val) => fmt.field("BssShortPreamble", &val),
7790                Nl80211Attrs::BssShortSlotTime(val) => fmt.field("BssShortSlotTime", &val),
7791                Nl80211Attrs::HtCapability(val) => fmt.field("HtCapability", &val),
7792                Nl80211Attrs::SupportedIftypes(val) => fmt.field("SupportedIftypes", &val),
7793                Nl80211Attrs::RegAlpha2(val) => fmt.field("RegAlpha2", &val),
7794                Nl80211Attrs::RegRules(val) => fmt.field("RegRules", &val),
7795                Nl80211Attrs::MeshConfig(val) => fmt.field("MeshConfig", &val),
7796                Nl80211Attrs::BssBasicRates(val) => fmt.field("BssBasicRates", &val),
7797                Nl80211Attrs::WiphyTxqParams(val) => fmt.field("WiphyTxqParams", &val),
7798                Nl80211Attrs::WiphyFreq(val) => fmt.field("WiphyFreq", &val),
7799                Nl80211Attrs::WiphyChannelType(val) => fmt.field(
7800                    "WiphyChannelType",
7801                    &FormatEnum(val.into(), ChannelType::from_value),
7802                ),
7803                Nl80211Attrs::KeyDefaultMgmt(val) => fmt.field("KeyDefaultMgmt", &val),
7804                Nl80211Attrs::MgmtSubtype(val) => fmt.field("MgmtSubtype", &val),
7805                Nl80211Attrs::Ie(val) => fmt.field("Ie", &val),
7806                Nl80211Attrs::MaxNumScanSsids(val) => fmt.field("MaxNumScanSsids", &val),
7807                Nl80211Attrs::ScanFrequencies(val) => fmt.field("ScanFrequencies", &val),
7808                Nl80211Attrs::ScanSsids(val) => fmt.field("ScanSsids", &val),
7809                Nl80211Attrs::Generation(val) => fmt.field("Generation", &val),
7810                Nl80211Attrs::Bss(val) => fmt.field("Bss", &val),
7811                Nl80211Attrs::RegInitiator(val) => fmt.field("RegInitiator", &val),
7812                Nl80211Attrs::RegType(val) => fmt.field("RegType", &val),
7813                Nl80211Attrs::SupportedCommands(val) => fmt.field(
7814                    "SupportedCommands",
7815                    &MapFormatArray(val, |v| FormatEnum(v.into(), Commands::from_value)),
7816                ),
7817                Nl80211Attrs::Frame(val) => fmt.field("Frame", &val),
7818                Nl80211Attrs::Ssid(val) => fmt.field("Ssid", &val),
7819                Nl80211Attrs::AuthType(val) => fmt.field("AuthType", &val),
7820                Nl80211Attrs::ReasonCode(val) => fmt.field("ReasonCode", &val),
7821                Nl80211Attrs::KeyType(val) => fmt.field("KeyType", &val),
7822                Nl80211Attrs::MaxScanIeLen(val) => fmt.field("MaxScanIeLen", &val),
7823                Nl80211Attrs::CipherSuites(val) => fmt.field("CipherSuites", &FormatHex(val)),
7824                Nl80211Attrs::FreqBefore(val) => fmt.field("FreqBefore", &val),
7825                Nl80211Attrs::FreqAfter(val) => fmt.field("FreqAfter", &val),
7826                Nl80211Attrs::FreqFixed(val) => fmt.field("FreqFixed", &val),
7827                Nl80211Attrs::WiphyRetryShort(val) => fmt.field("WiphyRetryShort", &val),
7828                Nl80211Attrs::WiphyRetryLong(val) => fmt.field("WiphyRetryLong", &val),
7829                Nl80211Attrs::WiphyFragThreshold(val) => fmt.field("WiphyFragThreshold", &val),
7830                Nl80211Attrs::WiphyRtsThreshold(val) => fmt.field("WiphyRtsThreshold", &val),
7831                Nl80211Attrs::TimedOut(val) => fmt.field("TimedOut", &val),
7832                Nl80211Attrs::UseMfp(val) => fmt.field("UseMfp", &val),
7833                Nl80211Attrs::StaFlags2(val) => fmt.field("StaFlags2", &val),
7834                Nl80211Attrs::ControlPort(val) => fmt.field("ControlPort", &val),
7835                Nl80211Attrs::Testdata(val) => fmt.field("Testdata", &val),
7836                Nl80211Attrs::Privacy(val) => fmt.field("Privacy", &val),
7837                Nl80211Attrs::DisconnectedByAp(val) => fmt.field("DisconnectedByAp", &val),
7838                Nl80211Attrs::StatusCode(val) => fmt.field("StatusCode", &val),
7839                Nl80211Attrs::CipherSuitesPairwise(val) => fmt.field("CipherSuitesPairwise", &val),
7840                Nl80211Attrs::CipherSuiteGroup(val) => fmt.field("CipherSuiteGroup", &val),
7841                Nl80211Attrs::WpaVersions(val) => fmt.field("WpaVersions", &val),
7842                Nl80211Attrs::AkmSuites(val) => fmt.field("AkmSuites", &val),
7843                Nl80211Attrs::ReqIe(val) => fmt.field("ReqIe", &val),
7844                Nl80211Attrs::RespIe(val) => fmt.field("RespIe", &val),
7845                Nl80211Attrs::PrevBssid(val) => fmt.field("PrevBssid", &val),
7846                Nl80211Attrs::Key(val) => fmt.field("Key", &val),
7847                Nl80211Attrs::Keys(val) => fmt.field("Keys", &val),
7848                Nl80211Attrs::Pid(val) => fmt.field("Pid", &val),
7849                Nl80211Attrs::_4addr(val) => fmt.field("_4addr", &val),
7850                Nl80211Attrs::SurveyInfo(val) => fmt.field("SurveyInfo", &val),
7851                Nl80211Attrs::Pmkid(val) => fmt.field("Pmkid", &val),
7852                Nl80211Attrs::MaxNumPmkids(val) => fmt.field("MaxNumPmkids", &val),
7853                Nl80211Attrs::Duration(val) => fmt.field("Duration", &val),
7854                Nl80211Attrs::Cookie(val) => fmt.field("Cookie", &val),
7855                Nl80211Attrs::WiphyCoverageClass(val) => fmt.field("WiphyCoverageClass", &val),
7856                Nl80211Attrs::TxRates(val) => fmt.field("TxRates", &val),
7857                Nl80211Attrs::FrameMatch(val) => fmt.field("FrameMatch", &val),
7858                Nl80211Attrs::Ack(val) => fmt.field("Ack", &val),
7859                Nl80211Attrs::PsState(val) => fmt.field("PsState", &val),
7860                Nl80211Attrs::Cqm(val) => fmt.field("Cqm", &val),
7861                Nl80211Attrs::LocalStateChange(val) => fmt.field("LocalStateChange", &val),
7862                Nl80211Attrs::ApIsolate(val) => fmt.field("ApIsolate", &val),
7863                Nl80211Attrs::WiphyTxPowerSetting(val) => fmt.field("WiphyTxPowerSetting", &val),
7864                Nl80211Attrs::WiphyTxPowerLevel(val) => fmt.field("WiphyTxPowerLevel", &val),
7865                Nl80211Attrs::TxFrameTypes(val) => fmt.field("TxFrameTypes", &val),
7866                Nl80211Attrs::RxFrameTypes(val) => fmt.field("RxFrameTypes", &val),
7867                Nl80211Attrs::FrameType(val) => fmt.field("FrameType", &val),
7868                Nl80211Attrs::ControlPortEthertype(val) => fmt.field("ControlPortEthertype", &val),
7869                Nl80211Attrs::ControlPortNoEncrypt(val) => fmt.field("ControlPortNoEncrypt", &val),
7870                Nl80211Attrs::SupportIbssRsn(val) => fmt.field("SupportIbssRsn", &val),
7871                Nl80211Attrs::WiphyAntennaTx(val) => fmt.field("WiphyAntennaTx", &val),
7872                Nl80211Attrs::WiphyAntennaRx(val) => fmt.field("WiphyAntennaRx", &val),
7873                Nl80211Attrs::McastRate(val) => fmt.field("McastRate", &val),
7874                Nl80211Attrs::OffchannelTxOk(val) => fmt.field("OffchannelTxOk", &val),
7875                Nl80211Attrs::BssHtOpmode(val) => fmt.field("BssHtOpmode", &val),
7876                Nl80211Attrs::KeyDefaultTypes(val) => fmt.field("KeyDefaultTypes", &val),
7877                Nl80211Attrs::MaxRemainOnChannelDuration(val) => {
7878                    fmt.field("MaxRemainOnChannelDuration", &val)
7879                }
7880                Nl80211Attrs::MeshSetup(val) => fmt.field("MeshSetup", &val),
7881                Nl80211Attrs::WiphyAntennaAvailTx(val) => fmt.field("WiphyAntennaAvailTx", &val),
7882                Nl80211Attrs::WiphyAntennaAvailRx(val) => fmt.field("WiphyAntennaAvailRx", &val),
7883                Nl80211Attrs::SupportMeshAuth(val) => fmt.field("SupportMeshAuth", &val),
7884                Nl80211Attrs::StaPlinkState(val) => fmt.field("StaPlinkState", &val),
7885                Nl80211Attrs::WowlanTriggers(val) => fmt.field("WowlanTriggers", &val),
7886                Nl80211Attrs::WowlanTriggersSupported(val) => {
7887                    fmt.field("WowlanTriggersSupported", &val)
7888                }
7889                Nl80211Attrs::SchedScanInterval(val) => fmt.field("SchedScanInterval", &val),
7890                Nl80211Attrs::InterfaceCombinations(val) => {
7891                    fmt.field("InterfaceCombinations", &val)
7892                }
7893                Nl80211Attrs::SoftwareIftypes(val) => fmt.field("SoftwareIftypes", &val),
7894                Nl80211Attrs::RekeyData(val) => fmt.field("RekeyData", &val),
7895                Nl80211Attrs::MaxNumSchedScanSsids(val) => fmt.field("MaxNumSchedScanSsids", &val),
7896                Nl80211Attrs::MaxSchedScanIeLen(val) => fmt.field("MaxSchedScanIeLen", &val),
7897                Nl80211Attrs::ScanSuppRates(val) => fmt.field("ScanSuppRates", &val),
7898                Nl80211Attrs::HiddenSsid(val) => fmt.field("HiddenSsid", &val),
7899                Nl80211Attrs::IeProbeResp(val) => fmt.field("IeProbeResp", &val),
7900                Nl80211Attrs::IeAssocResp(val) => fmt.field("IeAssocResp", &val),
7901                Nl80211Attrs::StaWme(val) => fmt.field("StaWme", &val),
7902                Nl80211Attrs::SupportApUapsd(val) => fmt.field("SupportApUapsd", &val),
7903                Nl80211Attrs::RoamSupport(val) => fmt.field("RoamSupport", &val),
7904                Nl80211Attrs::SchedScanMatch(val) => fmt.field("SchedScanMatch", &val),
7905                Nl80211Attrs::MaxMatchSets(val) => fmt.field("MaxMatchSets", &val),
7906                Nl80211Attrs::PmksaCandidate(val) => fmt.field("PmksaCandidate", &val),
7907                Nl80211Attrs::TxNoCckRate(val) => fmt.field("TxNoCckRate", &val),
7908                Nl80211Attrs::TdlsAction(val) => fmt.field("TdlsAction", &val),
7909                Nl80211Attrs::TdlsDialogToken(val) => fmt.field("TdlsDialogToken", &val),
7910                Nl80211Attrs::TdlsOperation(val) => fmt.field("TdlsOperation", &val),
7911                Nl80211Attrs::TdlsSupport(val) => fmt.field("TdlsSupport", &val),
7912                Nl80211Attrs::TdlsExternalSetup(val) => fmt.field("TdlsExternalSetup", &val),
7913                Nl80211Attrs::DeviceApSme(val) => fmt.field("DeviceApSme", &val),
7914                Nl80211Attrs::DontWaitForAck(val) => fmt.field("DontWaitForAck", &val),
7915                Nl80211Attrs::FeatureFlags(val) => fmt.field(
7916                    "FeatureFlags",
7917                    &FormatFlags(val.into(), FeatureFlags::from_value),
7918                ),
7919                Nl80211Attrs::ProbeRespOffload(val) => fmt.field("ProbeRespOffload", &val),
7920                Nl80211Attrs::ProbeResp(val) => fmt.field("ProbeResp", &val),
7921                Nl80211Attrs::DfsRegion(val) => fmt.field("DfsRegion", &val),
7922                Nl80211Attrs::DisableHt(val) => fmt.field("DisableHt", &val),
7923                Nl80211Attrs::HtCapabilityMask(val) => fmt.field("HtCapabilityMask", &val),
7924                Nl80211Attrs::NoackMap(val) => fmt.field("NoackMap", &val),
7925                Nl80211Attrs::InactivityTimeout(val) => fmt.field("InactivityTimeout", &val),
7926                Nl80211Attrs::RxSignalDbm(val) => fmt.field("RxSignalDbm", &val),
7927                Nl80211Attrs::BgScanPeriod(val) => fmt.field("BgScanPeriod", &val),
7928                Nl80211Attrs::Wdev(val) => fmt.field("Wdev", &val),
7929                Nl80211Attrs::UserRegHintType(val) => fmt.field("UserRegHintType", &val),
7930                Nl80211Attrs::ConnFailedReason(val) => fmt.field("ConnFailedReason", &val),
7931                Nl80211Attrs::AuthData(val) => fmt.field("AuthData", &val),
7932                Nl80211Attrs::VhtCapability(val) => fmt.field("VhtCapability", &val),
7933                Nl80211Attrs::ScanFlags(val) => fmt.field("ScanFlags", &val),
7934                Nl80211Attrs::ChannelWidth(val) => fmt.field("ChannelWidth", &val),
7935                Nl80211Attrs::CenterFreq1(val) => fmt.field("CenterFreq1", &val),
7936                Nl80211Attrs::CenterFreq2(val) => fmt.field("CenterFreq2", &val),
7937                Nl80211Attrs::P2pCtwindow(val) => fmt.field("P2pCtwindow", &val),
7938                Nl80211Attrs::P2pOppps(val) => fmt.field("P2pOppps", &val),
7939                Nl80211Attrs::LocalMeshPowerMode(val) => fmt.field("LocalMeshPowerMode", &val),
7940                Nl80211Attrs::AclPolicy(val) => fmt.field("AclPolicy", &val),
7941                Nl80211Attrs::MacAddrs(val) => fmt.field("MacAddrs", &val),
7942                Nl80211Attrs::MacAclMax(val) => fmt.field("MacAclMax", &val),
7943                Nl80211Attrs::RadarEvent(val) => fmt.field("RadarEvent", &val),
7944                Nl80211Attrs::ExtCapa(val) => fmt.field("ExtCapa", &val),
7945                Nl80211Attrs::ExtCapaMask(val) => fmt.field("ExtCapaMask", &val),
7946                Nl80211Attrs::StaCapability(val) => fmt.field("StaCapability", &val),
7947                Nl80211Attrs::StaExtCapability(val) => fmt.field("StaExtCapability", &val),
7948                Nl80211Attrs::ProtocolFeatures(val) => fmt.field(
7949                    "ProtocolFeatures",
7950                    &FormatFlags(val.into(), ProtocolFeatures::from_value),
7951                ),
7952                Nl80211Attrs::SplitWiphyDump(val) => fmt.field("SplitWiphyDump", &val),
7953                Nl80211Attrs::DisableVht(val) => fmt.field("DisableVht", &val),
7954                Nl80211Attrs::VhtCapabilityMask(val) => fmt.field("VhtCapabilityMask", &val),
7955                Nl80211Attrs::Mdid(val) => fmt.field("Mdid", &val),
7956                Nl80211Attrs::IeRic(val) => fmt.field("IeRic", &val),
7957                Nl80211Attrs::CritProtId(val) => fmt.field("CritProtId", &val),
7958                Nl80211Attrs::MaxCritProtDuration(val) => fmt.field("MaxCritProtDuration", &val),
7959                Nl80211Attrs::PeerAid(val) => fmt.field("PeerAid", &val),
7960                Nl80211Attrs::CoalesceRule(val) => fmt.field("CoalesceRule", &val),
7961                Nl80211Attrs::ChSwitchCount(val) => fmt.field("ChSwitchCount", &val),
7962                Nl80211Attrs::ChSwitchBlockTx(val) => fmt.field("ChSwitchBlockTx", &val),
7963                Nl80211Attrs::CsaIes(val) => fmt.field("CsaIes", &val),
7964                Nl80211Attrs::CntdwnOffsBeacon(val) => fmt.field("CntdwnOffsBeacon", &val),
7965                Nl80211Attrs::CntdwnOffsPresp(val) => fmt.field("CntdwnOffsPresp", &val),
7966                Nl80211Attrs::RxmgmtFlags(val) => fmt.field("RxmgmtFlags", &val),
7967                Nl80211Attrs::StaSupportedChannels(val) => fmt.field("StaSupportedChannels", &val),
7968                Nl80211Attrs::StaSupportedOperClasses(val) => {
7969                    fmt.field("StaSupportedOperClasses", &val)
7970                }
7971                Nl80211Attrs::HandleDfs(val) => fmt.field("HandleDfs", &val),
7972                Nl80211Attrs::Support5Mhz(val) => fmt.field("Support5Mhz", &val),
7973                Nl80211Attrs::Support10Mhz(val) => fmt.field("Support10Mhz", &val),
7974                Nl80211Attrs::OpmodeNotif(val) => fmt.field("OpmodeNotif", &val),
7975                Nl80211Attrs::VendorId(val) => fmt.field("VendorId", &val),
7976                Nl80211Attrs::VendorSubcmd(val) => fmt.field("VendorSubcmd", &val),
7977                Nl80211Attrs::VendorData(val) => fmt.field("VendorData", &val),
7978                Nl80211Attrs::VendorEvents(val) => fmt.field("VendorEvents", &val),
7979                Nl80211Attrs::QosMap(val) => fmt.field("QosMap", &val),
7980                Nl80211Attrs::MacHint(val) => fmt.field("MacHint", &val),
7981                Nl80211Attrs::WiphyFreqHint(val) => fmt.field("WiphyFreqHint", &val),
7982                Nl80211Attrs::MaxApAssocSta(val) => fmt.field("MaxApAssocSta", &val),
7983                Nl80211Attrs::TdlsPeerCapability(val) => fmt.field("TdlsPeerCapability", &val),
7984                Nl80211Attrs::SocketOwner(val) => fmt.field("SocketOwner", &val),
7985                Nl80211Attrs::CsaCOffsetsTx(val) => fmt.field("CsaCOffsetsTx", &val),
7986                Nl80211Attrs::MaxCsaCounters(val) => fmt.field("MaxCsaCounters", &val),
7987                Nl80211Attrs::TdlsInitiator(val) => fmt.field("TdlsInitiator", &val),
7988                Nl80211Attrs::UseRrm(val) => fmt.field("UseRrm", &val),
7989                Nl80211Attrs::WiphyDynAck(val) => fmt.field("WiphyDynAck", &val),
7990                Nl80211Attrs::Tsid(val) => fmt.field("Tsid", &val),
7991                Nl80211Attrs::UserPrio(val) => fmt.field("UserPrio", &val),
7992                Nl80211Attrs::AdmittedTime(val) => fmt.field("AdmittedTime", &val),
7993                Nl80211Attrs::SmpsMode(val) => fmt.field("SmpsMode", &val),
7994                Nl80211Attrs::OperClass(val) => fmt.field("OperClass", &val),
7995                Nl80211Attrs::MacMask(val) => fmt.field("MacMask", &val),
7996                Nl80211Attrs::WiphySelfManagedReg(val) => fmt.field("WiphySelfManagedReg", &val),
7997                Nl80211Attrs::ExtFeatures(val) => fmt.field("ExtFeatures", &val),
7998                Nl80211Attrs::SurveyRadioStats(val) => fmt.field("SurveyRadioStats", &val),
7999                Nl80211Attrs::NetnsFd(val) => fmt.field("NetnsFd", &val),
8000                Nl80211Attrs::SchedScanDelay(val) => fmt.field("SchedScanDelay", &val),
8001                Nl80211Attrs::RegIndoor(val) => fmt.field("RegIndoor", &val),
8002                Nl80211Attrs::MaxNumSchedScanPlans(val) => fmt.field("MaxNumSchedScanPlans", &val),
8003                Nl80211Attrs::MaxScanPlanInterval(val) => fmt.field("MaxScanPlanInterval", &val),
8004                Nl80211Attrs::MaxScanPlanIterations(val) => {
8005                    fmt.field("MaxScanPlanIterations", &val)
8006                }
8007                Nl80211Attrs::SchedScanPlans(val) => fmt.field("SchedScanPlans", &val),
8008                Nl80211Attrs::Pbss(val) => fmt.field("Pbss", &val),
8009                Nl80211Attrs::BssSelect(val) => fmt.field("BssSelect", &val),
8010                Nl80211Attrs::StaSupportP2pPs(val) => fmt.field("StaSupportP2pPs", &val),
8011                Nl80211Attrs::Pad(val) => fmt.field("Pad", &val),
8012                Nl80211Attrs::IftypeExtCapa(val) => fmt.field("IftypeExtCapa", &val),
8013                Nl80211Attrs::MuMimoGroupData(val) => fmt.field("MuMimoGroupData", &val),
8014                Nl80211Attrs::MuMimoFollowMacAddr(val) => fmt.field("MuMimoFollowMacAddr", &val),
8015                Nl80211Attrs::ScanStartTimeTsf(val) => fmt.field("ScanStartTimeTsf", &val),
8016                Nl80211Attrs::ScanStartTimeTsfBssid(val) => {
8017                    fmt.field("ScanStartTimeTsfBssid", &val)
8018                }
8019                Nl80211Attrs::MeasurementDuration(val) => fmt.field("MeasurementDuration", &val),
8020                Nl80211Attrs::MeasurementDurationMandatory(val) => {
8021                    fmt.field("MeasurementDurationMandatory", &val)
8022                }
8023                Nl80211Attrs::MeshPeerAid(val) => fmt.field("MeshPeerAid", &val),
8024                Nl80211Attrs::NanMasterPref(val) => fmt.field("NanMasterPref", &val),
8025                Nl80211Attrs::Bands(val) => fmt.field("Bands", &val),
8026                Nl80211Attrs::NanFunc(val) => fmt.field("NanFunc", &val),
8027                Nl80211Attrs::NanMatch(val) => fmt.field("NanMatch", &val),
8028                Nl80211Attrs::FilsKek(val) => fmt.field("FilsKek", &val),
8029                Nl80211Attrs::FilsNonces(val) => fmt.field("FilsNonces", &val),
8030                Nl80211Attrs::MulticastToUnicastEnabled(val) => {
8031                    fmt.field("MulticastToUnicastEnabled", &val)
8032                }
8033                Nl80211Attrs::Bssid(val) => fmt.field("Bssid", &val),
8034                Nl80211Attrs::SchedScanRelativeRssi(val) => {
8035                    fmt.field("SchedScanRelativeRssi", &val)
8036                }
8037                Nl80211Attrs::SchedScanRssiAdjust(val) => fmt.field("SchedScanRssiAdjust", &val),
8038                Nl80211Attrs::TimeoutReason(val) => fmt.field("TimeoutReason", &val),
8039                Nl80211Attrs::FilsErpUsername(val) => fmt.field("FilsErpUsername", &val),
8040                Nl80211Attrs::FilsErpRealm(val) => fmt.field("FilsErpRealm", &val),
8041                Nl80211Attrs::FilsErpNextSeqNum(val) => fmt.field("FilsErpNextSeqNum", &val),
8042                Nl80211Attrs::FilsErpRrk(val) => fmt.field("FilsErpRrk", &val),
8043                Nl80211Attrs::FilsCacheId(val) => fmt.field("FilsCacheId", &val),
8044                Nl80211Attrs::Pmk(val) => fmt.field("Pmk", &val),
8045                Nl80211Attrs::SchedScanMulti(val) => fmt.field("SchedScanMulti", &val),
8046                Nl80211Attrs::SchedScanMaxReqs(val) => fmt.field("SchedScanMaxReqs", &val),
8047                Nl80211Attrs::Want1x4wayHs(val) => fmt.field("Want1x4wayHs", &val),
8048                Nl80211Attrs::Pmkr0Name(val) => fmt.field("Pmkr0Name", &val),
8049                Nl80211Attrs::PortAuthorized(val) => fmt.field("PortAuthorized", &val),
8050                Nl80211Attrs::ExternalAuthAction(val) => fmt.field("ExternalAuthAction", &val),
8051                Nl80211Attrs::ExternalAuthSupport(val) => fmt.field("ExternalAuthSupport", &val),
8052                Nl80211Attrs::Nss(val) => fmt.field("Nss", &val),
8053                Nl80211Attrs::AckSignal(val) => fmt.field("AckSignal", &val),
8054                Nl80211Attrs::ControlPortOverNl80211(val) => {
8055                    fmt.field("ControlPortOverNl80211", &val)
8056                }
8057                Nl80211Attrs::TxqStats(val) => fmt.field("TxqStats", &val),
8058                Nl80211Attrs::TxqLimit(val) => fmt.field("TxqLimit", &val),
8059                Nl80211Attrs::TxqMemoryLimit(val) => fmt.field("TxqMemoryLimit", &val),
8060                Nl80211Attrs::TxqQuantum(val) => fmt.field("TxqQuantum", &val),
8061                Nl80211Attrs::HeCapability(val) => fmt.field("HeCapability", &val),
8062                Nl80211Attrs::FtmResponder(val) => fmt.field("FtmResponder", &val),
8063                Nl80211Attrs::FtmResponderStats(val) => fmt.field("FtmResponderStats", &val),
8064                Nl80211Attrs::Timeout(val) => fmt.field("Timeout", &val),
8065                Nl80211Attrs::PeerMeasurements(val) => fmt.field("PeerMeasurements", &val),
8066                Nl80211Attrs::AirtimeWeight(val) => fmt.field("AirtimeWeight", &val),
8067                Nl80211Attrs::StaTxPowerSetting(val) => fmt.field("StaTxPowerSetting", &val),
8068                Nl80211Attrs::StaTxPower(val) => fmt.field("StaTxPower", &val),
8069                Nl80211Attrs::SaePassword(val) => fmt.field("SaePassword", &val),
8070                Nl80211Attrs::TwtResponder(val) => fmt.field("TwtResponder", &val),
8071                Nl80211Attrs::HeObssPd(val) => fmt.field("HeObssPd", &val),
8072                Nl80211Attrs::WiphyEdmgChannels(val) => fmt.field("WiphyEdmgChannels", &val),
8073                Nl80211Attrs::WiphyEdmgBwConfig(val) => fmt.field("WiphyEdmgBwConfig", &val),
8074                Nl80211Attrs::VlanId(val) => fmt.field("VlanId", &val),
8075                Nl80211Attrs::HeBssColor(val) => fmt.field("HeBssColor", &val),
8076                Nl80211Attrs::IftypeAkmSuites(val) => fmt.field("IftypeAkmSuites", &val),
8077                Nl80211Attrs::TidConfig(val) => fmt.field("TidConfig", &val),
8078                Nl80211Attrs::ControlPortNoPreauth(val) => fmt.field("ControlPortNoPreauth", &val),
8079                Nl80211Attrs::PmkLifetime(val) => fmt.field("PmkLifetime", &val),
8080                Nl80211Attrs::PmkReauthThreshold(val) => fmt.field("PmkReauthThreshold", &val),
8081                Nl80211Attrs::ReceiveMulticast(val) => fmt.field("ReceiveMulticast", &val),
8082                Nl80211Attrs::WiphyFreqOffset(val) => fmt.field("WiphyFreqOffset", &val),
8083                Nl80211Attrs::CenterFreq1Offset(val) => fmt.field("CenterFreq1Offset", &val),
8084                Nl80211Attrs::ScanFreqKhz(val) => fmt.field("ScanFreqKhz", &val),
8085                Nl80211Attrs::He6ghzCapability(val) => fmt.field("He6ghzCapability", &val),
8086                Nl80211Attrs::FilsDiscovery(val) => fmt.field("FilsDiscovery", &val),
8087                Nl80211Attrs::UnsolBcastProbeResp(val) => fmt.field("UnsolBcastProbeResp", &val),
8088                Nl80211Attrs::S1gCapability(val) => fmt.field("S1gCapability", &val),
8089                Nl80211Attrs::S1gCapabilityMask(val) => fmt.field("S1gCapabilityMask", &val),
8090                Nl80211Attrs::SaePwe(val) => fmt.field("SaePwe", &val),
8091                Nl80211Attrs::ReconnectRequested(val) => fmt.field("ReconnectRequested", &val),
8092                Nl80211Attrs::SarSpec(val) => fmt.field("SarSpec", &val),
8093                Nl80211Attrs::DisableHe(val) => fmt.field("DisableHe", &val),
8094                Nl80211Attrs::ObssColorBitmap(val) => fmt.field("ObssColorBitmap", &val),
8095                Nl80211Attrs::ColorChangeCount(val) => fmt.field("ColorChangeCount", &val),
8096                Nl80211Attrs::ColorChangeColor(val) => fmt.field("ColorChangeColor", &val),
8097                Nl80211Attrs::ColorChangeElems(val) => fmt.field("ColorChangeElems", &val),
8098                Nl80211Attrs::MbssidConfig(val) => fmt.field("MbssidConfig", &val),
8099                Nl80211Attrs::MbssidElems(val) => fmt.field("MbssidElems", &val),
8100                Nl80211Attrs::RadarBackground(val) => fmt.field("RadarBackground", &val),
8101                Nl80211Attrs::ApSettingsFlags(val) => fmt.field("ApSettingsFlags", &val),
8102                Nl80211Attrs::EhtCapability(val) => fmt.field("EhtCapability", &val),
8103                Nl80211Attrs::DisableEht(val) => fmt.field("DisableEht", &val),
8104                Nl80211Attrs::MloLinks(val) => fmt.field("MloLinks", &val),
8105                Nl80211Attrs::MloLinkId(val) => fmt.field("MloLinkId", &val),
8106                Nl80211Attrs::MldAddr(val) => fmt.field("MldAddr", &val),
8107                Nl80211Attrs::MloSupport(val) => fmt.field("MloSupport", &val),
8108                Nl80211Attrs::MaxNumAkmSuites(val) => fmt.field("MaxNumAkmSuites", &val),
8109                Nl80211Attrs::EmlCapability(val) => fmt.field("EmlCapability", &val),
8110                Nl80211Attrs::MldCapaAndOps(val) => fmt.field("MldCapaAndOps", &val),
8111                Nl80211Attrs::TxHwTimestamp(val) => fmt.field("TxHwTimestamp", &val),
8112                Nl80211Attrs::RxHwTimestamp(val) => fmt.field("RxHwTimestamp", &val),
8113                Nl80211Attrs::TdBitmap(val) => fmt.field("TdBitmap", &val),
8114                Nl80211Attrs::PunctBitmap(val) => fmt.field("PunctBitmap", &val),
8115                Nl80211Attrs::MaxHwTimestampPeers(val) => fmt.field("MaxHwTimestampPeers", &val),
8116                Nl80211Attrs::HwTimestampEnabled(val) => fmt.field("HwTimestampEnabled", &val),
8117                Nl80211Attrs::EmaRnrElems(val) => fmt.field("EmaRnrElems", &val),
8118                Nl80211Attrs::MloLinkDisabled(val) => fmt.field("MloLinkDisabled", &val),
8119                Nl80211Attrs::BssDumpIncludeUseData(val) => {
8120                    fmt.field("BssDumpIncludeUseData", &val)
8121                }
8122                Nl80211Attrs::MloTtlmDlink(val) => fmt.field("MloTtlmDlink", &val),
8123                Nl80211Attrs::MloTtlmUlink(val) => fmt.field("MloTtlmUlink", &val),
8124                Nl80211Attrs::AssocSppAmsdu(val) => fmt.field("AssocSppAmsdu", &val),
8125                Nl80211Attrs::WiphyRadios(val) => fmt.field("WiphyRadios", &val),
8126                Nl80211Attrs::WiphyInterfaceCombinations(val) => {
8127                    fmt.field("WiphyInterfaceCombinations", &val)
8128                }
8129                Nl80211Attrs::VifRadioMask(val) => fmt.field("VifRadioMask", &val),
8130            };
8131        }
8132        fmt.finish()
8133    }
8134}
8135impl IterableNl80211Attrs<'_> {
8136    pub fn lookup_attr(
8137        &self,
8138        offset: usize,
8139        missing_type: Option<u16>,
8140    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
8141        let mut stack = Vec::new();
8142        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
8143        if cur == offset {
8144            stack.push(("Nl80211Attrs", offset));
8145            return (
8146                stack,
8147                missing_type.and_then(|t| Nl80211Attrs::attr_from_type(t)),
8148            );
8149        }
8150        if cur > offset || cur + self.buf.len() < offset {
8151            return (stack, None);
8152        }
8153        let mut attrs = self.clone();
8154        let mut last_off = cur + attrs.pos;
8155        let mut missing = None;
8156        while let Some(attr) = attrs.next() {
8157            let Ok(attr) = attr else { break };
8158            match attr {
8159                Nl80211Attrs::Wiphy(val) => {
8160                    if last_off == offset {
8161                        stack.push(("Wiphy", last_off));
8162                        break;
8163                    }
8164                }
8165                Nl80211Attrs::WiphyName(val) => {
8166                    if last_off == offset {
8167                        stack.push(("WiphyName", last_off));
8168                        break;
8169                    }
8170                }
8171                Nl80211Attrs::Ifindex(val) => {
8172                    if last_off == offset {
8173                        stack.push(("Ifindex", last_off));
8174                        break;
8175                    }
8176                }
8177                Nl80211Attrs::Ifname(val) => {
8178                    if last_off == offset {
8179                        stack.push(("Ifname", last_off));
8180                        break;
8181                    }
8182                }
8183                Nl80211Attrs::Iftype(val) => {
8184                    if last_off == offset {
8185                        stack.push(("Iftype", last_off));
8186                        break;
8187                    }
8188                }
8189                Nl80211Attrs::Mac(val) => {
8190                    if last_off == offset {
8191                        stack.push(("Mac", last_off));
8192                        break;
8193                    }
8194                }
8195                Nl80211Attrs::KeyData(val) => {
8196                    if last_off == offset {
8197                        stack.push(("KeyData", last_off));
8198                        break;
8199                    }
8200                }
8201                Nl80211Attrs::KeyIdx(val) => {
8202                    if last_off == offset {
8203                        stack.push(("KeyIdx", last_off));
8204                        break;
8205                    }
8206                }
8207                Nl80211Attrs::KeyCipher(val) => {
8208                    if last_off == offset {
8209                        stack.push(("KeyCipher", last_off));
8210                        break;
8211                    }
8212                }
8213                Nl80211Attrs::KeySeq(val) => {
8214                    if last_off == offset {
8215                        stack.push(("KeySeq", last_off));
8216                        break;
8217                    }
8218                }
8219                Nl80211Attrs::KeyDefault(val) => {
8220                    if last_off == offset {
8221                        stack.push(("KeyDefault", last_off));
8222                        break;
8223                    }
8224                }
8225                Nl80211Attrs::BeaconInterval(val) => {
8226                    if last_off == offset {
8227                        stack.push(("BeaconInterval", last_off));
8228                        break;
8229                    }
8230                }
8231                Nl80211Attrs::DtimPeriod(val) => {
8232                    if last_off == offset {
8233                        stack.push(("DtimPeriod", last_off));
8234                        break;
8235                    }
8236                }
8237                Nl80211Attrs::BeaconHead(val) => {
8238                    if last_off == offset {
8239                        stack.push(("BeaconHead", last_off));
8240                        break;
8241                    }
8242                }
8243                Nl80211Attrs::BeaconTail(val) => {
8244                    if last_off == offset {
8245                        stack.push(("BeaconTail", last_off));
8246                        break;
8247                    }
8248                }
8249                Nl80211Attrs::StaAid(val) => {
8250                    if last_off == offset {
8251                        stack.push(("StaAid", last_off));
8252                        break;
8253                    }
8254                }
8255                Nl80211Attrs::StaFlags(val) => {
8256                    if last_off == offset {
8257                        stack.push(("StaFlags", last_off));
8258                        break;
8259                    }
8260                }
8261                Nl80211Attrs::StaListenInterval(val) => {
8262                    if last_off == offset {
8263                        stack.push(("StaListenInterval", last_off));
8264                        break;
8265                    }
8266                }
8267                Nl80211Attrs::StaSupportedRates(val) => {
8268                    if last_off == offset {
8269                        stack.push(("StaSupportedRates", last_off));
8270                        break;
8271                    }
8272                }
8273                Nl80211Attrs::StaVlan(val) => {
8274                    if last_off == offset {
8275                        stack.push(("StaVlan", last_off));
8276                        break;
8277                    }
8278                }
8279                Nl80211Attrs::StaInfo(val) => {
8280                    if last_off == offset {
8281                        stack.push(("StaInfo", last_off));
8282                        break;
8283                    }
8284                }
8285                Nl80211Attrs::WiphyBands(val) => {
8286                    (stack, missing) = val.lookup_attr(offset, missing_type);
8287                    if !stack.is_empty() {
8288                        break;
8289                    }
8290                }
8291                Nl80211Attrs::MntrFlags(val) => {
8292                    if last_off == offset {
8293                        stack.push(("MntrFlags", last_off));
8294                        break;
8295                    }
8296                }
8297                Nl80211Attrs::MeshId(val) => {
8298                    if last_off == offset {
8299                        stack.push(("MeshId", last_off));
8300                        break;
8301                    }
8302                }
8303                Nl80211Attrs::StaPlinkAction(val) => {
8304                    if last_off == offset {
8305                        stack.push(("StaPlinkAction", last_off));
8306                        break;
8307                    }
8308                }
8309                Nl80211Attrs::MpathNextHop(val) => {
8310                    if last_off == offset {
8311                        stack.push(("MpathNextHop", last_off));
8312                        break;
8313                    }
8314                }
8315                Nl80211Attrs::MpathInfo(val) => {
8316                    if last_off == offset {
8317                        stack.push(("MpathInfo", last_off));
8318                        break;
8319                    }
8320                }
8321                Nl80211Attrs::BssCtsProt(val) => {
8322                    if last_off == offset {
8323                        stack.push(("BssCtsProt", last_off));
8324                        break;
8325                    }
8326                }
8327                Nl80211Attrs::BssShortPreamble(val) => {
8328                    if last_off == offset {
8329                        stack.push(("BssShortPreamble", last_off));
8330                        break;
8331                    }
8332                }
8333                Nl80211Attrs::BssShortSlotTime(val) => {
8334                    if last_off == offset {
8335                        stack.push(("BssShortSlotTime", last_off));
8336                        break;
8337                    }
8338                }
8339                Nl80211Attrs::HtCapability(val) => {
8340                    if last_off == offset {
8341                        stack.push(("HtCapability", last_off));
8342                        break;
8343                    }
8344                }
8345                Nl80211Attrs::SupportedIftypes(val) => {
8346                    (stack, missing) = val.lookup_attr(offset, missing_type);
8347                    if !stack.is_empty() {
8348                        break;
8349                    }
8350                }
8351                Nl80211Attrs::RegAlpha2(val) => {
8352                    if last_off == offset {
8353                        stack.push(("RegAlpha2", last_off));
8354                        break;
8355                    }
8356                }
8357                Nl80211Attrs::RegRules(val) => {
8358                    if last_off == offset {
8359                        stack.push(("RegRules", last_off));
8360                        break;
8361                    }
8362                }
8363                Nl80211Attrs::MeshConfig(val) => {
8364                    if last_off == offset {
8365                        stack.push(("MeshConfig", last_off));
8366                        break;
8367                    }
8368                }
8369                Nl80211Attrs::BssBasicRates(val) => {
8370                    if last_off == offset {
8371                        stack.push(("BssBasicRates", last_off));
8372                        break;
8373                    }
8374                }
8375                Nl80211Attrs::WiphyTxqParams(val) => {
8376                    if last_off == offset {
8377                        stack.push(("WiphyTxqParams", last_off));
8378                        break;
8379                    }
8380                }
8381                Nl80211Attrs::WiphyFreq(val) => {
8382                    if last_off == offset {
8383                        stack.push(("WiphyFreq", last_off));
8384                        break;
8385                    }
8386                }
8387                Nl80211Attrs::WiphyChannelType(val) => {
8388                    if last_off == offset {
8389                        stack.push(("WiphyChannelType", last_off));
8390                        break;
8391                    }
8392                }
8393                Nl80211Attrs::KeyDefaultMgmt(val) => {
8394                    if last_off == offset {
8395                        stack.push(("KeyDefaultMgmt", last_off));
8396                        break;
8397                    }
8398                }
8399                Nl80211Attrs::MgmtSubtype(val) => {
8400                    if last_off == offset {
8401                        stack.push(("MgmtSubtype", last_off));
8402                        break;
8403                    }
8404                }
8405                Nl80211Attrs::Ie(val) => {
8406                    if last_off == offset {
8407                        stack.push(("Ie", last_off));
8408                        break;
8409                    }
8410                }
8411                Nl80211Attrs::MaxNumScanSsids(val) => {
8412                    if last_off == offset {
8413                        stack.push(("MaxNumScanSsids", last_off));
8414                        break;
8415                    }
8416                }
8417                Nl80211Attrs::ScanFrequencies(val) => {
8418                    if last_off == offset {
8419                        stack.push(("ScanFrequencies", last_off));
8420                        break;
8421                    }
8422                }
8423                Nl80211Attrs::ScanSsids(val) => {
8424                    if last_off == offset {
8425                        stack.push(("ScanSsids", last_off));
8426                        break;
8427                    }
8428                }
8429                Nl80211Attrs::Generation(val) => {
8430                    if last_off == offset {
8431                        stack.push(("Generation", last_off));
8432                        break;
8433                    }
8434                }
8435                Nl80211Attrs::Bss(val) => {
8436                    if last_off == offset {
8437                        stack.push(("Bss", last_off));
8438                        break;
8439                    }
8440                }
8441                Nl80211Attrs::RegInitiator(val) => {
8442                    if last_off == offset {
8443                        stack.push(("RegInitiator", last_off));
8444                        break;
8445                    }
8446                }
8447                Nl80211Attrs::RegType(val) => {
8448                    if last_off == offset {
8449                        stack.push(("RegType", last_off));
8450                        break;
8451                    }
8452                }
8453                Nl80211Attrs::SupportedCommands(val) => {
8454                    if last_off == offset {
8455                        stack.push(("SupportedCommands", last_off));
8456                        break;
8457                    }
8458                }
8459                Nl80211Attrs::Frame(val) => {
8460                    if last_off == offset {
8461                        stack.push(("Frame", last_off));
8462                        break;
8463                    }
8464                }
8465                Nl80211Attrs::Ssid(val) => {
8466                    if last_off == offset {
8467                        stack.push(("Ssid", last_off));
8468                        break;
8469                    }
8470                }
8471                Nl80211Attrs::AuthType(val) => {
8472                    if last_off == offset {
8473                        stack.push(("AuthType", last_off));
8474                        break;
8475                    }
8476                }
8477                Nl80211Attrs::ReasonCode(val) => {
8478                    if last_off == offset {
8479                        stack.push(("ReasonCode", last_off));
8480                        break;
8481                    }
8482                }
8483                Nl80211Attrs::KeyType(val) => {
8484                    if last_off == offset {
8485                        stack.push(("KeyType", last_off));
8486                        break;
8487                    }
8488                }
8489                Nl80211Attrs::MaxScanIeLen(val) => {
8490                    if last_off == offset {
8491                        stack.push(("MaxScanIeLen", last_off));
8492                        break;
8493                    }
8494                }
8495                Nl80211Attrs::CipherSuites(val) => {
8496                    if last_off == offset {
8497                        stack.push(("CipherSuites", last_off));
8498                        break;
8499                    }
8500                }
8501                Nl80211Attrs::FreqBefore(val) => {
8502                    if last_off == offset {
8503                        stack.push(("FreqBefore", last_off));
8504                        break;
8505                    }
8506                }
8507                Nl80211Attrs::FreqAfter(val) => {
8508                    if last_off == offset {
8509                        stack.push(("FreqAfter", last_off));
8510                        break;
8511                    }
8512                }
8513                Nl80211Attrs::FreqFixed(val) => {
8514                    if last_off == offset {
8515                        stack.push(("FreqFixed", last_off));
8516                        break;
8517                    }
8518                }
8519                Nl80211Attrs::WiphyRetryShort(val) => {
8520                    if last_off == offset {
8521                        stack.push(("WiphyRetryShort", last_off));
8522                        break;
8523                    }
8524                }
8525                Nl80211Attrs::WiphyRetryLong(val) => {
8526                    if last_off == offset {
8527                        stack.push(("WiphyRetryLong", last_off));
8528                        break;
8529                    }
8530                }
8531                Nl80211Attrs::WiphyFragThreshold(val) => {
8532                    if last_off == offset {
8533                        stack.push(("WiphyFragThreshold", last_off));
8534                        break;
8535                    }
8536                }
8537                Nl80211Attrs::WiphyRtsThreshold(val) => {
8538                    if last_off == offset {
8539                        stack.push(("WiphyRtsThreshold", last_off));
8540                        break;
8541                    }
8542                }
8543                Nl80211Attrs::TimedOut(val) => {
8544                    if last_off == offset {
8545                        stack.push(("TimedOut", last_off));
8546                        break;
8547                    }
8548                }
8549                Nl80211Attrs::UseMfp(val) => {
8550                    if last_off == offset {
8551                        stack.push(("UseMfp", last_off));
8552                        break;
8553                    }
8554                }
8555                Nl80211Attrs::StaFlags2(val) => {
8556                    if last_off == offset {
8557                        stack.push(("StaFlags2", last_off));
8558                        break;
8559                    }
8560                }
8561                Nl80211Attrs::ControlPort(val) => {
8562                    if last_off == offset {
8563                        stack.push(("ControlPort", last_off));
8564                        break;
8565                    }
8566                }
8567                Nl80211Attrs::Testdata(val) => {
8568                    if last_off == offset {
8569                        stack.push(("Testdata", last_off));
8570                        break;
8571                    }
8572                }
8573                Nl80211Attrs::Privacy(val) => {
8574                    if last_off == offset {
8575                        stack.push(("Privacy", last_off));
8576                        break;
8577                    }
8578                }
8579                Nl80211Attrs::DisconnectedByAp(val) => {
8580                    if last_off == offset {
8581                        stack.push(("DisconnectedByAp", last_off));
8582                        break;
8583                    }
8584                }
8585                Nl80211Attrs::StatusCode(val) => {
8586                    if last_off == offset {
8587                        stack.push(("StatusCode", last_off));
8588                        break;
8589                    }
8590                }
8591                Nl80211Attrs::CipherSuitesPairwise(val) => {
8592                    if last_off == offset {
8593                        stack.push(("CipherSuitesPairwise", last_off));
8594                        break;
8595                    }
8596                }
8597                Nl80211Attrs::CipherSuiteGroup(val) => {
8598                    if last_off == offset {
8599                        stack.push(("CipherSuiteGroup", last_off));
8600                        break;
8601                    }
8602                }
8603                Nl80211Attrs::WpaVersions(val) => {
8604                    if last_off == offset {
8605                        stack.push(("WpaVersions", last_off));
8606                        break;
8607                    }
8608                }
8609                Nl80211Attrs::AkmSuites(val) => {
8610                    if last_off == offset {
8611                        stack.push(("AkmSuites", last_off));
8612                        break;
8613                    }
8614                }
8615                Nl80211Attrs::ReqIe(val) => {
8616                    if last_off == offset {
8617                        stack.push(("ReqIe", last_off));
8618                        break;
8619                    }
8620                }
8621                Nl80211Attrs::RespIe(val) => {
8622                    if last_off == offset {
8623                        stack.push(("RespIe", last_off));
8624                        break;
8625                    }
8626                }
8627                Nl80211Attrs::PrevBssid(val) => {
8628                    if last_off == offset {
8629                        stack.push(("PrevBssid", last_off));
8630                        break;
8631                    }
8632                }
8633                Nl80211Attrs::Key(val) => {
8634                    if last_off == offset {
8635                        stack.push(("Key", last_off));
8636                        break;
8637                    }
8638                }
8639                Nl80211Attrs::Keys(val) => {
8640                    if last_off == offset {
8641                        stack.push(("Keys", last_off));
8642                        break;
8643                    }
8644                }
8645                Nl80211Attrs::Pid(val) => {
8646                    if last_off == offset {
8647                        stack.push(("Pid", last_off));
8648                        break;
8649                    }
8650                }
8651                Nl80211Attrs::_4addr(val) => {
8652                    if last_off == offset {
8653                        stack.push(("4addr", last_off));
8654                        break;
8655                    }
8656                }
8657                Nl80211Attrs::SurveyInfo(val) => {
8658                    if last_off == offset {
8659                        stack.push(("SurveyInfo", last_off));
8660                        break;
8661                    }
8662                }
8663                Nl80211Attrs::Pmkid(val) => {
8664                    if last_off == offset {
8665                        stack.push(("Pmkid", last_off));
8666                        break;
8667                    }
8668                }
8669                Nl80211Attrs::MaxNumPmkids(val) => {
8670                    if last_off == offset {
8671                        stack.push(("MaxNumPmkids", last_off));
8672                        break;
8673                    }
8674                }
8675                Nl80211Attrs::Duration(val) => {
8676                    if last_off == offset {
8677                        stack.push(("Duration", last_off));
8678                        break;
8679                    }
8680                }
8681                Nl80211Attrs::Cookie(val) => {
8682                    if last_off == offset {
8683                        stack.push(("Cookie", last_off));
8684                        break;
8685                    }
8686                }
8687                Nl80211Attrs::WiphyCoverageClass(val) => {
8688                    if last_off == offset {
8689                        stack.push(("WiphyCoverageClass", last_off));
8690                        break;
8691                    }
8692                }
8693                Nl80211Attrs::TxRates(val) => {
8694                    if last_off == offset {
8695                        stack.push(("TxRates", last_off));
8696                        break;
8697                    }
8698                }
8699                Nl80211Attrs::FrameMatch(val) => {
8700                    if last_off == offset {
8701                        stack.push(("FrameMatch", last_off));
8702                        break;
8703                    }
8704                }
8705                Nl80211Attrs::Ack(val) => {
8706                    if last_off == offset {
8707                        stack.push(("Ack", last_off));
8708                        break;
8709                    }
8710                }
8711                Nl80211Attrs::PsState(val) => {
8712                    if last_off == offset {
8713                        stack.push(("PsState", last_off));
8714                        break;
8715                    }
8716                }
8717                Nl80211Attrs::Cqm(val) => {
8718                    if last_off == offset {
8719                        stack.push(("Cqm", last_off));
8720                        break;
8721                    }
8722                }
8723                Nl80211Attrs::LocalStateChange(val) => {
8724                    if last_off == offset {
8725                        stack.push(("LocalStateChange", last_off));
8726                        break;
8727                    }
8728                }
8729                Nl80211Attrs::ApIsolate(val) => {
8730                    if last_off == offset {
8731                        stack.push(("ApIsolate", last_off));
8732                        break;
8733                    }
8734                }
8735                Nl80211Attrs::WiphyTxPowerSetting(val) => {
8736                    if last_off == offset {
8737                        stack.push(("WiphyTxPowerSetting", last_off));
8738                        break;
8739                    }
8740                }
8741                Nl80211Attrs::WiphyTxPowerLevel(val) => {
8742                    if last_off == offset {
8743                        stack.push(("WiphyTxPowerLevel", last_off));
8744                        break;
8745                    }
8746                }
8747                Nl80211Attrs::TxFrameTypes(val) => {
8748                    (stack, missing) = val.lookup_attr(offset, missing_type);
8749                    if !stack.is_empty() {
8750                        break;
8751                    }
8752                }
8753                Nl80211Attrs::RxFrameTypes(val) => {
8754                    (stack, missing) = val.lookup_attr(offset, missing_type);
8755                    if !stack.is_empty() {
8756                        break;
8757                    }
8758                }
8759                Nl80211Attrs::FrameType(val) => {
8760                    if last_off == offset {
8761                        stack.push(("FrameType", last_off));
8762                        break;
8763                    }
8764                }
8765                Nl80211Attrs::ControlPortEthertype(val) => {
8766                    if last_off == offset {
8767                        stack.push(("ControlPortEthertype", last_off));
8768                        break;
8769                    }
8770                }
8771                Nl80211Attrs::ControlPortNoEncrypt(val) => {
8772                    if last_off == offset {
8773                        stack.push(("ControlPortNoEncrypt", last_off));
8774                        break;
8775                    }
8776                }
8777                Nl80211Attrs::SupportIbssRsn(val) => {
8778                    if last_off == offset {
8779                        stack.push(("SupportIbssRsn", last_off));
8780                        break;
8781                    }
8782                }
8783                Nl80211Attrs::WiphyAntennaTx(val) => {
8784                    if last_off == offset {
8785                        stack.push(("WiphyAntennaTx", last_off));
8786                        break;
8787                    }
8788                }
8789                Nl80211Attrs::WiphyAntennaRx(val) => {
8790                    if last_off == offset {
8791                        stack.push(("WiphyAntennaRx", last_off));
8792                        break;
8793                    }
8794                }
8795                Nl80211Attrs::McastRate(val) => {
8796                    if last_off == offset {
8797                        stack.push(("McastRate", last_off));
8798                        break;
8799                    }
8800                }
8801                Nl80211Attrs::OffchannelTxOk(val) => {
8802                    if last_off == offset {
8803                        stack.push(("OffchannelTxOk", last_off));
8804                        break;
8805                    }
8806                }
8807                Nl80211Attrs::BssHtOpmode(val) => {
8808                    if last_off == offset {
8809                        stack.push(("BssHtOpmode", last_off));
8810                        break;
8811                    }
8812                }
8813                Nl80211Attrs::KeyDefaultTypes(val) => {
8814                    if last_off == offset {
8815                        stack.push(("KeyDefaultTypes", last_off));
8816                        break;
8817                    }
8818                }
8819                Nl80211Attrs::MaxRemainOnChannelDuration(val) => {
8820                    if last_off == offset {
8821                        stack.push(("MaxRemainOnChannelDuration", last_off));
8822                        break;
8823                    }
8824                }
8825                Nl80211Attrs::MeshSetup(val) => {
8826                    if last_off == offset {
8827                        stack.push(("MeshSetup", last_off));
8828                        break;
8829                    }
8830                }
8831                Nl80211Attrs::WiphyAntennaAvailTx(val) => {
8832                    if last_off == offset {
8833                        stack.push(("WiphyAntennaAvailTx", last_off));
8834                        break;
8835                    }
8836                }
8837                Nl80211Attrs::WiphyAntennaAvailRx(val) => {
8838                    if last_off == offset {
8839                        stack.push(("WiphyAntennaAvailRx", last_off));
8840                        break;
8841                    }
8842                }
8843                Nl80211Attrs::SupportMeshAuth(val) => {
8844                    if last_off == offset {
8845                        stack.push(("SupportMeshAuth", last_off));
8846                        break;
8847                    }
8848                }
8849                Nl80211Attrs::StaPlinkState(val) => {
8850                    if last_off == offset {
8851                        stack.push(("StaPlinkState", last_off));
8852                        break;
8853                    }
8854                }
8855                Nl80211Attrs::WowlanTriggers(val) => {
8856                    if last_off == offset {
8857                        stack.push(("WowlanTriggers", last_off));
8858                        break;
8859                    }
8860                }
8861                Nl80211Attrs::WowlanTriggersSupported(val) => {
8862                    (stack, missing) = val.lookup_attr(offset, missing_type);
8863                    if !stack.is_empty() {
8864                        break;
8865                    }
8866                }
8867                Nl80211Attrs::SchedScanInterval(val) => {
8868                    if last_off == offset {
8869                        stack.push(("SchedScanInterval", last_off));
8870                        break;
8871                    }
8872                }
8873                Nl80211Attrs::InterfaceCombinations(val) => {
8874                    for entry in val {
8875                        let Ok(attr) = entry else { break };
8876                        (stack, missing) = attr.lookup_attr(offset, missing_type);
8877                        if !stack.is_empty() {
8878                            break;
8879                        }
8880                    }
8881                    if !stack.is_empty() {
8882                        stack.push(("InterfaceCombinations", last_off));
8883                        break;
8884                    }
8885                }
8886                Nl80211Attrs::SoftwareIftypes(val) => {
8887                    (stack, missing) = val.lookup_attr(offset, missing_type);
8888                    if !stack.is_empty() {
8889                        break;
8890                    }
8891                }
8892                Nl80211Attrs::RekeyData(val) => {
8893                    if last_off == offset {
8894                        stack.push(("RekeyData", last_off));
8895                        break;
8896                    }
8897                }
8898                Nl80211Attrs::MaxNumSchedScanSsids(val) => {
8899                    if last_off == offset {
8900                        stack.push(("MaxNumSchedScanSsids", last_off));
8901                        break;
8902                    }
8903                }
8904                Nl80211Attrs::MaxSchedScanIeLen(val) => {
8905                    if last_off == offset {
8906                        stack.push(("MaxSchedScanIeLen", last_off));
8907                        break;
8908                    }
8909                }
8910                Nl80211Attrs::ScanSuppRates(val) => {
8911                    if last_off == offset {
8912                        stack.push(("ScanSuppRates", last_off));
8913                        break;
8914                    }
8915                }
8916                Nl80211Attrs::HiddenSsid(val) => {
8917                    if last_off == offset {
8918                        stack.push(("HiddenSsid", last_off));
8919                        break;
8920                    }
8921                }
8922                Nl80211Attrs::IeProbeResp(val) => {
8923                    if last_off == offset {
8924                        stack.push(("IeProbeResp", last_off));
8925                        break;
8926                    }
8927                }
8928                Nl80211Attrs::IeAssocResp(val) => {
8929                    if last_off == offset {
8930                        stack.push(("IeAssocResp", last_off));
8931                        break;
8932                    }
8933                }
8934                Nl80211Attrs::StaWme(val) => {
8935                    if last_off == offset {
8936                        stack.push(("StaWme", last_off));
8937                        break;
8938                    }
8939                }
8940                Nl80211Attrs::SupportApUapsd(val) => {
8941                    if last_off == offset {
8942                        stack.push(("SupportApUapsd", last_off));
8943                        break;
8944                    }
8945                }
8946                Nl80211Attrs::RoamSupport(val) => {
8947                    if last_off == offset {
8948                        stack.push(("RoamSupport", last_off));
8949                        break;
8950                    }
8951                }
8952                Nl80211Attrs::SchedScanMatch(val) => {
8953                    if last_off == offset {
8954                        stack.push(("SchedScanMatch", last_off));
8955                        break;
8956                    }
8957                }
8958                Nl80211Attrs::MaxMatchSets(val) => {
8959                    if last_off == offset {
8960                        stack.push(("MaxMatchSets", last_off));
8961                        break;
8962                    }
8963                }
8964                Nl80211Attrs::PmksaCandidate(val) => {
8965                    if last_off == offset {
8966                        stack.push(("PmksaCandidate", last_off));
8967                        break;
8968                    }
8969                }
8970                Nl80211Attrs::TxNoCckRate(val) => {
8971                    if last_off == offset {
8972                        stack.push(("TxNoCckRate", last_off));
8973                        break;
8974                    }
8975                }
8976                Nl80211Attrs::TdlsAction(val) => {
8977                    if last_off == offset {
8978                        stack.push(("TdlsAction", last_off));
8979                        break;
8980                    }
8981                }
8982                Nl80211Attrs::TdlsDialogToken(val) => {
8983                    if last_off == offset {
8984                        stack.push(("TdlsDialogToken", last_off));
8985                        break;
8986                    }
8987                }
8988                Nl80211Attrs::TdlsOperation(val) => {
8989                    if last_off == offset {
8990                        stack.push(("TdlsOperation", last_off));
8991                        break;
8992                    }
8993                }
8994                Nl80211Attrs::TdlsSupport(val) => {
8995                    if last_off == offset {
8996                        stack.push(("TdlsSupport", last_off));
8997                        break;
8998                    }
8999                }
9000                Nl80211Attrs::TdlsExternalSetup(val) => {
9001                    if last_off == offset {
9002                        stack.push(("TdlsExternalSetup", last_off));
9003                        break;
9004                    }
9005                }
9006                Nl80211Attrs::DeviceApSme(val) => {
9007                    if last_off == offset {
9008                        stack.push(("DeviceApSme", last_off));
9009                        break;
9010                    }
9011                }
9012                Nl80211Attrs::DontWaitForAck(val) => {
9013                    if last_off == offset {
9014                        stack.push(("DontWaitForAck", last_off));
9015                        break;
9016                    }
9017                }
9018                Nl80211Attrs::FeatureFlags(val) => {
9019                    if last_off == offset {
9020                        stack.push(("FeatureFlags", last_off));
9021                        break;
9022                    }
9023                }
9024                Nl80211Attrs::ProbeRespOffload(val) => {
9025                    if last_off == offset {
9026                        stack.push(("ProbeRespOffload", last_off));
9027                        break;
9028                    }
9029                }
9030                Nl80211Attrs::ProbeResp(val) => {
9031                    if last_off == offset {
9032                        stack.push(("ProbeResp", last_off));
9033                        break;
9034                    }
9035                }
9036                Nl80211Attrs::DfsRegion(val) => {
9037                    if last_off == offset {
9038                        stack.push(("DfsRegion", last_off));
9039                        break;
9040                    }
9041                }
9042                Nl80211Attrs::DisableHt(val) => {
9043                    if last_off == offset {
9044                        stack.push(("DisableHt", last_off));
9045                        break;
9046                    }
9047                }
9048                Nl80211Attrs::HtCapabilityMask(val) => {
9049                    if last_off == offset {
9050                        stack.push(("HtCapabilityMask", last_off));
9051                        break;
9052                    }
9053                }
9054                Nl80211Attrs::NoackMap(val) => {
9055                    if last_off == offset {
9056                        stack.push(("NoackMap", last_off));
9057                        break;
9058                    }
9059                }
9060                Nl80211Attrs::InactivityTimeout(val) => {
9061                    if last_off == offset {
9062                        stack.push(("InactivityTimeout", last_off));
9063                        break;
9064                    }
9065                }
9066                Nl80211Attrs::RxSignalDbm(val) => {
9067                    if last_off == offset {
9068                        stack.push(("RxSignalDbm", last_off));
9069                        break;
9070                    }
9071                }
9072                Nl80211Attrs::BgScanPeriod(val) => {
9073                    if last_off == offset {
9074                        stack.push(("BgScanPeriod", last_off));
9075                        break;
9076                    }
9077                }
9078                Nl80211Attrs::Wdev(val) => {
9079                    if last_off == offset {
9080                        stack.push(("Wdev", last_off));
9081                        break;
9082                    }
9083                }
9084                Nl80211Attrs::UserRegHintType(val) => {
9085                    if last_off == offset {
9086                        stack.push(("UserRegHintType", last_off));
9087                        break;
9088                    }
9089                }
9090                Nl80211Attrs::ConnFailedReason(val) => {
9091                    if last_off == offset {
9092                        stack.push(("ConnFailedReason", last_off));
9093                        break;
9094                    }
9095                }
9096                Nl80211Attrs::AuthData(val) => {
9097                    if last_off == offset {
9098                        stack.push(("AuthData", last_off));
9099                        break;
9100                    }
9101                }
9102                Nl80211Attrs::VhtCapability(val) => {
9103                    if last_off == offset {
9104                        stack.push(("VhtCapability", last_off));
9105                        break;
9106                    }
9107                }
9108                Nl80211Attrs::ScanFlags(val) => {
9109                    if last_off == offset {
9110                        stack.push(("ScanFlags", last_off));
9111                        break;
9112                    }
9113                }
9114                Nl80211Attrs::ChannelWidth(val) => {
9115                    if last_off == offset {
9116                        stack.push(("ChannelWidth", last_off));
9117                        break;
9118                    }
9119                }
9120                Nl80211Attrs::CenterFreq1(val) => {
9121                    if last_off == offset {
9122                        stack.push(("CenterFreq1", last_off));
9123                        break;
9124                    }
9125                }
9126                Nl80211Attrs::CenterFreq2(val) => {
9127                    if last_off == offset {
9128                        stack.push(("CenterFreq2", last_off));
9129                        break;
9130                    }
9131                }
9132                Nl80211Attrs::P2pCtwindow(val) => {
9133                    if last_off == offset {
9134                        stack.push(("P2pCtwindow", last_off));
9135                        break;
9136                    }
9137                }
9138                Nl80211Attrs::P2pOppps(val) => {
9139                    if last_off == offset {
9140                        stack.push(("P2pOppps", last_off));
9141                        break;
9142                    }
9143                }
9144                Nl80211Attrs::LocalMeshPowerMode(val) => {
9145                    if last_off == offset {
9146                        stack.push(("LocalMeshPowerMode", last_off));
9147                        break;
9148                    }
9149                }
9150                Nl80211Attrs::AclPolicy(val) => {
9151                    if last_off == offset {
9152                        stack.push(("AclPolicy", last_off));
9153                        break;
9154                    }
9155                }
9156                Nl80211Attrs::MacAddrs(val) => {
9157                    if last_off == offset {
9158                        stack.push(("MacAddrs", last_off));
9159                        break;
9160                    }
9161                }
9162                Nl80211Attrs::MacAclMax(val) => {
9163                    if last_off == offset {
9164                        stack.push(("MacAclMax", last_off));
9165                        break;
9166                    }
9167                }
9168                Nl80211Attrs::RadarEvent(val) => {
9169                    if last_off == offset {
9170                        stack.push(("RadarEvent", last_off));
9171                        break;
9172                    }
9173                }
9174                Nl80211Attrs::ExtCapa(val) => {
9175                    if last_off == offset {
9176                        stack.push(("ExtCapa", last_off));
9177                        break;
9178                    }
9179                }
9180                Nl80211Attrs::ExtCapaMask(val) => {
9181                    if last_off == offset {
9182                        stack.push(("ExtCapaMask", last_off));
9183                        break;
9184                    }
9185                }
9186                Nl80211Attrs::StaCapability(val) => {
9187                    if last_off == offset {
9188                        stack.push(("StaCapability", last_off));
9189                        break;
9190                    }
9191                }
9192                Nl80211Attrs::StaExtCapability(val) => {
9193                    if last_off == offset {
9194                        stack.push(("StaExtCapability", last_off));
9195                        break;
9196                    }
9197                }
9198                Nl80211Attrs::ProtocolFeatures(val) => {
9199                    if last_off == offset {
9200                        stack.push(("ProtocolFeatures", last_off));
9201                        break;
9202                    }
9203                }
9204                Nl80211Attrs::SplitWiphyDump(val) => {
9205                    if last_off == offset {
9206                        stack.push(("SplitWiphyDump", last_off));
9207                        break;
9208                    }
9209                }
9210                Nl80211Attrs::DisableVht(val) => {
9211                    if last_off == offset {
9212                        stack.push(("DisableVht", last_off));
9213                        break;
9214                    }
9215                }
9216                Nl80211Attrs::VhtCapabilityMask(val) => {
9217                    if last_off == offset {
9218                        stack.push(("VhtCapabilityMask", last_off));
9219                        break;
9220                    }
9221                }
9222                Nl80211Attrs::Mdid(val) => {
9223                    if last_off == offset {
9224                        stack.push(("Mdid", last_off));
9225                        break;
9226                    }
9227                }
9228                Nl80211Attrs::IeRic(val) => {
9229                    if last_off == offset {
9230                        stack.push(("IeRic", last_off));
9231                        break;
9232                    }
9233                }
9234                Nl80211Attrs::CritProtId(val) => {
9235                    if last_off == offset {
9236                        stack.push(("CritProtId", last_off));
9237                        break;
9238                    }
9239                }
9240                Nl80211Attrs::MaxCritProtDuration(val) => {
9241                    if last_off == offset {
9242                        stack.push(("MaxCritProtDuration", last_off));
9243                        break;
9244                    }
9245                }
9246                Nl80211Attrs::PeerAid(val) => {
9247                    if last_off == offset {
9248                        stack.push(("PeerAid", last_off));
9249                        break;
9250                    }
9251                }
9252                Nl80211Attrs::CoalesceRule(val) => {
9253                    if last_off == offset {
9254                        stack.push(("CoalesceRule", last_off));
9255                        break;
9256                    }
9257                }
9258                Nl80211Attrs::ChSwitchCount(val) => {
9259                    if last_off == offset {
9260                        stack.push(("ChSwitchCount", last_off));
9261                        break;
9262                    }
9263                }
9264                Nl80211Attrs::ChSwitchBlockTx(val) => {
9265                    if last_off == offset {
9266                        stack.push(("ChSwitchBlockTx", last_off));
9267                        break;
9268                    }
9269                }
9270                Nl80211Attrs::CsaIes(val) => {
9271                    if last_off == offset {
9272                        stack.push(("CsaIes", last_off));
9273                        break;
9274                    }
9275                }
9276                Nl80211Attrs::CntdwnOffsBeacon(val) => {
9277                    if last_off == offset {
9278                        stack.push(("CntdwnOffsBeacon", last_off));
9279                        break;
9280                    }
9281                }
9282                Nl80211Attrs::CntdwnOffsPresp(val) => {
9283                    if last_off == offset {
9284                        stack.push(("CntdwnOffsPresp", last_off));
9285                        break;
9286                    }
9287                }
9288                Nl80211Attrs::RxmgmtFlags(val) => {
9289                    if last_off == offset {
9290                        stack.push(("RxmgmtFlags", last_off));
9291                        break;
9292                    }
9293                }
9294                Nl80211Attrs::StaSupportedChannels(val) => {
9295                    if last_off == offset {
9296                        stack.push(("StaSupportedChannels", last_off));
9297                        break;
9298                    }
9299                }
9300                Nl80211Attrs::StaSupportedOperClasses(val) => {
9301                    if last_off == offset {
9302                        stack.push(("StaSupportedOperClasses", last_off));
9303                        break;
9304                    }
9305                }
9306                Nl80211Attrs::HandleDfs(val) => {
9307                    if last_off == offset {
9308                        stack.push(("HandleDfs", last_off));
9309                        break;
9310                    }
9311                }
9312                Nl80211Attrs::Support5Mhz(val) => {
9313                    if last_off == offset {
9314                        stack.push(("Support5Mhz", last_off));
9315                        break;
9316                    }
9317                }
9318                Nl80211Attrs::Support10Mhz(val) => {
9319                    if last_off == offset {
9320                        stack.push(("Support10Mhz", last_off));
9321                        break;
9322                    }
9323                }
9324                Nl80211Attrs::OpmodeNotif(val) => {
9325                    if last_off == offset {
9326                        stack.push(("OpmodeNotif", last_off));
9327                        break;
9328                    }
9329                }
9330                Nl80211Attrs::VendorId(val) => {
9331                    if last_off == offset {
9332                        stack.push(("VendorId", last_off));
9333                        break;
9334                    }
9335                }
9336                Nl80211Attrs::VendorSubcmd(val) => {
9337                    if last_off == offset {
9338                        stack.push(("VendorSubcmd", last_off));
9339                        break;
9340                    }
9341                }
9342                Nl80211Attrs::VendorData(val) => {
9343                    if last_off == offset {
9344                        stack.push(("VendorData", last_off));
9345                        break;
9346                    }
9347                }
9348                Nl80211Attrs::VendorEvents(val) => {
9349                    if last_off == offset {
9350                        stack.push(("VendorEvents", last_off));
9351                        break;
9352                    }
9353                }
9354                Nl80211Attrs::QosMap(val) => {
9355                    if last_off == offset {
9356                        stack.push(("QosMap", last_off));
9357                        break;
9358                    }
9359                }
9360                Nl80211Attrs::MacHint(val) => {
9361                    if last_off == offset {
9362                        stack.push(("MacHint", last_off));
9363                        break;
9364                    }
9365                }
9366                Nl80211Attrs::WiphyFreqHint(val) => {
9367                    if last_off == offset {
9368                        stack.push(("WiphyFreqHint", last_off));
9369                        break;
9370                    }
9371                }
9372                Nl80211Attrs::MaxApAssocSta(val) => {
9373                    if last_off == offset {
9374                        stack.push(("MaxApAssocSta", last_off));
9375                        break;
9376                    }
9377                }
9378                Nl80211Attrs::TdlsPeerCapability(val) => {
9379                    if last_off == offset {
9380                        stack.push(("TdlsPeerCapability", last_off));
9381                        break;
9382                    }
9383                }
9384                Nl80211Attrs::SocketOwner(val) => {
9385                    if last_off == offset {
9386                        stack.push(("SocketOwner", last_off));
9387                        break;
9388                    }
9389                }
9390                Nl80211Attrs::CsaCOffsetsTx(val) => {
9391                    if last_off == offset {
9392                        stack.push(("CsaCOffsetsTx", last_off));
9393                        break;
9394                    }
9395                }
9396                Nl80211Attrs::MaxCsaCounters(val) => {
9397                    if last_off == offset {
9398                        stack.push(("MaxCsaCounters", last_off));
9399                        break;
9400                    }
9401                }
9402                Nl80211Attrs::TdlsInitiator(val) => {
9403                    if last_off == offset {
9404                        stack.push(("TdlsInitiator", last_off));
9405                        break;
9406                    }
9407                }
9408                Nl80211Attrs::UseRrm(val) => {
9409                    if last_off == offset {
9410                        stack.push(("UseRrm", last_off));
9411                        break;
9412                    }
9413                }
9414                Nl80211Attrs::WiphyDynAck(val) => {
9415                    if last_off == offset {
9416                        stack.push(("WiphyDynAck", last_off));
9417                        break;
9418                    }
9419                }
9420                Nl80211Attrs::Tsid(val) => {
9421                    if last_off == offset {
9422                        stack.push(("Tsid", last_off));
9423                        break;
9424                    }
9425                }
9426                Nl80211Attrs::UserPrio(val) => {
9427                    if last_off == offset {
9428                        stack.push(("UserPrio", last_off));
9429                        break;
9430                    }
9431                }
9432                Nl80211Attrs::AdmittedTime(val) => {
9433                    if last_off == offset {
9434                        stack.push(("AdmittedTime", last_off));
9435                        break;
9436                    }
9437                }
9438                Nl80211Attrs::SmpsMode(val) => {
9439                    if last_off == offset {
9440                        stack.push(("SmpsMode", last_off));
9441                        break;
9442                    }
9443                }
9444                Nl80211Attrs::OperClass(val) => {
9445                    if last_off == offset {
9446                        stack.push(("OperClass", last_off));
9447                        break;
9448                    }
9449                }
9450                Nl80211Attrs::MacMask(val) => {
9451                    if last_off == offset {
9452                        stack.push(("MacMask", last_off));
9453                        break;
9454                    }
9455                }
9456                Nl80211Attrs::WiphySelfManagedReg(val) => {
9457                    if last_off == offset {
9458                        stack.push(("WiphySelfManagedReg", last_off));
9459                        break;
9460                    }
9461                }
9462                Nl80211Attrs::ExtFeatures(val) => {
9463                    if last_off == offset {
9464                        stack.push(("ExtFeatures", last_off));
9465                        break;
9466                    }
9467                }
9468                Nl80211Attrs::SurveyRadioStats(val) => {
9469                    if last_off == offset {
9470                        stack.push(("SurveyRadioStats", last_off));
9471                        break;
9472                    }
9473                }
9474                Nl80211Attrs::NetnsFd(val) => {
9475                    if last_off == offset {
9476                        stack.push(("NetnsFd", last_off));
9477                        break;
9478                    }
9479                }
9480                Nl80211Attrs::SchedScanDelay(val) => {
9481                    if last_off == offset {
9482                        stack.push(("SchedScanDelay", last_off));
9483                        break;
9484                    }
9485                }
9486                Nl80211Attrs::RegIndoor(val) => {
9487                    if last_off == offset {
9488                        stack.push(("RegIndoor", last_off));
9489                        break;
9490                    }
9491                }
9492                Nl80211Attrs::MaxNumSchedScanPlans(val) => {
9493                    if last_off == offset {
9494                        stack.push(("MaxNumSchedScanPlans", last_off));
9495                        break;
9496                    }
9497                }
9498                Nl80211Attrs::MaxScanPlanInterval(val) => {
9499                    if last_off == offset {
9500                        stack.push(("MaxScanPlanInterval", last_off));
9501                        break;
9502                    }
9503                }
9504                Nl80211Attrs::MaxScanPlanIterations(val) => {
9505                    if last_off == offset {
9506                        stack.push(("MaxScanPlanIterations", last_off));
9507                        break;
9508                    }
9509                }
9510                Nl80211Attrs::SchedScanPlans(val) => {
9511                    if last_off == offset {
9512                        stack.push(("SchedScanPlans", last_off));
9513                        break;
9514                    }
9515                }
9516                Nl80211Attrs::Pbss(val) => {
9517                    if last_off == offset {
9518                        stack.push(("Pbss", last_off));
9519                        break;
9520                    }
9521                }
9522                Nl80211Attrs::BssSelect(val) => {
9523                    if last_off == offset {
9524                        stack.push(("BssSelect", last_off));
9525                        break;
9526                    }
9527                }
9528                Nl80211Attrs::StaSupportP2pPs(val) => {
9529                    if last_off == offset {
9530                        stack.push(("StaSupportP2pPs", last_off));
9531                        break;
9532                    }
9533                }
9534                Nl80211Attrs::Pad(val) => {
9535                    if last_off == offset {
9536                        stack.push(("Pad", last_off));
9537                        break;
9538                    }
9539                }
9540                Nl80211Attrs::IftypeExtCapa(val) => {
9541                    if last_off == offset {
9542                        stack.push(("IftypeExtCapa", last_off));
9543                        break;
9544                    }
9545                }
9546                Nl80211Attrs::MuMimoGroupData(val) => {
9547                    if last_off == offset {
9548                        stack.push(("MuMimoGroupData", last_off));
9549                        break;
9550                    }
9551                }
9552                Nl80211Attrs::MuMimoFollowMacAddr(val) => {
9553                    if last_off == offset {
9554                        stack.push(("MuMimoFollowMacAddr", last_off));
9555                        break;
9556                    }
9557                }
9558                Nl80211Attrs::ScanStartTimeTsf(val) => {
9559                    if last_off == offset {
9560                        stack.push(("ScanStartTimeTsf", last_off));
9561                        break;
9562                    }
9563                }
9564                Nl80211Attrs::ScanStartTimeTsfBssid(val) => {
9565                    if last_off == offset {
9566                        stack.push(("ScanStartTimeTsfBssid", last_off));
9567                        break;
9568                    }
9569                }
9570                Nl80211Attrs::MeasurementDuration(val) => {
9571                    if last_off == offset {
9572                        stack.push(("MeasurementDuration", last_off));
9573                        break;
9574                    }
9575                }
9576                Nl80211Attrs::MeasurementDurationMandatory(val) => {
9577                    if last_off == offset {
9578                        stack.push(("MeasurementDurationMandatory", last_off));
9579                        break;
9580                    }
9581                }
9582                Nl80211Attrs::MeshPeerAid(val) => {
9583                    if last_off == offset {
9584                        stack.push(("MeshPeerAid", last_off));
9585                        break;
9586                    }
9587                }
9588                Nl80211Attrs::NanMasterPref(val) => {
9589                    if last_off == offset {
9590                        stack.push(("NanMasterPref", last_off));
9591                        break;
9592                    }
9593                }
9594                Nl80211Attrs::Bands(val) => {
9595                    if last_off == offset {
9596                        stack.push(("Bands", last_off));
9597                        break;
9598                    }
9599                }
9600                Nl80211Attrs::NanFunc(val) => {
9601                    if last_off == offset {
9602                        stack.push(("NanFunc", last_off));
9603                        break;
9604                    }
9605                }
9606                Nl80211Attrs::NanMatch(val) => {
9607                    if last_off == offset {
9608                        stack.push(("NanMatch", last_off));
9609                        break;
9610                    }
9611                }
9612                Nl80211Attrs::FilsKek(val) => {
9613                    if last_off == offset {
9614                        stack.push(("FilsKek", last_off));
9615                        break;
9616                    }
9617                }
9618                Nl80211Attrs::FilsNonces(val) => {
9619                    if last_off == offset {
9620                        stack.push(("FilsNonces", last_off));
9621                        break;
9622                    }
9623                }
9624                Nl80211Attrs::MulticastToUnicastEnabled(val) => {
9625                    if last_off == offset {
9626                        stack.push(("MulticastToUnicastEnabled", last_off));
9627                        break;
9628                    }
9629                }
9630                Nl80211Attrs::Bssid(val) => {
9631                    if last_off == offset {
9632                        stack.push(("Bssid", last_off));
9633                        break;
9634                    }
9635                }
9636                Nl80211Attrs::SchedScanRelativeRssi(val) => {
9637                    if last_off == offset {
9638                        stack.push(("SchedScanRelativeRssi", last_off));
9639                        break;
9640                    }
9641                }
9642                Nl80211Attrs::SchedScanRssiAdjust(val) => {
9643                    if last_off == offset {
9644                        stack.push(("SchedScanRssiAdjust", last_off));
9645                        break;
9646                    }
9647                }
9648                Nl80211Attrs::TimeoutReason(val) => {
9649                    if last_off == offset {
9650                        stack.push(("TimeoutReason", last_off));
9651                        break;
9652                    }
9653                }
9654                Nl80211Attrs::FilsErpUsername(val) => {
9655                    if last_off == offset {
9656                        stack.push(("FilsErpUsername", last_off));
9657                        break;
9658                    }
9659                }
9660                Nl80211Attrs::FilsErpRealm(val) => {
9661                    if last_off == offset {
9662                        stack.push(("FilsErpRealm", last_off));
9663                        break;
9664                    }
9665                }
9666                Nl80211Attrs::FilsErpNextSeqNum(val) => {
9667                    if last_off == offset {
9668                        stack.push(("FilsErpNextSeqNum", last_off));
9669                        break;
9670                    }
9671                }
9672                Nl80211Attrs::FilsErpRrk(val) => {
9673                    if last_off == offset {
9674                        stack.push(("FilsErpRrk", last_off));
9675                        break;
9676                    }
9677                }
9678                Nl80211Attrs::FilsCacheId(val) => {
9679                    if last_off == offset {
9680                        stack.push(("FilsCacheId", last_off));
9681                        break;
9682                    }
9683                }
9684                Nl80211Attrs::Pmk(val) => {
9685                    if last_off == offset {
9686                        stack.push(("Pmk", last_off));
9687                        break;
9688                    }
9689                }
9690                Nl80211Attrs::SchedScanMulti(val) => {
9691                    if last_off == offset {
9692                        stack.push(("SchedScanMulti", last_off));
9693                        break;
9694                    }
9695                }
9696                Nl80211Attrs::SchedScanMaxReqs(val) => {
9697                    if last_off == offset {
9698                        stack.push(("SchedScanMaxReqs", last_off));
9699                        break;
9700                    }
9701                }
9702                Nl80211Attrs::Want1x4wayHs(val) => {
9703                    if last_off == offset {
9704                        stack.push(("Want1x4wayHs", last_off));
9705                        break;
9706                    }
9707                }
9708                Nl80211Attrs::Pmkr0Name(val) => {
9709                    if last_off == offset {
9710                        stack.push(("Pmkr0Name", last_off));
9711                        break;
9712                    }
9713                }
9714                Nl80211Attrs::PortAuthorized(val) => {
9715                    if last_off == offset {
9716                        stack.push(("PortAuthorized", last_off));
9717                        break;
9718                    }
9719                }
9720                Nl80211Attrs::ExternalAuthAction(val) => {
9721                    if last_off == offset {
9722                        stack.push(("ExternalAuthAction", last_off));
9723                        break;
9724                    }
9725                }
9726                Nl80211Attrs::ExternalAuthSupport(val) => {
9727                    if last_off == offset {
9728                        stack.push(("ExternalAuthSupport", last_off));
9729                        break;
9730                    }
9731                }
9732                Nl80211Attrs::Nss(val) => {
9733                    if last_off == offset {
9734                        stack.push(("Nss", last_off));
9735                        break;
9736                    }
9737                }
9738                Nl80211Attrs::AckSignal(val) => {
9739                    if last_off == offset {
9740                        stack.push(("AckSignal", last_off));
9741                        break;
9742                    }
9743                }
9744                Nl80211Attrs::ControlPortOverNl80211(val) => {
9745                    if last_off == offset {
9746                        stack.push(("ControlPortOverNl80211", last_off));
9747                        break;
9748                    }
9749                }
9750                Nl80211Attrs::TxqStats(val) => {
9751                    (stack, missing) = val.lookup_attr(offset, missing_type);
9752                    if !stack.is_empty() {
9753                        break;
9754                    }
9755                }
9756                Nl80211Attrs::TxqLimit(val) => {
9757                    if last_off == offset {
9758                        stack.push(("TxqLimit", last_off));
9759                        break;
9760                    }
9761                }
9762                Nl80211Attrs::TxqMemoryLimit(val) => {
9763                    if last_off == offset {
9764                        stack.push(("TxqMemoryLimit", last_off));
9765                        break;
9766                    }
9767                }
9768                Nl80211Attrs::TxqQuantum(val) => {
9769                    if last_off == offset {
9770                        stack.push(("TxqQuantum", last_off));
9771                        break;
9772                    }
9773                }
9774                Nl80211Attrs::HeCapability(val) => {
9775                    if last_off == offset {
9776                        stack.push(("HeCapability", last_off));
9777                        break;
9778                    }
9779                }
9780                Nl80211Attrs::FtmResponder(val) => {
9781                    if last_off == offset {
9782                        stack.push(("FtmResponder", last_off));
9783                        break;
9784                    }
9785                }
9786                Nl80211Attrs::FtmResponderStats(val) => {
9787                    if last_off == offset {
9788                        stack.push(("FtmResponderStats", last_off));
9789                        break;
9790                    }
9791                }
9792                Nl80211Attrs::Timeout(val) => {
9793                    if last_off == offset {
9794                        stack.push(("Timeout", last_off));
9795                        break;
9796                    }
9797                }
9798                Nl80211Attrs::PeerMeasurements(val) => {
9799                    if last_off == offset {
9800                        stack.push(("PeerMeasurements", last_off));
9801                        break;
9802                    }
9803                }
9804                Nl80211Attrs::AirtimeWeight(val) => {
9805                    if last_off == offset {
9806                        stack.push(("AirtimeWeight", last_off));
9807                        break;
9808                    }
9809                }
9810                Nl80211Attrs::StaTxPowerSetting(val) => {
9811                    if last_off == offset {
9812                        stack.push(("StaTxPowerSetting", last_off));
9813                        break;
9814                    }
9815                }
9816                Nl80211Attrs::StaTxPower(val) => {
9817                    if last_off == offset {
9818                        stack.push(("StaTxPower", last_off));
9819                        break;
9820                    }
9821                }
9822                Nl80211Attrs::SaePassword(val) => {
9823                    if last_off == offset {
9824                        stack.push(("SaePassword", last_off));
9825                        break;
9826                    }
9827                }
9828                Nl80211Attrs::TwtResponder(val) => {
9829                    if last_off == offset {
9830                        stack.push(("TwtResponder", last_off));
9831                        break;
9832                    }
9833                }
9834                Nl80211Attrs::HeObssPd(val) => {
9835                    if last_off == offset {
9836                        stack.push(("HeObssPd", last_off));
9837                        break;
9838                    }
9839                }
9840                Nl80211Attrs::WiphyEdmgChannels(val) => {
9841                    if last_off == offset {
9842                        stack.push(("WiphyEdmgChannels", last_off));
9843                        break;
9844                    }
9845                }
9846                Nl80211Attrs::WiphyEdmgBwConfig(val) => {
9847                    if last_off == offset {
9848                        stack.push(("WiphyEdmgBwConfig", last_off));
9849                        break;
9850                    }
9851                }
9852                Nl80211Attrs::VlanId(val) => {
9853                    if last_off == offset {
9854                        stack.push(("VlanId", last_off));
9855                        break;
9856                    }
9857                }
9858                Nl80211Attrs::HeBssColor(val) => {
9859                    if last_off == offset {
9860                        stack.push(("HeBssColor", last_off));
9861                        break;
9862                    }
9863                }
9864                Nl80211Attrs::IftypeAkmSuites(val) => {
9865                    if last_off == offset {
9866                        stack.push(("IftypeAkmSuites", last_off));
9867                        break;
9868                    }
9869                }
9870                Nl80211Attrs::TidConfig(val) => {
9871                    if last_off == offset {
9872                        stack.push(("TidConfig", last_off));
9873                        break;
9874                    }
9875                }
9876                Nl80211Attrs::ControlPortNoPreauth(val) => {
9877                    if last_off == offset {
9878                        stack.push(("ControlPortNoPreauth", last_off));
9879                        break;
9880                    }
9881                }
9882                Nl80211Attrs::PmkLifetime(val) => {
9883                    if last_off == offset {
9884                        stack.push(("PmkLifetime", last_off));
9885                        break;
9886                    }
9887                }
9888                Nl80211Attrs::PmkReauthThreshold(val) => {
9889                    if last_off == offset {
9890                        stack.push(("PmkReauthThreshold", last_off));
9891                        break;
9892                    }
9893                }
9894                Nl80211Attrs::ReceiveMulticast(val) => {
9895                    if last_off == offset {
9896                        stack.push(("ReceiveMulticast", last_off));
9897                        break;
9898                    }
9899                }
9900                Nl80211Attrs::WiphyFreqOffset(val) => {
9901                    if last_off == offset {
9902                        stack.push(("WiphyFreqOffset", last_off));
9903                        break;
9904                    }
9905                }
9906                Nl80211Attrs::CenterFreq1Offset(val) => {
9907                    if last_off == offset {
9908                        stack.push(("CenterFreq1Offset", last_off));
9909                        break;
9910                    }
9911                }
9912                Nl80211Attrs::ScanFreqKhz(val) => {
9913                    if last_off == offset {
9914                        stack.push(("ScanFreqKhz", last_off));
9915                        break;
9916                    }
9917                }
9918                Nl80211Attrs::He6ghzCapability(val) => {
9919                    if last_off == offset {
9920                        stack.push(("He6ghzCapability", last_off));
9921                        break;
9922                    }
9923                }
9924                Nl80211Attrs::FilsDiscovery(val) => {
9925                    if last_off == offset {
9926                        stack.push(("FilsDiscovery", last_off));
9927                        break;
9928                    }
9929                }
9930                Nl80211Attrs::UnsolBcastProbeResp(val) => {
9931                    if last_off == offset {
9932                        stack.push(("UnsolBcastProbeResp", last_off));
9933                        break;
9934                    }
9935                }
9936                Nl80211Attrs::S1gCapability(val) => {
9937                    if last_off == offset {
9938                        stack.push(("S1gCapability", last_off));
9939                        break;
9940                    }
9941                }
9942                Nl80211Attrs::S1gCapabilityMask(val) => {
9943                    if last_off == offset {
9944                        stack.push(("S1gCapabilityMask", last_off));
9945                        break;
9946                    }
9947                }
9948                Nl80211Attrs::SaePwe(val) => {
9949                    if last_off == offset {
9950                        stack.push(("SaePwe", last_off));
9951                        break;
9952                    }
9953                }
9954                Nl80211Attrs::ReconnectRequested(val) => {
9955                    if last_off == offset {
9956                        stack.push(("ReconnectRequested", last_off));
9957                        break;
9958                    }
9959                }
9960                Nl80211Attrs::SarSpec(val) => {
9961                    (stack, missing) = val.lookup_attr(offset, missing_type);
9962                    if !stack.is_empty() {
9963                        break;
9964                    }
9965                }
9966                Nl80211Attrs::DisableHe(val) => {
9967                    if last_off == offset {
9968                        stack.push(("DisableHe", last_off));
9969                        break;
9970                    }
9971                }
9972                Nl80211Attrs::ObssColorBitmap(val) => {
9973                    if last_off == offset {
9974                        stack.push(("ObssColorBitmap", last_off));
9975                        break;
9976                    }
9977                }
9978                Nl80211Attrs::ColorChangeCount(val) => {
9979                    if last_off == offset {
9980                        stack.push(("ColorChangeCount", last_off));
9981                        break;
9982                    }
9983                }
9984                Nl80211Attrs::ColorChangeColor(val) => {
9985                    if last_off == offset {
9986                        stack.push(("ColorChangeColor", last_off));
9987                        break;
9988                    }
9989                }
9990                Nl80211Attrs::ColorChangeElems(val) => {
9991                    if last_off == offset {
9992                        stack.push(("ColorChangeElems", last_off));
9993                        break;
9994                    }
9995                }
9996                Nl80211Attrs::MbssidConfig(val) => {
9997                    if last_off == offset {
9998                        stack.push(("MbssidConfig", last_off));
9999                        break;
10000                    }
10001                }
10002                Nl80211Attrs::MbssidElems(val) => {
10003                    if last_off == offset {
10004                        stack.push(("MbssidElems", last_off));
10005                        break;
10006                    }
10007                }
10008                Nl80211Attrs::RadarBackground(val) => {
10009                    if last_off == offset {
10010                        stack.push(("RadarBackground", last_off));
10011                        break;
10012                    }
10013                }
10014                Nl80211Attrs::ApSettingsFlags(val) => {
10015                    if last_off == offset {
10016                        stack.push(("ApSettingsFlags", last_off));
10017                        break;
10018                    }
10019                }
10020                Nl80211Attrs::EhtCapability(val) => {
10021                    if last_off == offset {
10022                        stack.push(("EhtCapability", last_off));
10023                        break;
10024                    }
10025                }
10026                Nl80211Attrs::DisableEht(val) => {
10027                    if last_off == offset {
10028                        stack.push(("DisableEht", last_off));
10029                        break;
10030                    }
10031                }
10032                Nl80211Attrs::MloLinks(val) => {
10033                    if last_off == offset {
10034                        stack.push(("MloLinks", last_off));
10035                        break;
10036                    }
10037                }
10038                Nl80211Attrs::MloLinkId(val) => {
10039                    if last_off == offset {
10040                        stack.push(("MloLinkId", last_off));
10041                        break;
10042                    }
10043                }
10044                Nl80211Attrs::MldAddr(val) => {
10045                    if last_off == offset {
10046                        stack.push(("MldAddr", last_off));
10047                        break;
10048                    }
10049                }
10050                Nl80211Attrs::MloSupport(val) => {
10051                    if last_off == offset {
10052                        stack.push(("MloSupport", last_off));
10053                        break;
10054                    }
10055                }
10056                Nl80211Attrs::MaxNumAkmSuites(val) => {
10057                    if last_off == offset {
10058                        stack.push(("MaxNumAkmSuites", last_off));
10059                        break;
10060                    }
10061                }
10062                Nl80211Attrs::EmlCapability(val) => {
10063                    if last_off == offset {
10064                        stack.push(("EmlCapability", last_off));
10065                        break;
10066                    }
10067                }
10068                Nl80211Attrs::MldCapaAndOps(val) => {
10069                    if last_off == offset {
10070                        stack.push(("MldCapaAndOps", last_off));
10071                        break;
10072                    }
10073                }
10074                Nl80211Attrs::TxHwTimestamp(val) => {
10075                    if last_off == offset {
10076                        stack.push(("TxHwTimestamp", last_off));
10077                        break;
10078                    }
10079                }
10080                Nl80211Attrs::RxHwTimestamp(val) => {
10081                    if last_off == offset {
10082                        stack.push(("RxHwTimestamp", last_off));
10083                        break;
10084                    }
10085                }
10086                Nl80211Attrs::TdBitmap(val) => {
10087                    if last_off == offset {
10088                        stack.push(("TdBitmap", last_off));
10089                        break;
10090                    }
10091                }
10092                Nl80211Attrs::PunctBitmap(val) => {
10093                    if last_off == offset {
10094                        stack.push(("PunctBitmap", last_off));
10095                        break;
10096                    }
10097                }
10098                Nl80211Attrs::MaxHwTimestampPeers(val) => {
10099                    if last_off == offset {
10100                        stack.push(("MaxHwTimestampPeers", last_off));
10101                        break;
10102                    }
10103                }
10104                Nl80211Attrs::HwTimestampEnabled(val) => {
10105                    if last_off == offset {
10106                        stack.push(("HwTimestampEnabled", last_off));
10107                        break;
10108                    }
10109                }
10110                Nl80211Attrs::EmaRnrElems(val) => {
10111                    if last_off == offset {
10112                        stack.push(("EmaRnrElems", last_off));
10113                        break;
10114                    }
10115                }
10116                Nl80211Attrs::MloLinkDisabled(val) => {
10117                    if last_off == offset {
10118                        stack.push(("MloLinkDisabled", last_off));
10119                        break;
10120                    }
10121                }
10122                Nl80211Attrs::BssDumpIncludeUseData(val) => {
10123                    if last_off == offset {
10124                        stack.push(("BssDumpIncludeUseData", last_off));
10125                        break;
10126                    }
10127                }
10128                Nl80211Attrs::MloTtlmDlink(val) => {
10129                    if last_off == offset {
10130                        stack.push(("MloTtlmDlink", last_off));
10131                        break;
10132                    }
10133                }
10134                Nl80211Attrs::MloTtlmUlink(val) => {
10135                    if last_off == offset {
10136                        stack.push(("MloTtlmUlink", last_off));
10137                        break;
10138                    }
10139                }
10140                Nl80211Attrs::AssocSppAmsdu(val) => {
10141                    if last_off == offset {
10142                        stack.push(("AssocSppAmsdu", last_off));
10143                        break;
10144                    }
10145                }
10146                Nl80211Attrs::WiphyRadios(val) => {
10147                    if last_off == offset {
10148                        stack.push(("WiphyRadios", last_off));
10149                        break;
10150                    }
10151                }
10152                Nl80211Attrs::WiphyInterfaceCombinations(val) => {
10153                    if last_off == offset {
10154                        stack.push(("WiphyInterfaceCombinations", last_off));
10155                        break;
10156                    }
10157                }
10158                Nl80211Attrs::VifRadioMask(val) => {
10159                    if last_off == offset {
10160                        stack.push(("VifRadioMask", last_off));
10161                        break;
10162                    }
10163                }
10164                _ => {}
10165            };
10166            last_off = cur + attrs.pos;
10167        }
10168        if !stack.is_empty() {
10169            stack.push(("Nl80211Attrs", cur));
10170        }
10171        (stack, missing)
10172    }
10173}
10174#[derive(Clone)]
10175pub enum FrameTypeAttrs {
10176    FrameType(u16),
10177}
10178impl<'a> IterableFrameTypeAttrs<'a> {
10179    pub fn get_frame_type(&self) -> Result<u16, ErrorContext> {
10180        let mut iter = self.clone();
10181        iter.pos = 0;
10182        for attr in iter {
10183            if let FrameTypeAttrs::FrameType(val) = attr? {
10184                return Ok(val);
10185            }
10186        }
10187        Err(ErrorContext::new_missing(
10188            "FrameTypeAttrs",
10189            "FrameType",
10190            self.orig_loc,
10191            self.buf.as_ptr() as usize,
10192        ))
10193    }
10194}
10195impl FrameTypeAttrs {
10196    pub fn new<'a>(buf: &'a [u8]) -> IterableFrameTypeAttrs<'a> {
10197        IterableFrameTypeAttrs::with_loc(buf, buf.as_ptr() as usize)
10198    }
10199    fn attr_from_type(r#type: u16) -> Option<&'static str> {
10200        Nl80211Attrs::attr_from_type(r#type)
10201    }
10202}
10203#[derive(Clone, Copy, Default)]
10204pub struct IterableFrameTypeAttrs<'a> {
10205    buf: &'a [u8],
10206    pos: usize,
10207    orig_loc: usize,
10208}
10209impl<'a> IterableFrameTypeAttrs<'a> {
10210    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10211        Self {
10212            buf,
10213            pos: 0,
10214            orig_loc,
10215        }
10216    }
10217    pub fn get_buf(&self) -> &'a [u8] {
10218        self.buf
10219    }
10220}
10221impl<'a> Iterator for IterableFrameTypeAttrs<'a> {
10222    type Item = Result<FrameTypeAttrs, ErrorContext>;
10223    fn next(&mut self) -> Option<Self::Item> {
10224        let pos = self.pos;
10225        let mut r#type;
10226        loop {
10227            r#type = None;
10228            if self.buf.len() == self.pos {
10229                return None;
10230            }
10231            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
10232                break;
10233            };
10234            r#type = Some(header.r#type);
10235            let res = match header.r#type {
10236                101u16 => FrameTypeAttrs::FrameType({
10237                    let res = parse_u16(next);
10238                    let Some(val) = res else { break };
10239                    val
10240                }),
10241                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
10242                n => continue,
10243            };
10244            return Some(Ok(res));
10245        }
10246        Some(Err(ErrorContext::new(
10247            "FrameTypeAttrs",
10248            r#type.and_then(|t| FrameTypeAttrs::attr_from_type(t)),
10249            self.orig_loc,
10250            self.buf.as_ptr().wrapping_add(pos) as usize,
10251        )))
10252    }
10253}
10254impl std::fmt::Debug for IterableFrameTypeAttrs<'_> {
10255    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10256        let mut fmt = f.debug_struct("FrameTypeAttrs");
10257        for attr in self.clone() {
10258            let attr = match attr {
10259                Ok(a) => a,
10260                Err(err) => {
10261                    fmt.finish()?;
10262                    f.write_str("Err(")?;
10263                    err.fmt(f)?;
10264                    return f.write_str(")");
10265                }
10266            };
10267            match attr {
10268                FrameTypeAttrs::FrameType(val) => fmt.field("FrameType", &val),
10269            };
10270        }
10271        fmt.finish()
10272    }
10273}
10274impl IterableFrameTypeAttrs<'_> {
10275    pub fn lookup_attr(
10276        &self,
10277        offset: usize,
10278        missing_type: Option<u16>,
10279    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
10280        let mut stack = Vec::new();
10281        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
10282        if cur == offset {
10283            stack.push(("FrameTypeAttrs", offset));
10284            return (
10285                stack,
10286                missing_type.and_then(|t| FrameTypeAttrs::attr_from_type(t)),
10287            );
10288        }
10289        if cur > offset || cur + self.buf.len() < offset {
10290            return (stack, None);
10291        }
10292        let mut attrs = self.clone();
10293        let mut last_off = cur + attrs.pos;
10294        while let Some(attr) = attrs.next() {
10295            let Ok(attr) = attr else { break };
10296            match attr {
10297                FrameTypeAttrs::FrameType(val) => {
10298                    if last_off == offset {
10299                        stack.push(("FrameType", last_off));
10300                        break;
10301                    }
10302                }
10303                _ => {}
10304            };
10305            last_off = cur + attrs.pos;
10306        }
10307        if !stack.is_empty() {
10308            stack.push(("FrameTypeAttrs", cur));
10309        }
10310        (stack, None)
10311    }
10312}
10313#[derive(Clone)]
10314pub enum WiphyBands<'a> {
10315    #[doc = "2.4 GHz ISM band"]
10316    _2ghz(IterableBandAttrs<'a>),
10317    #[doc = "around 5 GHz band (4.9 - 5.7 GHz)"]
10318    _5ghz(IterableBandAttrs<'a>),
10319    #[doc = "around 60 GHz band (58.32 - 69.12 GHz)"]
10320    _60ghz(IterableBandAttrs<'a>),
10321    _6ghz(IterableBandAttrs<'a>),
10322    S1ghz(IterableBandAttrs<'a>),
10323    Lc(IterableBandAttrs<'a>),
10324}
10325impl<'a> IterableWiphyBands<'a> {
10326    #[doc = "2.4 GHz ISM band"]
10327    pub fn get_2ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10328        let mut iter = self.clone();
10329        iter.pos = 0;
10330        for attr in iter {
10331            if let WiphyBands::_2ghz(val) = attr? {
10332                return Ok(val);
10333            }
10334        }
10335        Err(ErrorContext::new_missing(
10336            "WiphyBands",
10337            "2ghz",
10338            self.orig_loc,
10339            self.buf.as_ptr() as usize,
10340        ))
10341    }
10342    #[doc = "around 5 GHz band (4.9 - 5.7 GHz)"]
10343    pub fn get_5ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10344        let mut iter = self.clone();
10345        iter.pos = 0;
10346        for attr in iter {
10347            if let WiphyBands::_5ghz(val) = attr? {
10348                return Ok(val);
10349            }
10350        }
10351        Err(ErrorContext::new_missing(
10352            "WiphyBands",
10353            "5ghz",
10354            self.orig_loc,
10355            self.buf.as_ptr() as usize,
10356        ))
10357    }
10358    #[doc = "around 60 GHz band (58.32 - 69.12 GHz)"]
10359    pub fn get_60ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10360        let mut iter = self.clone();
10361        iter.pos = 0;
10362        for attr in iter {
10363            if let WiphyBands::_60ghz(val) = attr? {
10364                return Ok(val);
10365            }
10366        }
10367        Err(ErrorContext::new_missing(
10368            "WiphyBands",
10369            "60ghz",
10370            self.orig_loc,
10371            self.buf.as_ptr() as usize,
10372        ))
10373    }
10374    pub fn get_6ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10375        let mut iter = self.clone();
10376        iter.pos = 0;
10377        for attr in iter {
10378            if let WiphyBands::_6ghz(val) = attr? {
10379                return Ok(val);
10380            }
10381        }
10382        Err(ErrorContext::new_missing(
10383            "WiphyBands",
10384            "6ghz",
10385            self.orig_loc,
10386            self.buf.as_ptr() as usize,
10387        ))
10388    }
10389    pub fn get_s1ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10390        let mut iter = self.clone();
10391        iter.pos = 0;
10392        for attr in iter {
10393            if let WiphyBands::S1ghz(val) = attr? {
10394                return Ok(val);
10395            }
10396        }
10397        Err(ErrorContext::new_missing(
10398            "WiphyBands",
10399            "S1ghz",
10400            self.orig_loc,
10401            self.buf.as_ptr() as usize,
10402        ))
10403    }
10404    pub fn get_lc(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10405        let mut iter = self.clone();
10406        iter.pos = 0;
10407        for attr in iter {
10408            if let WiphyBands::Lc(val) = attr? {
10409                return Ok(val);
10410            }
10411        }
10412        Err(ErrorContext::new_missing(
10413            "WiphyBands",
10414            "Lc",
10415            self.orig_loc,
10416            self.buf.as_ptr() as usize,
10417        ))
10418    }
10419}
10420impl WiphyBands<'_> {
10421    pub fn new<'a>(buf: &'a [u8]) -> IterableWiphyBands<'a> {
10422        IterableWiphyBands::with_loc(buf, buf.as_ptr() as usize)
10423    }
10424    fn attr_from_type(r#type: u16) -> Option<&'static str> {
10425        let res = match r#type {
10426            0u16 => "2ghz",
10427            1u16 => "5ghz",
10428            2u16 => "60ghz",
10429            3u16 => "6ghz",
10430            4u16 => "S1ghz",
10431            5u16 => "Lc",
10432            _ => return None,
10433        };
10434        Some(res)
10435    }
10436}
10437#[derive(Clone, Copy, Default)]
10438pub struct IterableWiphyBands<'a> {
10439    buf: &'a [u8],
10440    pos: usize,
10441    orig_loc: usize,
10442}
10443impl<'a> IterableWiphyBands<'a> {
10444    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10445        Self {
10446            buf,
10447            pos: 0,
10448            orig_loc,
10449        }
10450    }
10451    pub fn get_buf(&self) -> &'a [u8] {
10452        self.buf
10453    }
10454}
10455impl<'a> Iterator for IterableWiphyBands<'a> {
10456    type Item = Result<WiphyBands<'a>, ErrorContext>;
10457    fn next(&mut self) -> Option<Self::Item> {
10458        let pos = self.pos;
10459        let mut r#type;
10460        loop {
10461            r#type = None;
10462            if self.buf.len() == self.pos {
10463                return None;
10464            }
10465            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
10466                break;
10467            };
10468            r#type = Some(header.r#type);
10469            let res = match header.r#type {
10470                0u16 => WiphyBands::_2ghz({
10471                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10472                    let Some(val) = res else { break };
10473                    val
10474                }),
10475                1u16 => WiphyBands::_5ghz({
10476                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10477                    let Some(val) = res else { break };
10478                    val
10479                }),
10480                2u16 => WiphyBands::_60ghz({
10481                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10482                    let Some(val) = res else { break };
10483                    val
10484                }),
10485                3u16 => WiphyBands::_6ghz({
10486                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10487                    let Some(val) = res else { break };
10488                    val
10489                }),
10490                4u16 => WiphyBands::S1ghz({
10491                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10492                    let Some(val) = res else { break };
10493                    val
10494                }),
10495                5u16 => WiphyBands::Lc({
10496                    let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10497                    let Some(val) = res else { break };
10498                    val
10499                }),
10500                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
10501                n => continue,
10502            };
10503            return Some(Ok(res));
10504        }
10505        Some(Err(ErrorContext::new(
10506            "WiphyBands",
10507            r#type.and_then(|t| WiphyBands::attr_from_type(t)),
10508            self.orig_loc,
10509            self.buf.as_ptr().wrapping_add(pos) as usize,
10510        )))
10511    }
10512}
10513impl<'a> std::fmt::Debug for IterableWiphyBands<'_> {
10514    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10515        let mut fmt = f.debug_struct("WiphyBands");
10516        for attr in self.clone() {
10517            let attr = match attr {
10518                Ok(a) => a,
10519                Err(err) => {
10520                    fmt.finish()?;
10521                    f.write_str("Err(")?;
10522                    err.fmt(f)?;
10523                    return f.write_str(")");
10524                }
10525            };
10526            match attr {
10527                WiphyBands::_2ghz(val) => fmt.field("_2ghz", &val),
10528                WiphyBands::_5ghz(val) => fmt.field("_5ghz", &val),
10529                WiphyBands::_60ghz(val) => fmt.field("_60ghz", &val),
10530                WiphyBands::_6ghz(val) => fmt.field("_6ghz", &val),
10531                WiphyBands::S1ghz(val) => fmt.field("S1ghz", &val),
10532                WiphyBands::Lc(val) => fmt.field("Lc", &val),
10533            };
10534        }
10535        fmt.finish()
10536    }
10537}
10538impl IterableWiphyBands<'_> {
10539    pub fn lookup_attr(
10540        &self,
10541        offset: usize,
10542        missing_type: Option<u16>,
10543    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
10544        let mut stack = Vec::new();
10545        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
10546        if cur == offset {
10547            stack.push(("WiphyBands", offset));
10548            return (
10549                stack,
10550                missing_type.and_then(|t| WiphyBands::attr_from_type(t)),
10551            );
10552        }
10553        if cur > offset || cur + self.buf.len() < offset {
10554            return (stack, None);
10555        }
10556        let mut attrs = self.clone();
10557        let mut last_off = cur + attrs.pos;
10558        let mut missing = None;
10559        while let Some(attr) = attrs.next() {
10560            let Ok(attr) = attr else { break };
10561            match attr {
10562                WiphyBands::_2ghz(val) => {
10563                    (stack, missing) = val.lookup_attr(offset, missing_type);
10564                    if !stack.is_empty() {
10565                        break;
10566                    }
10567                }
10568                WiphyBands::_5ghz(val) => {
10569                    (stack, missing) = val.lookup_attr(offset, missing_type);
10570                    if !stack.is_empty() {
10571                        break;
10572                    }
10573                }
10574                WiphyBands::_60ghz(val) => {
10575                    (stack, missing) = val.lookup_attr(offset, missing_type);
10576                    if !stack.is_empty() {
10577                        break;
10578                    }
10579                }
10580                WiphyBands::_6ghz(val) => {
10581                    (stack, missing) = val.lookup_attr(offset, missing_type);
10582                    if !stack.is_empty() {
10583                        break;
10584                    }
10585                }
10586                WiphyBands::S1ghz(val) => {
10587                    (stack, missing) = val.lookup_attr(offset, missing_type);
10588                    if !stack.is_empty() {
10589                        break;
10590                    }
10591                }
10592                WiphyBands::Lc(val) => {
10593                    (stack, missing) = val.lookup_attr(offset, missing_type);
10594                    if !stack.is_empty() {
10595                        break;
10596                    }
10597                }
10598                _ => {}
10599            };
10600            last_off = cur + attrs.pos;
10601        }
10602        if !stack.is_empty() {
10603            stack.push(("WiphyBands", cur));
10604        }
10605        (stack, missing)
10606    }
10607}
10608#[derive(Clone)]
10609pub enum BandAttrs<'a> {
10610    Freqs(IterableArrayFrequencyAttrs<'a>),
10611    Rates(IterableArrayBitrateAttrs<'a>),
10612    HtMcsSet(&'a [u8]),
10613    HtCapa(u16),
10614    HtAmpduFactor(u8),
10615    HtAmpduDensity(u8),
10616    VhtMcsSet(&'a [u8]),
10617    VhtCapa(u32),
10618    IftypeData(IterableArrayIftypeDataAttrs<'a>),
10619    EdmgChannels(&'a [u8]),
10620    EdmgBwConfig(&'a [u8]),
10621    S1gMcsNssSet(&'a [u8]),
10622    S1gCapa(&'a [u8]),
10623}
10624impl<'a> IterableBandAttrs<'a> {
10625    pub fn get_freqs(
10626        &self,
10627    ) -> Result<
10628        ArrayIterable<IterableArrayFrequencyAttrs<'a>, IterableFrequencyAttrs<'a>>,
10629        ErrorContext,
10630    > {
10631        for attr in self.clone() {
10632            if let BandAttrs::Freqs(val) = attr? {
10633                return Ok(ArrayIterable::new(val));
10634            }
10635        }
10636        Err(ErrorContext::new_missing(
10637            "BandAttrs",
10638            "Freqs",
10639            self.orig_loc,
10640            self.buf.as_ptr() as usize,
10641        ))
10642    }
10643    pub fn get_rates(
10644        &self,
10645    ) -> Result<ArrayIterable<IterableArrayBitrateAttrs<'a>, IterableBitrateAttrs<'a>>, ErrorContext>
10646    {
10647        for attr in self.clone() {
10648            if let BandAttrs::Rates(val) = attr? {
10649                return Ok(ArrayIterable::new(val));
10650            }
10651        }
10652        Err(ErrorContext::new_missing(
10653            "BandAttrs",
10654            "Rates",
10655            self.orig_loc,
10656            self.buf.as_ptr() as usize,
10657        ))
10658    }
10659    pub fn get_ht_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
10660        let mut iter = self.clone();
10661        iter.pos = 0;
10662        for attr in iter {
10663            if let BandAttrs::HtMcsSet(val) = attr? {
10664                return Ok(val);
10665            }
10666        }
10667        Err(ErrorContext::new_missing(
10668            "BandAttrs",
10669            "HtMcsSet",
10670            self.orig_loc,
10671            self.buf.as_ptr() as usize,
10672        ))
10673    }
10674    pub fn get_ht_capa(&self) -> Result<u16, ErrorContext> {
10675        let mut iter = self.clone();
10676        iter.pos = 0;
10677        for attr in iter {
10678            if let BandAttrs::HtCapa(val) = attr? {
10679                return Ok(val);
10680            }
10681        }
10682        Err(ErrorContext::new_missing(
10683            "BandAttrs",
10684            "HtCapa",
10685            self.orig_loc,
10686            self.buf.as_ptr() as usize,
10687        ))
10688    }
10689    pub fn get_ht_ampdu_factor(&self) -> Result<u8, ErrorContext> {
10690        let mut iter = self.clone();
10691        iter.pos = 0;
10692        for attr in iter {
10693            if let BandAttrs::HtAmpduFactor(val) = attr? {
10694                return Ok(val);
10695            }
10696        }
10697        Err(ErrorContext::new_missing(
10698            "BandAttrs",
10699            "HtAmpduFactor",
10700            self.orig_loc,
10701            self.buf.as_ptr() as usize,
10702        ))
10703    }
10704    pub fn get_ht_ampdu_density(&self) -> Result<u8, ErrorContext> {
10705        let mut iter = self.clone();
10706        iter.pos = 0;
10707        for attr in iter {
10708            if let BandAttrs::HtAmpduDensity(val) = attr? {
10709                return Ok(val);
10710            }
10711        }
10712        Err(ErrorContext::new_missing(
10713            "BandAttrs",
10714            "HtAmpduDensity",
10715            self.orig_loc,
10716            self.buf.as_ptr() as usize,
10717        ))
10718    }
10719    pub fn get_vht_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
10720        let mut iter = self.clone();
10721        iter.pos = 0;
10722        for attr in iter {
10723            if let BandAttrs::VhtMcsSet(val) = attr? {
10724                return Ok(val);
10725            }
10726        }
10727        Err(ErrorContext::new_missing(
10728            "BandAttrs",
10729            "VhtMcsSet",
10730            self.orig_loc,
10731            self.buf.as_ptr() as usize,
10732        ))
10733    }
10734    pub fn get_vht_capa(&self) -> Result<u32, ErrorContext> {
10735        let mut iter = self.clone();
10736        iter.pos = 0;
10737        for attr in iter {
10738            if let BandAttrs::VhtCapa(val) = attr? {
10739                return Ok(val);
10740            }
10741        }
10742        Err(ErrorContext::new_missing(
10743            "BandAttrs",
10744            "VhtCapa",
10745            self.orig_loc,
10746            self.buf.as_ptr() as usize,
10747        ))
10748    }
10749    pub fn get_iftype_data(
10750        &self,
10751    ) -> Result<
10752        ArrayIterable<IterableArrayIftypeDataAttrs<'a>, IterableIftypeDataAttrs<'a>>,
10753        ErrorContext,
10754    > {
10755        for attr in self.clone() {
10756            if let BandAttrs::IftypeData(val) = attr? {
10757                return Ok(ArrayIterable::new(val));
10758            }
10759        }
10760        Err(ErrorContext::new_missing(
10761            "BandAttrs",
10762            "IftypeData",
10763            self.orig_loc,
10764            self.buf.as_ptr() as usize,
10765        ))
10766    }
10767    pub fn get_edmg_channels(&self) -> Result<&'a [u8], ErrorContext> {
10768        let mut iter = self.clone();
10769        iter.pos = 0;
10770        for attr in iter {
10771            if let BandAttrs::EdmgChannels(val) = attr? {
10772                return Ok(val);
10773            }
10774        }
10775        Err(ErrorContext::new_missing(
10776            "BandAttrs",
10777            "EdmgChannels",
10778            self.orig_loc,
10779            self.buf.as_ptr() as usize,
10780        ))
10781    }
10782    pub fn get_edmg_bw_config(&self) -> Result<&'a [u8], ErrorContext> {
10783        let mut iter = self.clone();
10784        iter.pos = 0;
10785        for attr in iter {
10786            if let BandAttrs::EdmgBwConfig(val) = attr? {
10787                return Ok(val);
10788            }
10789        }
10790        Err(ErrorContext::new_missing(
10791            "BandAttrs",
10792            "EdmgBwConfig",
10793            self.orig_loc,
10794            self.buf.as_ptr() as usize,
10795        ))
10796    }
10797    pub fn get_s1g_mcs_nss_set(&self) -> Result<&'a [u8], ErrorContext> {
10798        let mut iter = self.clone();
10799        iter.pos = 0;
10800        for attr in iter {
10801            if let BandAttrs::S1gMcsNssSet(val) = attr? {
10802                return Ok(val);
10803            }
10804        }
10805        Err(ErrorContext::new_missing(
10806            "BandAttrs",
10807            "S1gMcsNssSet",
10808            self.orig_loc,
10809            self.buf.as_ptr() as usize,
10810        ))
10811    }
10812    pub fn get_s1g_capa(&self) -> Result<&'a [u8], ErrorContext> {
10813        let mut iter = self.clone();
10814        iter.pos = 0;
10815        for attr in iter {
10816            if let BandAttrs::S1gCapa(val) = attr? {
10817                return Ok(val);
10818            }
10819        }
10820        Err(ErrorContext::new_missing(
10821            "BandAttrs",
10822            "S1gCapa",
10823            self.orig_loc,
10824            self.buf.as_ptr() as usize,
10825        ))
10826    }
10827}
10828impl<'a> FrequencyAttrs<'a> {
10829    pub fn new_array(buf: &[u8]) -> IterableArrayFrequencyAttrs<'_> {
10830        IterableArrayFrequencyAttrs::with_loc(buf, buf.as_ptr() as usize)
10831    }
10832}
10833#[derive(Clone, Copy, Default)]
10834pub struct IterableArrayFrequencyAttrs<'a> {
10835    buf: &'a [u8],
10836    pos: usize,
10837    orig_loc: usize,
10838}
10839impl<'a> IterableArrayFrequencyAttrs<'a> {
10840    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10841        Self {
10842            buf,
10843            pos: 0,
10844            orig_loc,
10845        }
10846    }
10847    pub fn get_buf(&self) -> &'a [u8] {
10848        self.buf
10849    }
10850}
10851impl<'a> Iterator for IterableArrayFrequencyAttrs<'a> {
10852    type Item = Result<IterableFrequencyAttrs<'a>, ErrorContext>;
10853    fn next(&mut self) -> Option<Self::Item> {
10854        if self.buf.len() == self.pos {
10855            return None;
10856        }
10857        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
10858            {
10859                return Some(Ok(IterableFrequencyAttrs::with_loc(next, self.orig_loc)));
10860            }
10861        }
10862        Some(Err(ErrorContext::new(
10863            "FrequencyAttrs",
10864            None,
10865            self.orig_loc,
10866            self.buf.as_ptr().wrapping_add(self.pos) as usize,
10867        )))
10868    }
10869}
10870impl BitrateAttrs {
10871    pub fn new_array(buf: &[u8]) -> IterableArrayBitrateAttrs<'_> {
10872        IterableArrayBitrateAttrs::with_loc(buf, buf.as_ptr() as usize)
10873    }
10874}
10875#[derive(Clone, Copy, Default)]
10876pub struct IterableArrayBitrateAttrs<'a> {
10877    buf: &'a [u8],
10878    pos: usize,
10879    orig_loc: usize,
10880}
10881impl<'a> IterableArrayBitrateAttrs<'a> {
10882    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10883        Self {
10884            buf,
10885            pos: 0,
10886            orig_loc,
10887        }
10888    }
10889    pub fn get_buf(&self) -> &'a [u8] {
10890        self.buf
10891    }
10892}
10893impl<'a> Iterator for IterableArrayBitrateAttrs<'a> {
10894    type Item = Result<IterableBitrateAttrs<'a>, ErrorContext>;
10895    fn next(&mut self) -> Option<Self::Item> {
10896        if self.buf.len() == self.pos {
10897            return None;
10898        }
10899        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
10900            {
10901                return Some(Ok(IterableBitrateAttrs::with_loc(next, self.orig_loc)));
10902            }
10903        }
10904        Some(Err(ErrorContext::new(
10905            "BitrateAttrs",
10906            None,
10907            self.orig_loc,
10908            self.buf.as_ptr().wrapping_add(self.pos) as usize,
10909        )))
10910    }
10911}
10912impl<'a> IftypeDataAttrs<'a> {
10913    pub fn new_array(buf: &[u8]) -> IterableArrayIftypeDataAttrs<'_> {
10914        IterableArrayIftypeDataAttrs::with_loc(buf, buf.as_ptr() as usize)
10915    }
10916}
10917#[derive(Clone, Copy, Default)]
10918pub struct IterableArrayIftypeDataAttrs<'a> {
10919    buf: &'a [u8],
10920    pos: usize,
10921    orig_loc: usize,
10922}
10923impl<'a> IterableArrayIftypeDataAttrs<'a> {
10924    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10925        Self {
10926            buf,
10927            pos: 0,
10928            orig_loc,
10929        }
10930    }
10931    pub fn get_buf(&self) -> &'a [u8] {
10932        self.buf
10933    }
10934}
10935impl<'a> Iterator for IterableArrayIftypeDataAttrs<'a> {
10936    type Item = Result<IterableIftypeDataAttrs<'a>, ErrorContext>;
10937    fn next(&mut self) -> Option<Self::Item> {
10938        if self.buf.len() == self.pos {
10939            return None;
10940        }
10941        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
10942            {
10943                return Some(Ok(IterableIftypeDataAttrs::with_loc(next, self.orig_loc)));
10944            }
10945        }
10946        Some(Err(ErrorContext::new(
10947            "IftypeDataAttrs",
10948            None,
10949            self.orig_loc,
10950            self.buf.as_ptr().wrapping_add(self.pos) as usize,
10951        )))
10952    }
10953}
10954impl BandAttrs<'_> {
10955    pub fn new<'a>(buf: &'a [u8]) -> IterableBandAttrs<'a> {
10956        IterableBandAttrs::with_loc(buf, buf.as_ptr() as usize)
10957    }
10958    fn attr_from_type(r#type: u16) -> Option<&'static str> {
10959        let res = match r#type {
10960            1u16 => "Freqs",
10961            2u16 => "Rates",
10962            3u16 => "HtMcsSet",
10963            4u16 => "HtCapa",
10964            5u16 => "HtAmpduFactor",
10965            6u16 => "HtAmpduDensity",
10966            7u16 => "VhtMcsSet",
10967            8u16 => "VhtCapa",
10968            9u16 => "IftypeData",
10969            10u16 => "EdmgChannels",
10970            11u16 => "EdmgBwConfig",
10971            12u16 => "S1gMcsNssSet",
10972            13u16 => "S1gCapa",
10973            _ => return None,
10974        };
10975        Some(res)
10976    }
10977}
10978#[derive(Clone, Copy, Default)]
10979pub struct IterableBandAttrs<'a> {
10980    buf: &'a [u8],
10981    pos: usize,
10982    orig_loc: usize,
10983}
10984impl<'a> IterableBandAttrs<'a> {
10985    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10986        Self {
10987            buf,
10988            pos: 0,
10989            orig_loc,
10990        }
10991    }
10992    pub fn get_buf(&self) -> &'a [u8] {
10993        self.buf
10994    }
10995}
10996impl<'a> Iterator for IterableBandAttrs<'a> {
10997    type Item = Result<BandAttrs<'a>, ErrorContext>;
10998    fn next(&mut self) -> Option<Self::Item> {
10999        let pos = self.pos;
11000        let mut r#type;
11001        loop {
11002            r#type = None;
11003            if self.buf.len() == self.pos {
11004                return None;
11005            }
11006            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
11007                break;
11008            };
11009            r#type = Some(header.r#type);
11010            let res = match header.r#type {
11011                1u16 => BandAttrs::Freqs({
11012                    let res = Some(IterableArrayFrequencyAttrs::with_loc(next, self.orig_loc));
11013                    let Some(val) = res else { break };
11014                    val
11015                }),
11016                2u16 => BandAttrs::Rates({
11017                    let res = Some(IterableArrayBitrateAttrs::with_loc(next, self.orig_loc));
11018                    let Some(val) = res else { break };
11019                    val
11020                }),
11021                3u16 => BandAttrs::HtMcsSet({
11022                    let res = Some(next);
11023                    let Some(val) = res else { break };
11024                    val
11025                }),
11026                4u16 => BandAttrs::HtCapa({
11027                    let res = parse_u16(next);
11028                    let Some(val) = res else { break };
11029                    val
11030                }),
11031                5u16 => BandAttrs::HtAmpduFactor({
11032                    let res = parse_u8(next);
11033                    let Some(val) = res else { break };
11034                    val
11035                }),
11036                6u16 => BandAttrs::HtAmpduDensity({
11037                    let res = parse_u8(next);
11038                    let Some(val) = res else { break };
11039                    val
11040                }),
11041                7u16 => BandAttrs::VhtMcsSet({
11042                    let res = Some(next);
11043                    let Some(val) = res else { break };
11044                    val
11045                }),
11046                8u16 => BandAttrs::VhtCapa({
11047                    let res = parse_u32(next);
11048                    let Some(val) = res else { break };
11049                    val
11050                }),
11051                9u16 => BandAttrs::IftypeData({
11052                    let res = Some(IterableArrayIftypeDataAttrs::with_loc(next, self.orig_loc));
11053                    let Some(val) = res else { break };
11054                    val
11055                }),
11056                10u16 => BandAttrs::EdmgChannels({
11057                    let res = Some(next);
11058                    let Some(val) = res else { break };
11059                    val
11060                }),
11061                11u16 => BandAttrs::EdmgBwConfig({
11062                    let res = Some(next);
11063                    let Some(val) = res else { break };
11064                    val
11065                }),
11066                12u16 => BandAttrs::S1gMcsNssSet({
11067                    let res = Some(next);
11068                    let Some(val) = res else { break };
11069                    val
11070                }),
11071                13u16 => BandAttrs::S1gCapa({
11072                    let res = Some(next);
11073                    let Some(val) = res else { break };
11074                    val
11075                }),
11076                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
11077                n => continue,
11078            };
11079            return Some(Ok(res));
11080        }
11081        Some(Err(ErrorContext::new(
11082            "BandAttrs",
11083            r#type.and_then(|t| BandAttrs::attr_from_type(t)),
11084            self.orig_loc,
11085            self.buf.as_ptr().wrapping_add(pos) as usize,
11086        )))
11087    }
11088}
11089impl std::fmt::Debug for IterableArrayFrequencyAttrs<'_> {
11090    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11091        fmt.debug_list()
11092            .entries(self.clone().map(FlattenErrorContext))
11093            .finish()
11094    }
11095}
11096impl std::fmt::Debug for IterableArrayBitrateAttrs<'_> {
11097    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11098        fmt.debug_list()
11099            .entries(self.clone().map(FlattenErrorContext))
11100            .finish()
11101    }
11102}
11103impl std::fmt::Debug for IterableArrayIftypeDataAttrs<'_> {
11104    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11105        fmt.debug_list()
11106            .entries(self.clone().map(FlattenErrorContext))
11107            .finish()
11108    }
11109}
11110impl<'a> std::fmt::Debug for IterableBandAttrs<'_> {
11111    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11112        let mut fmt = f.debug_struct("BandAttrs");
11113        for attr in self.clone() {
11114            let attr = match attr {
11115                Ok(a) => a,
11116                Err(err) => {
11117                    fmt.finish()?;
11118                    f.write_str("Err(")?;
11119                    err.fmt(f)?;
11120                    return f.write_str(")");
11121                }
11122            };
11123            match attr {
11124                BandAttrs::Freqs(val) => fmt.field("Freqs", &val),
11125                BandAttrs::Rates(val) => fmt.field("Rates", &val),
11126                BandAttrs::HtMcsSet(val) => fmt.field("HtMcsSet", &val),
11127                BandAttrs::HtCapa(val) => fmt.field("HtCapa", &val),
11128                BandAttrs::HtAmpduFactor(val) => fmt.field("HtAmpduFactor", &val),
11129                BandAttrs::HtAmpduDensity(val) => fmt.field("HtAmpduDensity", &val),
11130                BandAttrs::VhtMcsSet(val) => fmt.field("VhtMcsSet", &val),
11131                BandAttrs::VhtCapa(val) => fmt.field("VhtCapa", &val),
11132                BandAttrs::IftypeData(val) => fmt.field("IftypeData", &val),
11133                BandAttrs::EdmgChannels(val) => fmt.field("EdmgChannels", &val),
11134                BandAttrs::EdmgBwConfig(val) => fmt.field("EdmgBwConfig", &val),
11135                BandAttrs::S1gMcsNssSet(val) => fmt.field("S1gMcsNssSet", &val),
11136                BandAttrs::S1gCapa(val) => fmt.field("S1gCapa", &val),
11137            };
11138        }
11139        fmt.finish()
11140    }
11141}
11142impl IterableBandAttrs<'_> {
11143    pub fn lookup_attr(
11144        &self,
11145        offset: usize,
11146        missing_type: Option<u16>,
11147    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
11148        let mut stack = Vec::new();
11149        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
11150        if cur == offset {
11151            stack.push(("BandAttrs", offset));
11152            return (
11153                stack,
11154                missing_type.and_then(|t| BandAttrs::attr_from_type(t)),
11155            );
11156        }
11157        if cur > offset || cur + self.buf.len() < offset {
11158            return (stack, None);
11159        }
11160        let mut attrs = self.clone();
11161        let mut last_off = cur + attrs.pos;
11162        let mut missing = None;
11163        while let Some(attr) = attrs.next() {
11164            let Ok(attr) = attr else { break };
11165            match attr {
11166                BandAttrs::Freqs(val) => {
11167                    for entry in val {
11168                        let Ok(attr) = entry else { break };
11169                        (stack, missing) = attr.lookup_attr(offset, missing_type);
11170                        if !stack.is_empty() {
11171                            break;
11172                        }
11173                    }
11174                    if !stack.is_empty() {
11175                        stack.push(("Freqs", last_off));
11176                        break;
11177                    }
11178                }
11179                BandAttrs::Rates(val) => {
11180                    for entry in val {
11181                        let Ok(attr) = entry else { break };
11182                        (stack, missing) = attr.lookup_attr(offset, missing_type);
11183                        if !stack.is_empty() {
11184                            break;
11185                        }
11186                    }
11187                    if !stack.is_empty() {
11188                        stack.push(("Rates", last_off));
11189                        break;
11190                    }
11191                }
11192                BandAttrs::HtMcsSet(val) => {
11193                    if last_off == offset {
11194                        stack.push(("HtMcsSet", last_off));
11195                        break;
11196                    }
11197                }
11198                BandAttrs::HtCapa(val) => {
11199                    if last_off == offset {
11200                        stack.push(("HtCapa", last_off));
11201                        break;
11202                    }
11203                }
11204                BandAttrs::HtAmpduFactor(val) => {
11205                    if last_off == offset {
11206                        stack.push(("HtAmpduFactor", last_off));
11207                        break;
11208                    }
11209                }
11210                BandAttrs::HtAmpduDensity(val) => {
11211                    if last_off == offset {
11212                        stack.push(("HtAmpduDensity", last_off));
11213                        break;
11214                    }
11215                }
11216                BandAttrs::VhtMcsSet(val) => {
11217                    if last_off == offset {
11218                        stack.push(("VhtMcsSet", last_off));
11219                        break;
11220                    }
11221                }
11222                BandAttrs::VhtCapa(val) => {
11223                    if last_off == offset {
11224                        stack.push(("VhtCapa", last_off));
11225                        break;
11226                    }
11227                }
11228                BandAttrs::IftypeData(val) => {
11229                    for entry in val {
11230                        let Ok(attr) = entry else { break };
11231                        (stack, missing) = attr.lookup_attr(offset, missing_type);
11232                        if !stack.is_empty() {
11233                            break;
11234                        }
11235                    }
11236                    if !stack.is_empty() {
11237                        stack.push(("IftypeData", last_off));
11238                        break;
11239                    }
11240                }
11241                BandAttrs::EdmgChannels(val) => {
11242                    if last_off == offset {
11243                        stack.push(("EdmgChannels", last_off));
11244                        break;
11245                    }
11246                }
11247                BandAttrs::EdmgBwConfig(val) => {
11248                    if last_off == offset {
11249                        stack.push(("EdmgBwConfig", last_off));
11250                        break;
11251                    }
11252                }
11253                BandAttrs::S1gMcsNssSet(val) => {
11254                    if last_off == offset {
11255                        stack.push(("S1gMcsNssSet", last_off));
11256                        break;
11257                    }
11258                }
11259                BandAttrs::S1gCapa(val) => {
11260                    if last_off == offset {
11261                        stack.push(("S1gCapa", last_off));
11262                        break;
11263                    }
11264                }
11265                _ => {}
11266            };
11267            last_off = cur + attrs.pos;
11268        }
11269        if !stack.is_empty() {
11270            stack.push(("BandAttrs", cur));
11271        }
11272        (stack, missing)
11273    }
11274}
11275#[derive(Clone)]
11276pub enum BitrateAttrs {
11277    Rate(u32),
11278    _2ghzShortpreamble(()),
11279}
11280impl<'a> IterableBitrateAttrs<'a> {
11281    pub fn get_rate(&self) -> Result<u32, ErrorContext> {
11282        let mut iter = self.clone();
11283        iter.pos = 0;
11284        for attr in iter {
11285            if let BitrateAttrs::Rate(val) = attr? {
11286                return Ok(val);
11287            }
11288        }
11289        Err(ErrorContext::new_missing(
11290            "BitrateAttrs",
11291            "Rate",
11292            self.orig_loc,
11293            self.buf.as_ptr() as usize,
11294        ))
11295    }
11296    pub fn get_2ghz_shortpreamble(&self) -> Result<(), ErrorContext> {
11297        let mut iter = self.clone();
11298        iter.pos = 0;
11299        for attr in iter {
11300            if let BitrateAttrs::_2ghzShortpreamble(val) = attr? {
11301                return Ok(val);
11302            }
11303        }
11304        Err(ErrorContext::new_missing(
11305            "BitrateAttrs",
11306            "2ghzShortpreamble",
11307            self.orig_loc,
11308            self.buf.as_ptr() as usize,
11309        ))
11310    }
11311}
11312impl BitrateAttrs {
11313    pub fn new<'a>(buf: &'a [u8]) -> IterableBitrateAttrs<'a> {
11314        IterableBitrateAttrs::with_loc(buf, buf.as_ptr() as usize)
11315    }
11316    fn attr_from_type(r#type: u16) -> Option<&'static str> {
11317        let res = match r#type {
11318            1u16 => "Rate",
11319            2u16 => "2ghzShortpreamble",
11320            _ => return None,
11321        };
11322        Some(res)
11323    }
11324}
11325#[derive(Clone, Copy, Default)]
11326pub struct IterableBitrateAttrs<'a> {
11327    buf: &'a [u8],
11328    pos: usize,
11329    orig_loc: usize,
11330}
11331impl<'a> IterableBitrateAttrs<'a> {
11332    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
11333        Self {
11334            buf,
11335            pos: 0,
11336            orig_loc,
11337        }
11338    }
11339    pub fn get_buf(&self) -> &'a [u8] {
11340        self.buf
11341    }
11342}
11343impl<'a> Iterator for IterableBitrateAttrs<'a> {
11344    type Item = Result<BitrateAttrs, ErrorContext>;
11345    fn next(&mut self) -> Option<Self::Item> {
11346        let pos = self.pos;
11347        let mut r#type;
11348        loop {
11349            r#type = None;
11350            if self.buf.len() == self.pos {
11351                return None;
11352            }
11353            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
11354                break;
11355            };
11356            r#type = Some(header.r#type);
11357            let res = match header.r#type {
11358                1u16 => BitrateAttrs::Rate({
11359                    let res = parse_u32(next);
11360                    let Some(val) = res else { break };
11361                    val
11362                }),
11363                2u16 => BitrateAttrs::_2ghzShortpreamble(()),
11364                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
11365                n => continue,
11366            };
11367            return Some(Ok(res));
11368        }
11369        Some(Err(ErrorContext::new(
11370            "BitrateAttrs",
11371            r#type.and_then(|t| BitrateAttrs::attr_from_type(t)),
11372            self.orig_loc,
11373            self.buf.as_ptr().wrapping_add(pos) as usize,
11374        )))
11375    }
11376}
11377impl std::fmt::Debug for IterableBitrateAttrs<'_> {
11378    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11379        let mut fmt = f.debug_struct("BitrateAttrs");
11380        for attr in self.clone() {
11381            let attr = match attr {
11382                Ok(a) => a,
11383                Err(err) => {
11384                    fmt.finish()?;
11385                    f.write_str("Err(")?;
11386                    err.fmt(f)?;
11387                    return f.write_str(")");
11388                }
11389            };
11390            match attr {
11391                BitrateAttrs::Rate(val) => fmt.field("Rate", &val),
11392                BitrateAttrs::_2ghzShortpreamble(val) => fmt.field("_2ghzShortpreamble", &val),
11393            };
11394        }
11395        fmt.finish()
11396    }
11397}
11398impl IterableBitrateAttrs<'_> {
11399    pub fn lookup_attr(
11400        &self,
11401        offset: usize,
11402        missing_type: Option<u16>,
11403    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
11404        let mut stack = Vec::new();
11405        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
11406        if cur == offset {
11407            stack.push(("BitrateAttrs", offset));
11408            return (
11409                stack,
11410                missing_type.and_then(|t| BitrateAttrs::attr_from_type(t)),
11411            );
11412        }
11413        if cur > offset || cur + self.buf.len() < offset {
11414            return (stack, None);
11415        }
11416        let mut attrs = self.clone();
11417        let mut last_off = cur + attrs.pos;
11418        while let Some(attr) = attrs.next() {
11419            let Ok(attr) = attr else { break };
11420            match attr {
11421                BitrateAttrs::Rate(val) => {
11422                    if last_off == offset {
11423                        stack.push(("Rate", last_off));
11424                        break;
11425                    }
11426                }
11427                BitrateAttrs::_2ghzShortpreamble(val) => {
11428                    if last_off == offset {
11429                        stack.push(("2ghzShortpreamble", last_off));
11430                        break;
11431                    }
11432                }
11433                _ => {}
11434            };
11435            last_off = cur + attrs.pos;
11436        }
11437        if !stack.is_empty() {
11438            stack.push(("BitrateAttrs", cur));
11439        }
11440        (stack, None)
11441    }
11442}
11443#[derive(Clone)]
11444pub enum FrequencyAttrs<'a> {
11445    Freq(u32),
11446    Disabled(()),
11447    NoIr(()),
11448    NoIbss(()),
11449    Radar(()),
11450    MaxTxPower(u32),
11451    DfsState(u32),
11452    DfsTime(&'a [u8]),
11453    NoHt40Minus(&'a [u8]),
11454    NoHt40Plus(&'a [u8]),
11455    No80mhz(&'a [u8]),
11456    No160mhz(&'a [u8]),
11457    DfsCacTime(&'a [u8]),
11458    IndoorOnly(&'a [u8]),
11459    IrConcurrent(&'a [u8]),
11460    No20mhz(&'a [u8]),
11461    No10mhz(&'a [u8]),
11462    Wmm(IterableArrayWmmAttrs<'a>),
11463    NoHe(&'a [u8]),
11464    Offset(u32),
11465    _1mhz(&'a [u8]),
11466    _2mhz(&'a [u8]),
11467    _4mhz(&'a [u8]),
11468    _8mhz(&'a [u8]),
11469    _16mhz(&'a [u8]),
11470    No320mhz(&'a [u8]),
11471    NoEht(&'a [u8]),
11472    Psd(&'a [u8]),
11473    DfsConcurrent(&'a [u8]),
11474    No6ghzVlpClient(&'a [u8]),
11475    No6ghzAfcClient(&'a [u8]),
11476    CanMonitor(&'a [u8]),
11477    Allow6ghzVlpAp(&'a [u8]),
11478}
11479impl<'a> IterableFrequencyAttrs<'a> {
11480    pub fn get_freq(&self) -> Result<u32, ErrorContext> {
11481        let mut iter = self.clone();
11482        iter.pos = 0;
11483        for attr in iter {
11484            if let FrequencyAttrs::Freq(val) = attr? {
11485                return Ok(val);
11486            }
11487        }
11488        Err(ErrorContext::new_missing(
11489            "FrequencyAttrs",
11490            "Freq",
11491            self.orig_loc,
11492            self.buf.as_ptr() as usize,
11493        ))
11494    }
11495    pub fn get_disabled(&self) -> Result<(), ErrorContext> {
11496        let mut iter = self.clone();
11497        iter.pos = 0;
11498        for attr in iter {
11499            if let FrequencyAttrs::Disabled(val) = attr? {
11500                return Ok(val);
11501            }
11502        }
11503        Err(ErrorContext::new_missing(
11504            "FrequencyAttrs",
11505            "Disabled",
11506            self.orig_loc,
11507            self.buf.as_ptr() as usize,
11508        ))
11509    }
11510    pub fn get_no_ir(&self) -> Result<(), ErrorContext> {
11511        let mut iter = self.clone();
11512        iter.pos = 0;
11513        for attr in iter {
11514            if let FrequencyAttrs::NoIr(val) = attr? {
11515                return Ok(val);
11516            }
11517        }
11518        Err(ErrorContext::new_missing(
11519            "FrequencyAttrs",
11520            "NoIr",
11521            self.orig_loc,
11522            self.buf.as_ptr() as usize,
11523        ))
11524    }
11525    pub fn get_no_ibss(&self) -> Result<(), ErrorContext> {
11526        let mut iter = self.clone();
11527        iter.pos = 0;
11528        for attr in iter {
11529            if let FrequencyAttrs::NoIbss(val) = attr? {
11530                return Ok(val);
11531            }
11532        }
11533        Err(ErrorContext::new_missing(
11534            "FrequencyAttrs",
11535            "NoIbss",
11536            self.orig_loc,
11537            self.buf.as_ptr() as usize,
11538        ))
11539    }
11540    pub fn get_radar(&self) -> Result<(), ErrorContext> {
11541        let mut iter = self.clone();
11542        iter.pos = 0;
11543        for attr in iter {
11544            if let FrequencyAttrs::Radar(val) = attr? {
11545                return Ok(val);
11546            }
11547        }
11548        Err(ErrorContext::new_missing(
11549            "FrequencyAttrs",
11550            "Radar",
11551            self.orig_loc,
11552            self.buf.as_ptr() as usize,
11553        ))
11554    }
11555    pub fn get_max_tx_power(&self) -> Result<u32, ErrorContext> {
11556        let mut iter = self.clone();
11557        iter.pos = 0;
11558        for attr in iter {
11559            if let FrequencyAttrs::MaxTxPower(val) = attr? {
11560                return Ok(val);
11561            }
11562        }
11563        Err(ErrorContext::new_missing(
11564            "FrequencyAttrs",
11565            "MaxTxPower",
11566            self.orig_loc,
11567            self.buf.as_ptr() as usize,
11568        ))
11569    }
11570    pub fn get_dfs_state(&self) -> Result<u32, ErrorContext> {
11571        let mut iter = self.clone();
11572        iter.pos = 0;
11573        for attr in iter {
11574            if let FrequencyAttrs::DfsState(val) = attr? {
11575                return Ok(val);
11576            }
11577        }
11578        Err(ErrorContext::new_missing(
11579            "FrequencyAttrs",
11580            "DfsState",
11581            self.orig_loc,
11582            self.buf.as_ptr() as usize,
11583        ))
11584    }
11585    pub fn get_dfs_time(&self) -> Result<&'a [u8], ErrorContext> {
11586        let mut iter = self.clone();
11587        iter.pos = 0;
11588        for attr in iter {
11589            if let FrequencyAttrs::DfsTime(val) = attr? {
11590                return Ok(val);
11591            }
11592        }
11593        Err(ErrorContext::new_missing(
11594            "FrequencyAttrs",
11595            "DfsTime",
11596            self.orig_loc,
11597            self.buf.as_ptr() as usize,
11598        ))
11599    }
11600    pub fn get_no_ht40_minus(&self) -> Result<&'a [u8], ErrorContext> {
11601        let mut iter = self.clone();
11602        iter.pos = 0;
11603        for attr in iter {
11604            if let FrequencyAttrs::NoHt40Minus(val) = attr? {
11605                return Ok(val);
11606            }
11607        }
11608        Err(ErrorContext::new_missing(
11609            "FrequencyAttrs",
11610            "NoHt40Minus",
11611            self.orig_loc,
11612            self.buf.as_ptr() as usize,
11613        ))
11614    }
11615    pub fn get_no_ht40_plus(&self) -> Result<&'a [u8], ErrorContext> {
11616        let mut iter = self.clone();
11617        iter.pos = 0;
11618        for attr in iter {
11619            if let FrequencyAttrs::NoHt40Plus(val) = attr? {
11620                return Ok(val);
11621            }
11622        }
11623        Err(ErrorContext::new_missing(
11624            "FrequencyAttrs",
11625            "NoHt40Plus",
11626            self.orig_loc,
11627            self.buf.as_ptr() as usize,
11628        ))
11629    }
11630    pub fn get_no_80mhz(&self) -> Result<&'a [u8], ErrorContext> {
11631        let mut iter = self.clone();
11632        iter.pos = 0;
11633        for attr in iter {
11634            if let FrequencyAttrs::No80mhz(val) = attr? {
11635                return Ok(val);
11636            }
11637        }
11638        Err(ErrorContext::new_missing(
11639            "FrequencyAttrs",
11640            "No80mhz",
11641            self.orig_loc,
11642            self.buf.as_ptr() as usize,
11643        ))
11644    }
11645    pub fn get_no_160mhz(&self) -> Result<&'a [u8], ErrorContext> {
11646        let mut iter = self.clone();
11647        iter.pos = 0;
11648        for attr in iter {
11649            if let FrequencyAttrs::No160mhz(val) = attr? {
11650                return Ok(val);
11651            }
11652        }
11653        Err(ErrorContext::new_missing(
11654            "FrequencyAttrs",
11655            "No160mhz",
11656            self.orig_loc,
11657            self.buf.as_ptr() as usize,
11658        ))
11659    }
11660    pub fn get_dfs_cac_time(&self) -> Result<&'a [u8], ErrorContext> {
11661        let mut iter = self.clone();
11662        iter.pos = 0;
11663        for attr in iter {
11664            if let FrequencyAttrs::DfsCacTime(val) = attr? {
11665                return Ok(val);
11666            }
11667        }
11668        Err(ErrorContext::new_missing(
11669            "FrequencyAttrs",
11670            "DfsCacTime",
11671            self.orig_loc,
11672            self.buf.as_ptr() as usize,
11673        ))
11674    }
11675    pub fn get_indoor_only(&self) -> Result<&'a [u8], ErrorContext> {
11676        let mut iter = self.clone();
11677        iter.pos = 0;
11678        for attr in iter {
11679            if let FrequencyAttrs::IndoorOnly(val) = attr? {
11680                return Ok(val);
11681            }
11682        }
11683        Err(ErrorContext::new_missing(
11684            "FrequencyAttrs",
11685            "IndoorOnly",
11686            self.orig_loc,
11687            self.buf.as_ptr() as usize,
11688        ))
11689    }
11690    pub fn get_ir_concurrent(&self) -> Result<&'a [u8], ErrorContext> {
11691        let mut iter = self.clone();
11692        iter.pos = 0;
11693        for attr in iter {
11694            if let FrequencyAttrs::IrConcurrent(val) = attr? {
11695                return Ok(val);
11696            }
11697        }
11698        Err(ErrorContext::new_missing(
11699            "FrequencyAttrs",
11700            "IrConcurrent",
11701            self.orig_loc,
11702            self.buf.as_ptr() as usize,
11703        ))
11704    }
11705    pub fn get_no_20mhz(&self) -> Result<&'a [u8], ErrorContext> {
11706        let mut iter = self.clone();
11707        iter.pos = 0;
11708        for attr in iter {
11709            if let FrequencyAttrs::No20mhz(val) = attr? {
11710                return Ok(val);
11711            }
11712        }
11713        Err(ErrorContext::new_missing(
11714            "FrequencyAttrs",
11715            "No20mhz",
11716            self.orig_loc,
11717            self.buf.as_ptr() as usize,
11718        ))
11719    }
11720    pub fn get_no_10mhz(&self) -> Result<&'a [u8], ErrorContext> {
11721        let mut iter = self.clone();
11722        iter.pos = 0;
11723        for attr in iter {
11724            if let FrequencyAttrs::No10mhz(val) = attr? {
11725                return Ok(val);
11726            }
11727        }
11728        Err(ErrorContext::new_missing(
11729            "FrequencyAttrs",
11730            "No10mhz",
11731            self.orig_loc,
11732            self.buf.as_ptr() as usize,
11733        ))
11734    }
11735    pub fn get_wmm(
11736        &self,
11737    ) -> Result<ArrayIterable<IterableArrayWmmAttrs<'a>, IterableWmmAttrs<'a>>, ErrorContext> {
11738        for attr in self.clone() {
11739            if let FrequencyAttrs::Wmm(val) = attr? {
11740                return Ok(ArrayIterable::new(val));
11741            }
11742        }
11743        Err(ErrorContext::new_missing(
11744            "FrequencyAttrs",
11745            "Wmm",
11746            self.orig_loc,
11747            self.buf.as_ptr() as usize,
11748        ))
11749    }
11750    pub fn get_no_he(&self) -> Result<&'a [u8], ErrorContext> {
11751        let mut iter = self.clone();
11752        iter.pos = 0;
11753        for attr in iter {
11754            if let FrequencyAttrs::NoHe(val) = attr? {
11755                return Ok(val);
11756            }
11757        }
11758        Err(ErrorContext::new_missing(
11759            "FrequencyAttrs",
11760            "NoHe",
11761            self.orig_loc,
11762            self.buf.as_ptr() as usize,
11763        ))
11764    }
11765    pub fn get_offset(&self) -> Result<u32, ErrorContext> {
11766        let mut iter = self.clone();
11767        iter.pos = 0;
11768        for attr in iter {
11769            if let FrequencyAttrs::Offset(val) = attr? {
11770                return Ok(val);
11771            }
11772        }
11773        Err(ErrorContext::new_missing(
11774            "FrequencyAttrs",
11775            "Offset",
11776            self.orig_loc,
11777            self.buf.as_ptr() as usize,
11778        ))
11779    }
11780    pub fn get_1mhz(&self) -> Result<&'a [u8], ErrorContext> {
11781        let mut iter = self.clone();
11782        iter.pos = 0;
11783        for attr in iter {
11784            if let FrequencyAttrs::_1mhz(val) = attr? {
11785                return Ok(val);
11786            }
11787        }
11788        Err(ErrorContext::new_missing(
11789            "FrequencyAttrs",
11790            "1mhz",
11791            self.orig_loc,
11792            self.buf.as_ptr() as usize,
11793        ))
11794    }
11795    pub fn get_2mhz(&self) -> Result<&'a [u8], ErrorContext> {
11796        let mut iter = self.clone();
11797        iter.pos = 0;
11798        for attr in iter {
11799            if let FrequencyAttrs::_2mhz(val) = attr? {
11800                return Ok(val);
11801            }
11802        }
11803        Err(ErrorContext::new_missing(
11804            "FrequencyAttrs",
11805            "2mhz",
11806            self.orig_loc,
11807            self.buf.as_ptr() as usize,
11808        ))
11809    }
11810    pub fn get_4mhz(&self) -> Result<&'a [u8], ErrorContext> {
11811        let mut iter = self.clone();
11812        iter.pos = 0;
11813        for attr in iter {
11814            if let FrequencyAttrs::_4mhz(val) = attr? {
11815                return Ok(val);
11816            }
11817        }
11818        Err(ErrorContext::new_missing(
11819            "FrequencyAttrs",
11820            "4mhz",
11821            self.orig_loc,
11822            self.buf.as_ptr() as usize,
11823        ))
11824    }
11825    pub fn get_8mhz(&self) -> Result<&'a [u8], ErrorContext> {
11826        let mut iter = self.clone();
11827        iter.pos = 0;
11828        for attr in iter {
11829            if let FrequencyAttrs::_8mhz(val) = attr? {
11830                return Ok(val);
11831            }
11832        }
11833        Err(ErrorContext::new_missing(
11834            "FrequencyAttrs",
11835            "8mhz",
11836            self.orig_loc,
11837            self.buf.as_ptr() as usize,
11838        ))
11839    }
11840    pub fn get_16mhz(&self) -> Result<&'a [u8], ErrorContext> {
11841        let mut iter = self.clone();
11842        iter.pos = 0;
11843        for attr in iter {
11844            if let FrequencyAttrs::_16mhz(val) = attr? {
11845                return Ok(val);
11846            }
11847        }
11848        Err(ErrorContext::new_missing(
11849            "FrequencyAttrs",
11850            "16mhz",
11851            self.orig_loc,
11852            self.buf.as_ptr() as usize,
11853        ))
11854    }
11855    pub fn get_no_320mhz(&self) -> Result<&'a [u8], ErrorContext> {
11856        let mut iter = self.clone();
11857        iter.pos = 0;
11858        for attr in iter {
11859            if let FrequencyAttrs::No320mhz(val) = attr? {
11860                return Ok(val);
11861            }
11862        }
11863        Err(ErrorContext::new_missing(
11864            "FrequencyAttrs",
11865            "No320mhz",
11866            self.orig_loc,
11867            self.buf.as_ptr() as usize,
11868        ))
11869    }
11870    pub fn get_no_eht(&self) -> Result<&'a [u8], ErrorContext> {
11871        let mut iter = self.clone();
11872        iter.pos = 0;
11873        for attr in iter {
11874            if let FrequencyAttrs::NoEht(val) = attr? {
11875                return Ok(val);
11876            }
11877        }
11878        Err(ErrorContext::new_missing(
11879            "FrequencyAttrs",
11880            "NoEht",
11881            self.orig_loc,
11882            self.buf.as_ptr() as usize,
11883        ))
11884    }
11885    pub fn get_psd(&self) -> Result<&'a [u8], ErrorContext> {
11886        let mut iter = self.clone();
11887        iter.pos = 0;
11888        for attr in iter {
11889            if let FrequencyAttrs::Psd(val) = attr? {
11890                return Ok(val);
11891            }
11892        }
11893        Err(ErrorContext::new_missing(
11894            "FrequencyAttrs",
11895            "Psd",
11896            self.orig_loc,
11897            self.buf.as_ptr() as usize,
11898        ))
11899    }
11900    pub fn get_dfs_concurrent(&self) -> Result<&'a [u8], ErrorContext> {
11901        let mut iter = self.clone();
11902        iter.pos = 0;
11903        for attr in iter {
11904            if let FrequencyAttrs::DfsConcurrent(val) = attr? {
11905                return Ok(val);
11906            }
11907        }
11908        Err(ErrorContext::new_missing(
11909            "FrequencyAttrs",
11910            "DfsConcurrent",
11911            self.orig_loc,
11912            self.buf.as_ptr() as usize,
11913        ))
11914    }
11915    pub fn get_no_6ghz_vlp_client(&self) -> Result<&'a [u8], ErrorContext> {
11916        let mut iter = self.clone();
11917        iter.pos = 0;
11918        for attr in iter {
11919            if let FrequencyAttrs::No6ghzVlpClient(val) = attr? {
11920                return Ok(val);
11921            }
11922        }
11923        Err(ErrorContext::new_missing(
11924            "FrequencyAttrs",
11925            "No6ghzVlpClient",
11926            self.orig_loc,
11927            self.buf.as_ptr() as usize,
11928        ))
11929    }
11930    pub fn get_no_6ghz_afc_client(&self) -> Result<&'a [u8], ErrorContext> {
11931        let mut iter = self.clone();
11932        iter.pos = 0;
11933        for attr in iter {
11934            if let FrequencyAttrs::No6ghzAfcClient(val) = attr? {
11935                return Ok(val);
11936            }
11937        }
11938        Err(ErrorContext::new_missing(
11939            "FrequencyAttrs",
11940            "No6ghzAfcClient",
11941            self.orig_loc,
11942            self.buf.as_ptr() as usize,
11943        ))
11944    }
11945    pub fn get_can_monitor(&self) -> Result<&'a [u8], ErrorContext> {
11946        let mut iter = self.clone();
11947        iter.pos = 0;
11948        for attr in iter {
11949            if let FrequencyAttrs::CanMonitor(val) = attr? {
11950                return Ok(val);
11951            }
11952        }
11953        Err(ErrorContext::new_missing(
11954            "FrequencyAttrs",
11955            "CanMonitor",
11956            self.orig_loc,
11957            self.buf.as_ptr() as usize,
11958        ))
11959    }
11960    pub fn get_allow_6ghz_vlp_ap(&self) -> Result<&'a [u8], ErrorContext> {
11961        let mut iter = self.clone();
11962        iter.pos = 0;
11963        for attr in iter {
11964            if let FrequencyAttrs::Allow6ghzVlpAp(val) = attr? {
11965                return Ok(val);
11966            }
11967        }
11968        Err(ErrorContext::new_missing(
11969            "FrequencyAttrs",
11970            "Allow6ghzVlpAp",
11971            self.orig_loc,
11972            self.buf.as_ptr() as usize,
11973        ))
11974    }
11975}
11976impl WmmAttrs {
11977    pub fn new_array(buf: &[u8]) -> IterableArrayWmmAttrs<'_> {
11978        IterableArrayWmmAttrs::with_loc(buf, buf.as_ptr() as usize)
11979    }
11980}
11981#[derive(Clone, Copy, Default)]
11982pub struct IterableArrayWmmAttrs<'a> {
11983    buf: &'a [u8],
11984    pos: usize,
11985    orig_loc: usize,
11986}
11987impl<'a> IterableArrayWmmAttrs<'a> {
11988    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
11989        Self {
11990            buf,
11991            pos: 0,
11992            orig_loc,
11993        }
11994    }
11995    pub fn get_buf(&self) -> &'a [u8] {
11996        self.buf
11997    }
11998}
11999impl<'a> Iterator for IterableArrayWmmAttrs<'a> {
12000    type Item = Result<IterableWmmAttrs<'a>, ErrorContext>;
12001    fn next(&mut self) -> Option<Self::Item> {
12002        if self.buf.len() == self.pos {
12003            return None;
12004        }
12005        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
12006            {
12007                return Some(Ok(IterableWmmAttrs::with_loc(next, self.orig_loc)));
12008            }
12009        }
12010        Some(Err(ErrorContext::new(
12011            "WmmAttrs",
12012            None,
12013            self.orig_loc,
12014            self.buf.as_ptr().wrapping_add(self.pos) as usize,
12015        )))
12016    }
12017}
12018impl FrequencyAttrs<'_> {
12019    pub fn new<'a>(buf: &'a [u8]) -> IterableFrequencyAttrs<'a> {
12020        IterableFrequencyAttrs::with_loc(buf, buf.as_ptr() as usize)
12021    }
12022    fn attr_from_type(r#type: u16) -> Option<&'static str> {
12023        let res = match r#type {
12024            1u16 => "Freq",
12025            2u16 => "Disabled",
12026            3u16 => "NoIr",
12027            4u16 => "NoIbss",
12028            5u16 => "Radar",
12029            6u16 => "MaxTxPower",
12030            7u16 => "DfsState",
12031            8u16 => "DfsTime",
12032            9u16 => "NoHt40Minus",
12033            10u16 => "NoHt40Plus",
12034            11u16 => "No80mhz",
12035            12u16 => "No160mhz",
12036            13u16 => "DfsCacTime",
12037            14u16 => "IndoorOnly",
12038            15u16 => "IrConcurrent",
12039            16u16 => "No20mhz",
12040            17u16 => "No10mhz",
12041            18u16 => "Wmm",
12042            19u16 => "NoHe",
12043            20u16 => "Offset",
12044            21u16 => "1mhz",
12045            22u16 => "2mhz",
12046            23u16 => "4mhz",
12047            24u16 => "8mhz",
12048            25u16 => "16mhz",
12049            26u16 => "No320mhz",
12050            27u16 => "NoEht",
12051            28u16 => "Psd",
12052            29u16 => "DfsConcurrent",
12053            30u16 => "No6ghzVlpClient",
12054            31u16 => "No6ghzAfcClient",
12055            32u16 => "CanMonitor",
12056            33u16 => "Allow6ghzVlpAp",
12057            _ => return None,
12058        };
12059        Some(res)
12060    }
12061}
12062#[derive(Clone, Copy, Default)]
12063pub struct IterableFrequencyAttrs<'a> {
12064    buf: &'a [u8],
12065    pos: usize,
12066    orig_loc: usize,
12067}
12068impl<'a> IterableFrequencyAttrs<'a> {
12069    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12070        Self {
12071            buf,
12072            pos: 0,
12073            orig_loc,
12074        }
12075    }
12076    pub fn get_buf(&self) -> &'a [u8] {
12077        self.buf
12078    }
12079}
12080impl<'a> Iterator for IterableFrequencyAttrs<'a> {
12081    type Item = Result<FrequencyAttrs<'a>, ErrorContext>;
12082    fn next(&mut self) -> Option<Self::Item> {
12083        let pos = self.pos;
12084        let mut r#type;
12085        loop {
12086            r#type = None;
12087            if self.buf.len() == self.pos {
12088                return None;
12089            }
12090            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
12091                break;
12092            };
12093            r#type = Some(header.r#type);
12094            let res = match header.r#type {
12095                1u16 => FrequencyAttrs::Freq({
12096                    let res = parse_u32(next);
12097                    let Some(val) = res else { break };
12098                    val
12099                }),
12100                2u16 => FrequencyAttrs::Disabled(()),
12101                3u16 => FrequencyAttrs::NoIr(()),
12102                4u16 => FrequencyAttrs::NoIbss(()),
12103                5u16 => FrequencyAttrs::Radar(()),
12104                6u16 => FrequencyAttrs::MaxTxPower({
12105                    let res = parse_u32(next);
12106                    let Some(val) = res else { break };
12107                    val
12108                }),
12109                7u16 => FrequencyAttrs::DfsState({
12110                    let res = parse_u32(next);
12111                    let Some(val) = res else { break };
12112                    val
12113                }),
12114                8u16 => FrequencyAttrs::DfsTime({
12115                    let res = Some(next);
12116                    let Some(val) = res else { break };
12117                    val
12118                }),
12119                9u16 => FrequencyAttrs::NoHt40Minus({
12120                    let res = Some(next);
12121                    let Some(val) = res else { break };
12122                    val
12123                }),
12124                10u16 => FrequencyAttrs::NoHt40Plus({
12125                    let res = Some(next);
12126                    let Some(val) = res else { break };
12127                    val
12128                }),
12129                11u16 => FrequencyAttrs::No80mhz({
12130                    let res = Some(next);
12131                    let Some(val) = res else { break };
12132                    val
12133                }),
12134                12u16 => FrequencyAttrs::No160mhz({
12135                    let res = Some(next);
12136                    let Some(val) = res else { break };
12137                    val
12138                }),
12139                13u16 => FrequencyAttrs::DfsCacTime({
12140                    let res = Some(next);
12141                    let Some(val) = res else { break };
12142                    val
12143                }),
12144                14u16 => FrequencyAttrs::IndoorOnly({
12145                    let res = Some(next);
12146                    let Some(val) = res else { break };
12147                    val
12148                }),
12149                15u16 => FrequencyAttrs::IrConcurrent({
12150                    let res = Some(next);
12151                    let Some(val) = res else { break };
12152                    val
12153                }),
12154                16u16 => FrequencyAttrs::No20mhz({
12155                    let res = Some(next);
12156                    let Some(val) = res else { break };
12157                    val
12158                }),
12159                17u16 => FrequencyAttrs::No10mhz({
12160                    let res = Some(next);
12161                    let Some(val) = res else { break };
12162                    val
12163                }),
12164                18u16 => FrequencyAttrs::Wmm({
12165                    let res = Some(IterableArrayWmmAttrs::with_loc(next, self.orig_loc));
12166                    let Some(val) = res else { break };
12167                    val
12168                }),
12169                19u16 => FrequencyAttrs::NoHe({
12170                    let res = Some(next);
12171                    let Some(val) = res else { break };
12172                    val
12173                }),
12174                20u16 => FrequencyAttrs::Offset({
12175                    let res = parse_u32(next);
12176                    let Some(val) = res else { break };
12177                    val
12178                }),
12179                21u16 => FrequencyAttrs::_1mhz({
12180                    let res = Some(next);
12181                    let Some(val) = res else { break };
12182                    val
12183                }),
12184                22u16 => FrequencyAttrs::_2mhz({
12185                    let res = Some(next);
12186                    let Some(val) = res else { break };
12187                    val
12188                }),
12189                23u16 => FrequencyAttrs::_4mhz({
12190                    let res = Some(next);
12191                    let Some(val) = res else { break };
12192                    val
12193                }),
12194                24u16 => FrequencyAttrs::_8mhz({
12195                    let res = Some(next);
12196                    let Some(val) = res else { break };
12197                    val
12198                }),
12199                25u16 => FrequencyAttrs::_16mhz({
12200                    let res = Some(next);
12201                    let Some(val) = res else { break };
12202                    val
12203                }),
12204                26u16 => FrequencyAttrs::No320mhz({
12205                    let res = Some(next);
12206                    let Some(val) = res else { break };
12207                    val
12208                }),
12209                27u16 => FrequencyAttrs::NoEht({
12210                    let res = Some(next);
12211                    let Some(val) = res else { break };
12212                    val
12213                }),
12214                28u16 => FrequencyAttrs::Psd({
12215                    let res = Some(next);
12216                    let Some(val) = res else { break };
12217                    val
12218                }),
12219                29u16 => FrequencyAttrs::DfsConcurrent({
12220                    let res = Some(next);
12221                    let Some(val) = res else { break };
12222                    val
12223                }),
12224                30u16 => FrequencyAttrs::No6ghzVlpClient({
12225                    let res = Some(next);
12226                    let Some(val) = res else { break };
12227                    val
12228                }),
12229                31u16 => FrequencyAttrs::No6ghzAfcClient({
12230                    let res = Some(next);
12231                    let Some(val) = res else { break };
12232                    val
12233                }),
12234                32u16 => FrequencyAttrs::CanMonitor({
12235                    let res = Some(next);
12236                    let Some(val) = res else { break };
12237                    val
12238                }),
12239                33u16 => FrequencyAttrs::Allow6ghzVlpAp({
12240                    let res = Some(next);
12241                    let Some(val) = res else { break };
12242                    val
12243                }),
12244                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
12245                n => continue,
12246            };
12247            return Some(Ok(res));
12248        }
12249        Some(Err(ErrorContext::new(
12250            "FrequencyAttrs",
12251            r#type.and_then(|t| FrequencyAttrs::attr_from_type(t)),
12252            self.orig_loc,
12253            self.buf.as_ptr().wrapping_add(pos) as usize,
12254        )))
12255    }
12256}
12257impl std::fmt::Debug for IterableArrayWmmAttrs<'_> {
12258    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12259        fmt.debug_list()
12260            .entries(self.clone().map(FlattenErrorContext))
12261            .finish()
12262    }
12263}
12264impl<'a> std::fmt::Debug for IterableFrequencyAttrs<'_> {
12265    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12266        let mut fmt = f.debug_struct("FrequencyAttrs");
12267        for attr in self.clone() {
12268            let attr = match attr {
12269                Ok(a) => a,
12270                Err(err) => {
12271                    fmt.finish()?;
12272                    f.write_str("Err(")?;
12273                    err.fmt(f)?;
12274                    return f.write_str(")");
12275                }
12276            };
12277            match attr {
12278                FrequencyAttrs::Freq(val) => fmt.field("Freq", &val),
12279                FrequencyAttrs::Disabled(val) => fmt.field("Disabled", &val),
12280                FrequencyAttrs::NoIr(val) => fmt.field("NoIr", &val),
12281                FrequencyAttrs::NoIbss(val) => fmt.field("NoIbss", &val),
12282                FrequencyAttrs::Radar(val) => fmt.field("Radar", &val),
12283                FrequencyAttrs::MaxTxPower(val) => fmt.field("MaxTxPower", &val),
12284                FrequencyAttrs::DfsState(val) => fmt.field("DfsState", &val),
12285                FrequencyAttrs::DfsTime(val) => fmt.field("DfsTime", &val),
12286                FrequencyAttrs::NoHt40Minus(val) => fmt.field("NoHt40Minus", &val),
12287                FrequencyAttrs::NoHt40Plus(val) => fmt.field("NoHt40Plus", &val),
12288                FrequencyAttrs::No80mhz(val) => fmt.field("No80mhz", &val),
12289                FrequencyAttrs::No160mhz(val) => fmt.field("No160mhz", &val),
12290                FrequencyAttrs::DfsCacTime(val) => fmt.field("DfsCacTime", &val),
12291                FrequencyAttrs::IndoorOnly(val) => fmt.field("IndoorOnly", &val),
12292                FrequencyAttrs::IrConcurrent(val) => fmt.field("IrConcurrent", &val),
12293                FrequencyAttrs::No20mhz(val) => fmt.field("No20mhz", &val),
12294                FrequencyAttrs::No10mhz(val) => fmt.field("No10mhz", &val),
12295                FrequencyAttrs::Wmm(val) => fmt.field("Wmm", &val),
12296                FrequencyAttrs::NoHe(val) => fmt.field("NoHe", &val),
12297                FrequencyAttrs::Offset(val) => fmt.field("Offset", &val),
12298                FrequencyAttrs::_1mhz(val) => fmt.field("_1mhz", &val),
12299                FrequencyAttrs::_2mhz(val) => fmt.field("_2mhz", &val),
12300                FrequencyAttrs::_4mhz(val) => fmt.field("_4mhz", &val),
12301                FrequencyAttrs::_8mhz(val) => fmt.field("_8mhz", &val),
12302                FrequencyAttrs::_16mhz(val) => fmt.field("_16mhz", &val),
12303                FrequencyAttrs::No320mhz(val) => fmt.field("No320mhz", &val),
12304                FrequencyAttrs::NoEht(val) => fmt.field("NoEht", &val),
12305                FrequencyAttrs::Psd(val) => fmt.field("Psd", &val),
12306                FrequencyAttrs::DfsConcurrent(val) => fmt.field("DfsConcurrent", &val),
12307                FrequencyAttrs::No6ghzVlpClient(val) => fmt.field("No6ghzVlpClient", &val),
12308                FrequencyAttrs::No6ghzAfcClient(val) => fmt.field("No6ghzAfcClient", &val),
12309                FrequencyAttrs::CanMonitor(val) => fmt.field("CanMonitor", &val),
12310                FrequencyAttrs::Allow6ghzVlpAp(val) => fmt.field("Allow6ghzVlpAp", &val),
12311            };
12312        }
12313        fmt.finish()
12314    }
12315}
12316impl IterableFrequencyAttrs<'_> {
12317    pub fn lookup_attr(
12318        &self,
12319        offset: usize,
12320        missing_type: Option<u16>,
12321    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
12322        let mut stack = Vec::new();
12323        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
12324        if cur == offset {
12325            stack.push(("FrequencyAttrs", offset));
12326            return (
12327                stack,
12328                missing_type.and_then(|t| FrequencyAttrs::attr_from_type(t)),
12329            );
12330        }
12331        if cur > offset || cur + self.buf.len() < offset {
12332            return (stack, None);
12333        }
12334        let mut attrs = self.clone();
12335        let mut last_off = cur + attrs.pos;
12336        let mut missing = None;
12337        while let Some(attr) = attrs.next() {
12338            let Ok(attr) = attr else { break };
12339            match attr {
12340                FrequencyAttrs::Freq(val) => {
12341                    if last_off == offset {
12342                        stack.push(("Freq", last_off));
12343                        break;
12344                    }
12345                }
12346                FrequencyAttrs::Disabled(val) => {
12347                    if last_off == offset {
12348                        stack.push(("Disabled", last_off));
12349                        break;
12350                    }
12351                }
12352                FrequencyAttrs::NoIr(val) => {
12353                    if last_off == offset {
12354                        stack.push(("NoIr", last_off));
12355                        break;
12356                    }
12357                }
12358                FrequencyAttrs::NoIbss(val) => {
12359                    if last_off == offset {
12360                        stack.push(("NoIbss", last_off));
12361                        break;
12362                    }
12363                }
12364                FrequencyAttrs::Radar(val) => {
12365                    if last_off == offset {
12366                        stack.push(("Radar", last_off));
12367                        break;
12368                    }
12369                }
12370                FrequencyAttrs::MaxTxPower(val) => {
12371                    if last_off == offset {
12372                        stack.push(("MaxTxPower", last_off));
12373                        break;
12374                    }
12375                }
12376                FrequencyAttrs::DfsState(val) => {
12377                    if last_off == offset {
12378                        stack.push(("DfsState", last_off));
12379                        break;
12380                    }
12381                }
12382                FrequencyAttrs::DfsTime(val) => {
12383                    if last_off == offset {
12384                        stack.push(("DfsTime", last_off));
12385                        break;
12386                    }
12387                }
12388                FrequencyAttrs::NoHt40Minus(val) => {
12389                    if last_off == offset {
12390                        stack.push(("NoHt40Minus", last_off));
12391                        break;
12392                    }
12393                }
12394                FrequencyAttrs::NoHt40Plus(val) => {
12395                    if last_off == offset {
12396                        stack.push(("NoHt40Plus", last_off));
12397                        break;
12398                    }
12399                }
12400                FrequencyAttrs::No80mhz(val) => {
12401                    if last_off == offset {
12402                        stack.push(("No80mhz", last_off));
12403                        break;
12404                    }
12405                }
12406                FrequencyAttrs::No160mhz(val) => {
12407                    if last_off == offset {
12408                        stack.push(("No160mhz", last_off));
12409                        break;
12410                    }
12411                }
12412                FrequencyAttrs::DfsCacTime(val) => {
12413                    if last_off == offset {
12414                        stack.push(("DfsCacTime", last_off));
12415                        break;
12416                    }
12417                }
12418                FrequencyAttrs::IndoorOnly(val) => {
12419                    if last_off == offset {
12420                        stack.push(("IndoorOnly", last_off));
12421                        break;
12422                    }
12423                }
12424                FrequencyAttrs::IrConcurrent(val) => {
12425                    if last_off == offset {
12426                        stack.push(("IrConcurrent", last_off));
12427                        break;
12428                    }
12429                }
12430                FrequencyAttrs::No20mhz(val) => {
12431                    if last_off == offset {
12432                        stack.push(("No20mhz", last_off));
12433                        break;
12434                    }
12435                }
12436                FrequencyAttrs::No10mhz(val) => {
12437                    if last_off == offset {
12438                        stack.push(("No10mhz", last_off));
12439                        break;
12440                    }
12441                }
12442                FrequencyAttrs::Wmm(val) => {
12443                    for entry in val {
12444                        let Ok(attr) = entry else { break };
12445                        (stack, missing) = attr.lookup_attr(offset, missing_type);
12446                        if !stack.is_empty() {
12447                            break;
12448                        }
12449                    }
12450                    if !stack.is_empty() {
12451                        stack.push(("Wmm", last_off));
12452                        break;
12453                    }
12454                }
12455                FrequencyAttrs::NoHe(val) => {
12456                    if last_off == offset {
12457                        stack.push(("NoHe", last_off));
12458                        break;
12459                    }
12460                }
12461                FrequencyAttrs::Offset(val) => {
12462                    if last_off == offset {
12463                        stack.push(("Offset", last_off));
12464                        break;
12465                    }
12466                }
12467                FrequencyAttrs::_1mhz(val) => {
12468                    if last_off == offset {
12469                        stack.push(("1mhz", last_off));
12470                        break;
12471                    }
12472                }
12473                FrequencyAttrs::_2mhz(val) => {
12474                    if last_off == offset {
12475                        stack.push(("2mhz", last_off));
12476                        break;
12477                    }
12478                }
12479                FrequencyAttrs::_4mhz(val) => {
12480                    if last_off == offset {
12481                        stack.push(("4mhz", last_off));
12482                        break;
12483                    }
12484                }
12485                FrequencyAttrs::_8mhz(val) => {
12486                    if last_off == offset {
12487                        stack.push(("8mhz", last_off));
12488                        break;
12489                    }
12490                }
12491                FrequencyAttrs::_16mhz(val) => {
12492                    if last_off == offset {
12493                        stack.push(("16mhz", last_off));
12494                        break;
12495                    }
12496                }
12497                FrequencyAttrs::No320mhz(val) => {
12498                    if last_off == offset {
12499                        stack.push(("No320mhz", last_off));
12500                        break;
12501                    }
12502                }
12503                FrequencyAttrs::NoEht(val) => {
12504                    if last_off == offset {
12505                        stack.push(("NoEht", last_off));
12506                        break;
12507                    }
12508                }
12509                FrequencyAttrs::Psd(val) => {
12510                    if last_off == offset {
12511                        stack.push(("Psd", last_off));
12512                        break;
12513                    }
12514                }
12515                FrequencyAttrs::DfsConcurrent(val) => {
12516                    if last_off == offset {
12517                        stack.push(("DfsConcurrent", last_off));
12518                        break;
12519                    }
12520                }
12521                FrequencyAttrs::No6ghzVlpClient(val) => {
12522                    if last_off == offset {
12523                        stack.push(("No6ghzVlpClient", last_off));
12524                        break;
12525                    }
12526                }
12527                FrequencyAttrs::No6ghzAfcClient(val) => {
12528                    if last_off == offset {
12529                        stack.push(("No6ghzAfcClient", last_off));
12530                        break;
12531                    }
12532                }
12533                FrequencyAttrs::CanMonitor(val) => {
12534                    if last_off == offset {
12535                        stack.push(("CanMonitor", last_off));
12536                        break;
12537                    }
12538                }
12539                FrequencyAttrs::Allow6ghzVlpAp(val) => {
12540                    if last_off == offset {
12541                        stack.push(("Allow6ghzVlpAp", last_off));
12542                        break;
12543                    }
12544                }
12545                _ => {}
12546            };
12547            last_off = cur + attrs.pos;
12548        }
12549        if !stack.is_empty() {
12550            stack.push(("FrequencyAttrs", cur));
12551        }
12552        (stack, missing)
12553    }
12554}
12555#[derive(Clone)]
12556pub enum IfCombinationAttributes<'a> {
12557    Limits(IterableArrayIfaceLimitAttributes<'a>),
12558    Maxnum(u32),
12559    StaApBiMatch(()),
12560    NumChannels(u32),
12561    RadarDetectWidths(u32),
12562    RadarDetectRegions(u32),
12563    BiMinGcd(u32),
12564}
12565impl<'a> IterableIfCombinationAttributes<'a> {
12566    pub fn get_limits(
12567        &self,
12568    ) -> Result<
12569        ArrayIterable<IterableArrayIfaceLimitAttributes<'a>, IterableIfaceLimitAttributes<'a>>,
12570        ErrorContext,
12571    > {
12572        for attr in self.clone() {
12573            if let IfCombinationAttributes::Limits(val) = attr? {
12574                return Ok(ArrayIterable::new(val));
12575            }
12576        }
12577        Err(ErrorContext::new_missing(
12578            "IfCombinationAttributes",
12579            "Limits",
12580            self.orig_loc,
12581            self.buf.as_ptr() as usize,
12582        ))
12583    }
12584    pub fn get_maxnum(&self) -> Result<u32, ErrorContext> {
12585        let mut iter = self.clone();
12586        iter.pos = 0;
12587        for attr in iter {
12588            if let IfCombinationAttributes::Maxnum(val) = attr? {
12589                return Ok(val);
12590            }
12591        }
12592        Err(ErrorContext::new_missing(
12593            "IfCombinationAttributes",
12594            "Maxnum",
12595            self.orig_loc,
12596            self.buf.as_ptr() as usize,
12597        ))
12598    }
12599    pub fn get_sta_ap_bi_match(&self) -> Result<(), ErrorContext> {
12600        let mut iter = self.clone();
12601        iter.pos = 0;
12602        for attr in iter {
12603            if let IfCombinationAttributes::StaApBiMatch(val) = attr? {
12604                return Ok(val);
12605            }
12606        }
12607        Err(ErrorContext::new_missing(
12608            "IfCombinationAttributes",
12609            "StaApBiMatch",
12610            self.orig_loc,
12611            self.buf.as_ptr() as usize,
12612        ))
12613    }
12614    pub fn get_num_channels(&self) -> Result<u32, ErrorContext> {
12615        let mut iter = self.clone();
12616        iter.pos = 0;
12617        for attr in iter {
12618            if let IfCombinationAttributes::NumChannels(val) = attr? {
12619                return Ok(val);
12620            }
12621        }
12622        Err(ErrorContext::new_missing(
12623            "IfCombinationAttributes",
12624            "NumChannels",
12625            self.orig_loc,
12626            self.buf.as_ptr() as usize,
12627        ))
12628    }
12629    pub fn get_radar_detect_widths(&self) -> Result<u32, ErrorContext> {
12630        let mut iter = self.clone();
12631        iter.pos = 0;
12632        for attr in iter {
12633            if let IfCombinationAttributes::RadarDetectWidths(val) = attr? {
12634                return Ok(val);
12635            }
12636        }
12637        Err(ErrorContext::new_missing(
12638            "IfCombinationAttributes",
12639            "RadarDetectWidths",
12640            self.orig_loc,
12641            self.buf.as_ptr() as usize,
12642        ))
12643    }
12644    pub fn get_radar_detect_regions(&self) -> Result<u32, ErrorContext> {
12645        let mut iter = self.clone();
12646        iter.pos = 0;
12647        for attr in iter {
12648            if let IfCombinationAttributes::RadarDetectRegions(val) = attr? {
12649                return Ok(val);
12650            }
12651        }
12652        Err(ErrorContext::new_missing(
12653            "IfCombinationAttributes",
12654            "RadarDetectRegions",
12655            self.orig_loc,
12656            self.buf.as_ptr() as usize,
12657        ))
12658    }
12659    pub fn get_bi_min_gcd(&self) -> Result<u32, ErrorContext> {
12660        let mut iter = self.clone();
12661        iter.pos = 0;
12662        for attr in iter {
12663            if let IfCombinationAttributes::BiMinGcd(val) = attr? {
12664                return Ok(val);
12665            }
12666        }
12667        Err(ErrorContext::new_missing(
12668            "IfCombinationAttributes",
12669            "BiMinGcd",
12670            self.orig_loc,
12671            self.buf.as_ptr() as usize,
12672        ))
12673    }
12674}
12675impl<'a> IfaceLimitAttributes<'a> {
12676    pub fn new_array(buf: &[u8]) -> IterableArrayIfaceLimitAttributes<'_> {
12677        IterableArrayIfaceLimitAttributes::with_loc(buf, buf.as_ptr() as usize)
12678    }
12679}
12680#[derive(Clone, Copy, Default)]
12681pub struct IterableArrayIfaceLimitAttributes<'a> {
12682    buf: &'a [u8],
12683    pos: usize,
12684    orig_loc: usize,
12685}
12686impl<'a> IterableArrayIfaceLimitAttributes<'a> {
12687    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12688        Self {
12689            buf,
12690            pos: 0,
12691            orig_loc,
12692        }
12693    }
12694    pub fn get_buf(&self) -> &'a [u8] {
12695        self.buf
12696    }
12697}
12698impl<'a> Iterator for IterableArrayIfaceLimitAttributes<'a> {
12699    type Item = Result<IterableIfaceLimitAttributes<'a>, ErrorContext>;
12700    fn next(&mut self) -> Option<Self::Item> {
12701        if self.buf.len() == self.pos {
12702            return None;
12703        }
12704        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
12705            {
12706                return Some(Ok(IterableIfaceLimitAttributes::with_loc(
12707                    next,
12708                    self.orig_loc,
12709                )));
12710            }
12711        }
12712        Some(Err(ErrorContext::new(
12713            "IfaceLimitAttributes",
12714            None,
12715            self.orig_loc,
12716            self.buf.as_ptr().wrapping_add(self.pos) as usize,
12717        )))
12718    }
12719}
12720impl IfCombinationAttributes<'_> {
12721    pub fn new<'a>(buf: &'a [u8]) -> IterableIfCombinationAttributes<'a> {
12722        IterableIfCombinationAttributes::with_loc(buf, buf.as_ptr() as usize)
12723    }
12724    fn attr_from_type(r#type: u16) -> Option<&'static str> {
12725        let res = match r#type {
12726            1u16 => "Limits",
12727            2u16 => "Maxnum",
12728            3u16 => "StaApBiMatch",
12729            4u16 => "NumChannels",
12730            5u16 => "RadarDetectWidths",
12731            6u16 => "RadarDetectRegions",
12732            7u16 => "BiMinGcd",
12733            _ => return None,
12734        };
12735        Some(res)
12736    }
12737}
12738#[derive(Clone, Copy, Default)]
12739pub struct IterableIfCombinationAttributes<'a> {
12740    buf: &'a [u8],
12741    pos: usize,
12742    orig_loc: usize,
12743}
12744impl<'a> IterableIfCombinationAttributes<'a> {
12745    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12746        Self {
12747            buf,
12748            pos: 0,
12749            orig_loc,
12750        }
12751    }
12752    pub fn get_buf(&self) -> &'a [u8] {
12753        self.buf
12754    }
12755}
12756impl<'a> Iterator for IterableIfCombinationAttributes<'a> {
12757    type Item = Result<IfCombinationAttributes<'a>, ErrorContext>;
12758    fn next(&mut self) -> Option<Self::Item> {
12759        let pos = self.pos;
12760        let mut r#type;
12761        loop {
12762            r#type = None;
12763            if self.buf.len() == self.pos {
12764                return None;
12765            }
12766            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
12767                break;
12768            };
12769            r#type = Some(header.r#type);
12770            let res = match header.r#type {
12771                1u16 => IfCombinationAttributes::Limits({
12772                    let res = Some(IterableArrayIfaceLimitAttributes::with_loc(
12773                        next,
12774                        self.orig_loc,
12775                    ));
12776                    let Some(val) = res else { break };
12777                    val
12778                }),
12779                2u16 => IfCombinationAttributes::Maxnum({
12780                    let res = parse_u32(next);
12781                    let Some(val) = res else { break };
12782                    val
12783                }),
12784                3u16 => IfCombinationAttributes::StaApBiMatch(()),
12785                4u16 => IfCombinationAttributes::NumChannels({
12786                    let res = parse_u32(next);
12787                    let Some(val) = res else { break };
12788                    val
12789                }),
12790                5u16 => IfCombinationAttributes::RadarDetectWidths({
12791                    let res = parse_u32(next);
12792                    let Some(val) = res else { break };
12793                    val
12794                }),
12795                6u16 => IfCombinationAttributes::RadarDetectRegions({
12796                    let res = parse_u32(next);
12797                    let Some(val) = res else { break };
12798                    val
12799                }),
12800                7u16 => IfCombinationAttributes::BiMinGcd({
12801                    let res = parse_u32(next);
12802                    let Some(val) = res else { break };
12803                    val
12804                }),
12805                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
12806                n => continue,
12807            };
12808            return Some(Ok(res));
12809        }
12810        Some(Err(ErrorContext::new(
12811            "IfCombinationAttributes",
12812            r#type.and_then(|t| IfCombinationAttributes::attr_from_type(t)),
12813            self.orig_loc,
12814            self.buf.as_ptr().wrapping_add(pos) as usize,
12815        )))
12816    }
12817}
12818impl std::fmt::Debug for IterableArrayIfaceLimitAttributes<'_> {
12819    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12820        fmt.debug_list()
12821            .entries(self.clone().map(FlattenErrorContext))
12822            .finish()
12823    }
12824}
12825impl<'a> std::fmt::Debug for IterableIfCombinationAttributes<'_> {
12826    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12827        let mut fmt = f.debug_struct("IfCombinationAttributes");
12828        for attr in self.clone() {
12829            let attr = match attr {
12830                Ok(a) => a,
12831                Err(err) => {
12832                    fmt.finish()?;
12833                    f.write_str("Err(")?;
12834                    err.fmt(f)?;
12835                    return f.write_str(")");
12836                }
12837            };
12838            match attr {
12839                IfCombinationAttributes::Limits(val) => fmt.field("Limits", &val),
12840                IfCombinationAttributes::Maxnum(val) => fmt.field("Maxnum", &val),
12841                IfCombinationAttributes::StaApBiMatch(val) => fmt.field("StaApBiMatch", &val),
12842                IfCombinationAttributes::NumChannels(val) => fmt.field("NumChannels", &val),
12843                IfCombinationAttributes::RadarDetectWidths(val) => {
12844                    fmt.field("RadarDetectWidths", &val)
12845                }
12846                IfCombinationAttributes::RadarDetectRegions(val) => {
12847                    fmt.field("RadarDetectRegions", &val)
12848                }
12849                IfCombinationAttributes::BiMinGcd(val) => fmt.field("BiMinGcd", &val),
12850            };
12851        }
12852        fmt.finish()
12853    }
12854}
12855impl IterableIfCombinationAttributes<'_> {
12856    pub fn lookup_attr(
12857        &self,
12858        offset: usize,
12859        missing_type: Option<u16>,
12860    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
12861        let mut stack = Vec::new();
12862        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
12863        if cur == offset {
12864            stack.push(("IfCombinationAttributes", offset));
12865            return (
12866                stack,
12867                missing_type.and_then(|t| IfCombinationAttributes::attr_from_type(t)),
12868            );
12869        }
12870        if cur > offset || cur + self.buf.len() < offset {
12871            return (stack, None);
12872        }
12873        let mut attrs = self.clone();
12874        let mut last_off = cur + attrs.pos;
12875        let mut missing = None;
12876        while let Some(attr) = attrs.next() {
12877            let Ok(attr) = attr else { break };
12878            match attr {
12879                IfCombinationAttributes::Limits(val) => {
12880                    for entry in val {
12881                        let Ok(attr) = entry else { break };
12882                        (stack, missing) = attr.lookup_attr(offset, missing_type);
12883                        if !stack.is_empty() {
12884                            break;
12885                        }
12886                    }
12887                    if !stack.is_empty() {
12888                        stack.push(("Limits", last_off));
12889                        break;
12890                    }
12891                }
12892                IfCombinationAttributes::Maxnum(val) => {
12893                    if last_off == offset {
12894                        stack.push(("Maxnum", last_off));
12895                        break;
12896                    }
12897                }
12898                IfCombinationAttributes::StaApBiMatch(val) => {
12899                    if last_off == offset {
12900                        stack.push(("StaApBiMatch", last_off));
12901                        break;
12902                    }
12903                }
12904                IfCombinationAttributes::NumChannels(val) => {
12905                    if last_off == offset {
12906                        stack.push(("NumChannels", last_off));
12907                        break;
12908                    }
12909                }
12910                IfCombinationAttributes::RadarDetectWidths(val) => {
12911                    if last_off == offset {
12912                        stack.push(("RadarDetectWidths", last_off));
12913                        break;
12914                    }
12915                }
12916                IfCombinationAttributes::RadarDetectRegions(val) => {
12917                    if last_off == offset {
12918                        stack.push(("RadarDetectRegions", last_off));
12919                        break;
12920                    }
12921                }
12922                IfCombinationAttributes::BiMinGcd(val) => {
12923                    if last_off == offset {
12924                        stack.push(("BiMinGcd", last_off));
12925                        break;
12926                    }
12927                }
12928                _ => {}
12929            };
12930            last_off = cur + attrs.pos;
12931        }
12932        if !stack.is_empty() {
12933            stack.push(("IfCombinationAttributes", cur));
12934        }
12935        (stack, missing)
12936    }
12937}
12938#[derive(Clone)]
12939pub enum IfaceLimitAttributes<'a> {
12940    Max(u32),
12941    Types(IterableSupportedIftypes<'a>),
12942}
12943impl<'a> IterableIfaceLimitAttributes<'a> {
12944    pub fn get_max(&self) -> Result<u32, ErrorContext> {
12945        let mut iter = self.clone();
12946        iter.pos = 0;
12947        for attr in iter {
12948            if let IfaceLimitAttributes::Max(val) = attr? {
12949                return Ok(val);
12950            }
12951        }
12952        Err(ErrorContext::new_missing(
12953            "IfaceLimitAttributes",
12954            "Max",
12955            self.orig_loc,
12956            self.buf.as_ptr() as usize,
12957        ))
12958    }
12959    pub fn get_types(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
12960        let mut iter = self.clone();
12961        iter.pos = 0;
12962        for attr in iter {
12963            if let IfaceLimitAttributes::Types(val) = attr? {
12964                return Ok(val);
12965            }
12966        }
12967        Err(ErrorContext::new_missing(
12968            "IfaceLimitAttributes",
12969            "Types",
12970            self.orig_loc,
12971            self.buf.as_ptr() as usize,
12972        ))
12973    }
12974}
12975impl IfaceLimitAttributes<'_> {
12976    pub fn new<'a>(buf: &'a [u8]) -> IterableIfaceLimitAttributes<'a> {
12977        IterableIfaceLimitAttributes::with_loc(buf, buf.as_ptr() as usize)
12978    }
12979    fn attr_from_type(r#type: u16) -> Option<&'static str> {
12980        let res = match r#type {
12981            1u16 => "Max",
12982            2u16 => "Types",
12983            _ => return None,
12984        };
12985        Some(res)
12986    }
12987}
12988#[derive(Clone, Copy, Default)]
12989pub struct IterableIfaceLimitAttributes<'a> {
12990    buf: &'a [u8],
12991    pos: usize,
12992    orig_loc: usize,
12993}
12994impl<'a> IterableIfaceLimitAttributes<'a> {
12995    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12996        Self {
12997            buf,
12998            pos: 0,
12999            orig_loc,
13000        }
13001    }
13002    pub fn get_buf(&self) -> &'a [u8] {
13003        self.buf
13004    }
13005}
13006impl<'a> Iterator for IterableIfaceLimitAttributes<'a> {
13007    type Item = Result<IfaceLimitAttributes<'a>, ErrorContext>;
13008    fn next(&mut self) -> Option<Self::Item> {
13009        let pos = self.pos;
13010        let mut r#type;
13011        loop {
13012            r#type = None;
13013            if self.buf.len() == self.pos {
13014                return None;
13015            }
13016            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13017                break;
13018            };
13019            r#type = Some(header.r#type);
13020            let res = match header.r#type {
13021                1u16 => IfaceLimitAttributes::Max({
13022                    let res = parse_u32(next);
13023                    let Some(val) = res else { break };
13024                    val
13025                }),
13026                2u16 => IfaceLimitAttributes::Types({
13027                    let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
13028                    let Some(val) = res else { break };
13029                    val
13030                }),
13031                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13032                n => continue,
13033            };
13034            return Some(Ok(res));
13035        }
13036        Some(Err(ErrorContext::new(
13037            "IfaceLimitAttributes",
13038            r#type.and_then(|t| IfaceLimitAttributes::attr_from_type(t)),
13039            self.orig_loc,
13040            self.buf.as_ptr().wrapping_add(pos) as usize,
13041        )))
13042    }
13043}
13044impl<'a> std::fmt::Debug for IterableIfaceLimitAttributes<'_> {
13045    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13046        let mut fmt = f.debug_struct("IfaceLimitAttributes");
13047        for attr in self.clone() {
13048            let attr = match attr {
13049                Ok(a) => a,
13050                Err(err) => {
13051                    fmt.finish()?;
13052                    f.write_str("Err(")?;
13053                    err.fmt(f)?;
13054                    return f.write_str(")");
13055                }
13056            };
13057            match attr {
13058                IfaceLimitAttributes::Max(val) => fmt.field("Max", &val),
13059                IfaceLimitAttributes::Types(val) => fmt.field("Types", &val),
13060            };
13061        }
13062        fmt.finish()
13063    }
13064}
13065impl IterableIfaceLimitAttributes<'_> {
13066    pub fn lookup_attr(
13067        &self,
13068        offset: usize,
13069        missing_type: Option<u16>,
13070    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
13071        let mut stack = Vec::new();
13072        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
13073        if cur == offset {
13074            stack.push(("IfaceLimitAttributes", offset));
13075            return (
13076                stack,
13077                missing_type.and_then(|t| IfaceLimitAttributes::attr_from_type(t)),
13078            );
13079        }
13080        if cur > offset || cur + self.buf.len() < offset {
13081            return (stack, None);
13082        }
13083        let mut attrs = self.clone();
13084        let mut last_off = cur + attrs.pos;
13085        let mut missing = None;
13086        while let Some(attr) = attrs.next() {
13087            let Ok(attr) = attr else { break };
13088            match attr {
13089                IfaceLimitAttributes::Max(val) => {
13090                    if last_off == offset {
13091                        stack.push(("Max", last_off));
13092                        break;
13093                    }
13094                }
13095                IfaceLimitAttributes::Types(val) => {
13096                    (stack, missing) = val.lookup_attr(offset, missing_type);
13097                    if !stack.is_empty() {
13098                        break;
13099                    }
13100                }
13101                _ => {}
13102            };
13103            last_off = cur + attrs.pos;
13104        }
13105        if !stack.is_empty() {
13106            stack.push(("IfaceLimitAttributes", cur));
13107        }
13108        (stack, missing)
13109    }
13110}
13111#[derive(Clone)]
13112pub enum IftypeDataAttrs<'a> {
13113    Iftypes(&'a [u8]),
13114    HeCapMac(&'a [u8]),
13115    HeCapPhy(&'a [u8]),
13116    HeCapMcsSet(&'a [u8]),
13117    HeCapPpe(&'a [u8]),
13118    He6ghzCapa(&'a [u8]),
13119    VendorElems(&'a [u8]),
13120    EhtCapMac(&'a [u8]),
13121    EhtCapPhy(&'a [u8]),
13122    EhtCapMcsSet(&'a [u8]),
13123    EhtCapPpe(&'a [u8]),
13124}
13125impl<'a> IterableIftypeDataAttrs<'a> {
13126    pub fn get_iftypes(&self) -> Result<&'a [u8], ErrorContext> {
13127        let mut iter = self.clone();
13128        iter.pos = 0;
13129        for attr in iter {
13130            if let IftypeDataAttrs::Iftypes(val) = attr? {
13131                return Ok(val);
13132            }
13133        }
13134        Err(ErrorContext::new_missing(
13135            "IftypeDataAttrs",
13136            "Iftypes",
13137            self.orig_loc,
13138            self.buf.as_ptr() as usize,
13139        ))
13140    }
13141    pub fn get_he_cap_mac(&self) -> Result<&'a [u8], ErrorContext> {
13142        let mut iter = self.clone();
13143        iter.pos = 0;
13144        for attr in iter {
13145            if let IftypeDataAttrs::HeCapMac(val) = attr? {
13146                return Ok(val);
13147            }
13148        }
13149        Err(ErrorContext::new_missing(
13150            "IftypeDataAttrs",
13151            "HeCapMac",
13152            self.orig_loc,
13153            self.buf.as_ptr() as usize,
13154        ))
13155    }
13156    pub fn get_he_cap_phy(&self) -> Result<&'a [u8], ErrorContext> {
13157        let mut iter = self.clone();
13158        iter.pos = 0;
13159        for attr in iter {
13160            if let IftypeDataAttrs::HeCapPhy(val) = attr? {
13161                return Ok(val);
13162            }
13163        }
13164        Err(ErrorContext::new_missing(
13165            "IftypeDataAttrs",
13166            "HeCapPhy",
13167            self.orig_loc,
13168            self.buf.as_ptr() as usize,
13169        ))
13170    }
13171    pub fn get_he_cap_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
13172        let mut iter = self.clone();
13173        iter.pos = 0;
13174        for attr in iter {
13175            if let IftypeDataAttrs::HeCapMcsSet(val) = attr? {
13176                return Ok(val);
13177            }
13178        }
13179        Err(ErrorContext::new_missing(
13180            "IftypeDataAttrs",
13181            "HeCapMcsSet",
13182            self.orig_loc,
13183            self.buf.as_ptr() as usize,
13184        ))
13185    }
13186    pub fn get_he_cap_ppe(&self) -> Result<&'a [u8], ErrorContext> {
13187        let mut iter = self.clone();
13188        iter.pos = 0;
13189        for attr in iter {
13190            if let IftypeDataAttrs::HeCapPpe(val) = attr? {
13191                return Ok(val);
13192            }
13193        }
13194        Err(ErrorContext::new_missing(
13195            "IftypeDataAttrs",
13196            "HeCapPpe",
13197            self.orig_loc,
13198            self.buf.as_ptr() as usize,
13199        ))
13200    }
13201    pub fn get_he_6ghz_capa(&self) -> Result<&'a [u8], ErrorContext> {
13202        let mut iter = self.clone();
13203        iter.pos = 0;
13204        for attr in iter {
13205            if let IftypeDataAttrs::He6ghzCapa(val) = attr? {
13206                return Ok(val);
13207            }
13208        }
13209        Err(ErrorContext::new_missing(
13210            "IftypeDataAttrs",
13211            "He6ghzCapa",
13212            self.orig_loc,
13213            self.buf.as_ptr() as usize,
13214        ))
13215    }
13216    pub fn get_vendor_elems(&self) -> Result<&'a [u8], ErrorContext> {
13217        let mut iter = self.clone();
13218        iter.pos = 0;
13219        for attr in iter {
13220            if let IftypeDataAttrs::VendorElems(val) = attr? {
13221                return Ok(val);
13222            }
13223        }
13224        Err(ErrorContext::new_missing(
13225            "IftypeDataAttrs",
13226            "VendorElems",
13227            self.orig_loc,
13228            self.buf.as_ptr() as usize,
13229        ))
13230    }
13231    pub fn get_eht_cap_mac(&self) -> Result<&'a [u8], ErrorContext> {
13232        let mut iter = self.clone();
13233        iter.pos = 0;
13234        for attr in iter {
13235            if let IftypeDataAttrs::EhtCapMac(val) = attr? {
13236                return Ok(val);
13237            }
13238        }
13239        Err(ErrorContext::new_missing(
13240            "IftypeDataAttrs",
13241            "EhtCapMac",
13242            self.orig_loc,
13243            self.buf.as_ptr() as usize,
13244        ))
13245    }
13246    pub fn get_eht_cap_phy(&self) -> Result<&'a [u8], ErrorContext> {
13247        let mut iter = self.clone();
13248        iter.pos = 0;
13249        for attr in iter {
13250            if let IftypeDataAttrs::EhtCapPhy(val) = attr? {
13251                return Ok(val);
13252            }
13253        }
13254        Err(ErrorContext::new_missing(
13255            "IftypeDataAttrs",
13256            "EhtCapPhy",
13257            self.orig_loc,
13258            self.buf.as_ptr() as usize,
13259        ))
13260    }
13261    pub fn get_eht_cap_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
13262        let mut iter = self.clone();
13263        iter.pos = 0;
13264        for attr in iter {
13265            if let IftypeDataAttrs::EhtCapMcsSet(val) = attr? {
13266                return Ok(val);
13267            }
13268        }
13269        Err(ErrorContext::new_missing(
13270            "IftypeDataAttrs",
13271            "EhtCapMcsSet",
13272            self.orig_loc,
13273            self.buf.as_ptr() as usize,
13274        ))
13275    }
13276    pub fn get_eht_cap_ppe(&self) -> Result<&'a [u8], ErrorContext> {
13277        let mut iter = self.clone();
13278        iter.pos = 0;
13279        for attr in iter {
13280            if let IftypeDataAttrs::EhtCapPpe(val) = attr? {
13281                return Ok(val);
13282            }
13283        }
13284        Err(ErrorContext::new_missing(
13285            "IftypeDataAttrs",
13286            "EhtCapPpe",
13287            self.orig_loc,
13288            self.buf.as_ptr() as usize,
13289        ))
13290    }
13291}
13292impl IftypeDataAttrs<'_> {
13293    pub fn new<'a>(buf: &'a [u8]) -> IterableIftypeDataAttrs<'a> {
13294        IterableIftypeDataAttrs::with_loc(buf, buf.as_ptr() as usize)
13295    }
13296    fn attr_from_type(r#type: u16) -> Option<&'static str> {
13297        let res = match r#type {
13298            1u16 => "Iftypes",
13299            2u16 => "HeCapMac",
13300            3u16 => "HeCapPhy",
13301            4u16 => "HeCapMcsSet",
13302            5u16 => "HeCapPpe",
13303            6u16 => "He6ghzCapa",
13304            7u16 => "VendorElems",
13305            8u16 => "EhtCapMac",
13306            9u16 => "EhtCapPhy",
13307            10u16 => "EhtCapMcsSet",
13308            11u16 => "EhtCapPpe",
13309            _ => return None,
13310        };
13311        Some(res)
13312    }
13313}
13314#[derive(Clone, Copy, Default)]
13315pub struct IterableIftypeDataAttrs<'a> {
13316    buf: &'a [u8],
13317    pos: usize,
13318    orig_loc: usize,
13319}
13320impl<'a> IterableIftypeDataAttrs<'a> {
13321    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13322        Self {
13323            buf,
13324            pos: 0,
13325            orig_loc,
13326        }
13327    }
13328    pub fn get_buf(&self) -> &'a [u8] {
13329        self.buf
13330    }
13331}
13332impl<'a> Iterator for IterableIftypeDataAttrs<'a> {
13333    type Item = Result<IftypeDataAttrs<'a>, ErrorContext>;
13334    fn next(&mut self) -> Option<Self::Item> {
13335        let pos = self.pos;
13336        let mut r#type;
13337        loop {
13338            r#type = None;
13339            if self.buf.len() == self.pos {
13340                return None;
13341            }
13342            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13343                break;
13344            };
13345            r#type = Some(header.r#type);
13346            let res = match header.r#type {
13347                1u16 => IftypeDataAttrs::Iftypes({
13348                    let res = Some(next);
13349                    let Some(val) = res else { break };
13350                    val
13351                }),
13352                2u16 => IftypeDataAttrs::HeCapMac({
13353                    let res = Some(next);
13354                    let Some(val) = res else { break };
13355                    val
13356                }),
13357                3u16 => IftypeDataAttrs::HeCapPhy({
13358                    let res = Some(next);
13359                    let Some(val) = res else { break };
13360                    val
13361                }),
13362                4u16 => IftypeDataAttrs::HeCapMcsSet({
13363                    let res = Some(next);
13364                    let Some(val) = res else { break };
13365                    val
13366                }),
13367                5u16 => IftypeDataAttrs::HeCapPpe({
13368                    let res = Some(next);
13369                    let Some(val) = res else { break };
13370                    val
13371                }),
13372                6u16 => IftypeDataAttrs::He6ghzCapa({
13373                    let res = Some(next);
13374                    let Some(val) = res else { break };
13375                    val
13376                }),
13377                7u16 => IftypeDataAttrs::VendorElems({
13378                    let res = Some(next);
13379                    let Some(val) = res else { break };
13380                    val
13381                }),
13382                8u16 => IftypeDataAttrs::EhtCapMac({
13383                    let res = Some(next);
13384                    let Some(val) = res else { break };
13385                    val
13386                }),
13387                9u16 => IftypeDataAttrs::EhtCapPhy({
13388                    let res = Some(next);
13389                    let Some(val) = res else { break };
13390                    val
13391                }),
13392                10u16 => IftypeDataAttrs::EhtCapMcsSet({
13393                    let res = Some(next);
13394                    let Some(val) = res else { break };
13395                    val
13396                }),
13397                11u16 => IftypeDataAttrs::EhtCapPpe({
13398                    let res = Some(next);
13399                    let Some(val) = res else { break };
13400                    val
13401                }),
13402                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13403                n => continue,
13404            };
13405            return Some(Ok(res));
13406        }
13407        Some(Err(ErrorContext::new(
13408            "IftypeDataAttrs",
13409            r#type.and_then(|t| IftypeDataAttrs::attr_from_type(t)),
13410            self.orig_loc,
13411            self.buf.as_ptr().wrapping_add(pos) as usize,
13412        )))
13413    }
13414}
13415impl<'a> std::fmt::Debug for IterableIftypeDataAttrs<'_> {
13416    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13417        let mut fmt = f.debug_struct("IftypeDataAttrs");
13418        for attr in self.clone() {
13419            let attr = match attr {
13420                Ok(a) => a,
13421                Err(err) => {
13422                    fmt.finish()?;
13423                    f.write_str("Err(")?;
13424                    err.fmt(f)?;
13425                    return f.write_str(")");
13426                }
13427            };
13428            match attr {
13429                IftypeDataAttrs::Iftypes(val) => fmt.field("Iftypes", &val),
13430                IftypeDataAttrs::HeCapMac(val) => fmt.field("HeCapMac", &val),
13431                IftypeDataAttrs::HeCapPhy(val) => fmt.field("HeCapPhy", &val),
13432                IftypeDataAttrs::HeCapMcsSet(val) => fmt.field("HeCapMcsSet", &val),
13433                IftypeDataAttrs::HeCapPpe(val) => fmt.field("HeCapPpe", &val),
13434                IftypeDataAttrs::He6ghzCapa(val) => fmt.field("He6ghzCapa", &val),
13435                IftypeDataAttrs::VendorElems(val) => fmt.field("VendorElems", &val),
13436                IftypeDataAttrs::EhtCapMac(val) => fmt.field("EhtCapMac", &val),
13437                IftypeDataAttrs::EhtCapPhy(val) => fmt.field("EhtCapPhy", &val),
13438                IftypeDataAttrs::EhtCapMcsSet(val) => fmt.field("EhtCapMcsSet", &val),
13439                IftypeDataAttrs::EhtCapPpe(val) => fmt.field("EhtCapPpe", &val),
13440            };
13441        }
13442        fmt.finish()
13443    }
13444}
13445impl IterableIftypeDataAttrs<'_> {
13446    pub fn lookup_attr(
13447        &self,
13448        offset: usize,
13449        missing_type: Option<u16>,
13450    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
13451        let mut stack = Vec::new();
13452        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
13453        if cur == offset {
13454            stack.push(("IftypeDataAttrs", offset));
13455            return (
13456                stack,
13457                missing_type.and_then(|t| IftypeDataAttrs::attr_from_type(t)),
13458            );
13459        }
13460        if cur > offset || cur + self.buf.len() < offset {
13461            return (stack, None);
13462        }
13463        let mut attrs = self.clone();
13464        let mut last_off = cur + attrs.pos;
13465        while let Some(attr) = attrs.next() {
13466            let Ok(attr) = attr else { break };
13467            match attr {
13468                IftypeDataAttrs::Iftypes(val) => {
13469                    if last_off == offset {
13470                        stack.push(("Iftypes", last_off));
13471                        break;
13472                    }
13473                }
13474                IftypeDataAttrs::HeCapMac(val) => {
13475                    if last_off == offset {
13476                        stack.push(("HeCapMac", last_off));
13477                        break;
13478                    }
13479                }
13480                IftypeDataAttrs::HeCapPhy(val) => {
13481                    if last_off == offset {
13482                        stack.push(("HeCapPhy", last_off));
13483                        break;
13484                    }
13485                }
13486                IftypeDataAttrs::HeCapMcsSet(val) => {
13487                    if last_off == offset {
13488                        stack.push(("HeCapMcsSet", last_off));
13489                        break;
13490                    }
13491                }
13492                IftypeDataAttrs::HeCapPpe(val) => {
13493                    if last_off == offset {
13494                        stack.push(("HeCapPpe", last_off));
13495                        break;
13496                    }
13497                }
13498                IftypeDataAttrs::He6ghzCapa(val) => {
13499                    if last_off == offset {
13500                        stack.push(("He6ghzCapa", last_off));
13501                        break;
13502                    }
13503                }
13504                IftypeDataAttrs::VendorElems(val) => {
13505                    if last_off == offset {
13506                        stack.push(("VendorElems", last_off));
13507                        break;
13508                    }
13509                }
13510                IftypeDataAttrs::EhtCapMac(val) => {
13511                    if last_off == offset {
13512                        stack.push(("EhtCapMac", last_off));
13513                        break;
13514                    }
13515                }
13516                IftypeDataAttrs::EhtCapPhy(val) => {
13517                    if last_off == offset {
13518                        stack.push(("EhtCapPhy", last_off));
13519                        break;
13520                    }
13521                }
13522                IftypeDataAttrs::EhtCapMcsSet(val) => {
13523                    if last_off == offset {
13524                        stack.push(("EhtCapMcsSet", last_off));
13525                        break;
13526                    }
13527                }
13528                IftypeDataAttrs::EhtCapPpe(val) => {
13529                    if last_off == offset {
13530                        stack.push(("EhtCapPpe", last_off));
13531                        break;
13532                    }
13533                }
13534                _ => {}
13535            };
13536            last_off = cur + attrs.pos;
13537        }
13538        if !stack.is_empty() {
13539            stack.push(("IftypeDataAttrs", cur));
13540        }
13541        (stack, None)
13542    }
13543}
13544#[derive(Clone)]
13545pub enum IftypeAttrs<'a> {
13546    Unspecified(IterableFrameTypeAttrs<'a>),
13547    Adhoc(IterableFrameTypeAttrs<'a>),
13548    Station(IterableFrameTypeAttrs<'a>),
13549    Ap(IterableFrameTypeAttrs<'a>),
13550    ApVlan(IterableFrameTypeAttrs<'a>),
13551    Wds(IterableFrameTypeAttrs<'a>),
13552    Monitor(IterableFrameTypeAttrs<'a>),
13553    MeshPoint(IterableFrameTypeAttrs<'a>),
13554    P2pClient(IterableFrameTypeAttrs<'a>),
13555    P2pGo(IterableFrameTypeAttrs<'a>),
13556    P2pDevice(IterableFrameTypeAttrs<'a>),
13557    Ocb(IterableFrameTypeAttrs<'a>),
13558    Nan(IterableFrameTypeAttrs<'a>),
13559}
13560impl<'a> IterableIftypeAttrs<'a> {
13561    pub fn get_unspecified(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13562        let mut iter = self.clone();
13563        iter.pos = 0;
13564        for attr in iter {
13565            if let IftypeAttrs::Unspecified(val) = attr? {
13566                return Ok(val);
13567            }
13568        }
13569        Err(ErrorContext::new_missing(
13570            "IftypeAttrs",
13571            "Unspecified",
13572            self.orig_loc,
13573            self.buf.as_ptr() as usize,
13574        ))
13575    }
13576    pub fn get_adhoc(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13577        let mut iter = self.clone();
13578        iter.pos = 0;
13579        for attr in iter {
13580            if let IftypeAttrs::Adhoc(val) = attr? {
13581                return Ok(val);
13582            }
13583        }
13584        Err(ErrorContext::new_missing(
13585            "IftypeAttrs",
13586            "Adhoc",
13587            self.orig_loc,
13588            self.buf.as_ptr() as usize,
13589        ))
13590    }
13591    pub fn get_station(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13592        let mut iter = self.clone();
13593        iter.pos = 0;
13594        for attr in iter {
13595            if let IftypeAttrs::Station(val) = attr? {
13596                return Ok(val);
13597            }
13598        }
13599        Err(ErrorContext::new_missing(
13600            "IftypeAttrs",
13601            "Station",
13602            self.orig_loc,
13603            self.buf.as_ptr() as usize,
13604        ))
13605    }
13606    pub fn get_ap(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13607        let mut iter = self.clone();
13608        iter.pos = 0;
13609        for attr in iter {
13610            if let IftypeAttrs::Ap(val) = attr? {
13611                return Ok(val);
13612            }
13613        }
13614        Err(ErrorContext::new_missing(
13615            "IftypeAttrs",
13616            "Ap",
13617            self.orig_loc,
13618            self.buf.as_ptr() as usize,
13619        ))
13620    }
13621    pub fn get_ap_vlan(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13622        let mut iter = self.clone();
13623        iter.pos = 0;
13624        for attr in iter {
13625            if let IftypeAttrs::ApVlan(val) = attr? {
13626                return Ok(val);
13627            }
13628        }
13629        Err(ErrorContext::new_missing(
13630            "IftypeAttrs",
13631            "ApVlan",
13632            self.orig_loc,
13633            self.buf.as_ptr() as usize,
13634        ))
13635    }
13636    pub fn get_wds(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13637        let mut iter = self.clone();
13638        iter.pos = 0;
13639        for attr in iter {
13640            if let IftypeAttrs::Wds(val) = attr? {
13641                return Ok(val);
13642            }
13643        }
13644        Err(ErrorContext::new_missing(
13645            "IftypeAttrs",
13646            "Wds",
13647            self.orig_loc,
13648            self.buf.as_ptr() as usize,
13649        ))
13650    }
13651    pub fn get_monitor(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13652        let mut iter = self.clone();
13653        iter.pos = 0;
13654        for attr in iter {
13655            if let IftypeAttrs::Monitor(val) = attr? {
13656                return Ok(val);
13657            }
13658        }
13659        Err(ErrorContext::new_missing(
13660            "IftypeAttrs",
13661            "Monitor",
13662            self.orig_loc,
13663            self.buf.as_ptr() as usize,
13664        ))
13665    }
13666    pub fn get_mesh_point(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13667        let mut iter = self.clone();
13668        iter.pos = 0;
13669        for attr in iter {
13670            if let IftypeAttrs::MeshPoint(val) = attr? {
13671                return Ok(val);
13672            }
13673        }
13674        Err(ErrorContext::new_missing(
13675            "IftypeAttrs",
13676            "MeshPoint",
13677            self.orig_loc,
13678            self.buf.as_ptr() as usize,
13679        ))
13680    }
13681    pub fn get_p2p_client(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13682        let mut iter = self.clone();
13683        iter.pos = 0;
13684        for attr in iter {
13685            if let IftypeAttrs::P2pClient(val) = attr? {
13686                return Ok(val);
13687            }
13688        }
13689        Err(ErrorContext::new_missing(
13690            "IftypeAttrs",
13691            "P2pClient",
13692            self.orig_loc,
13693            self.buf.as_ptr() as usize,
13694        ))
13695    }
13696    pub fn get_p2p_go(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13697        let mut iter = self.clone();
13698        iter.pos = 0;
13699        for attr in iter {
13700            if let IftypeAttrs::P2pGo(val) = attr? {
13701                return Ok(val);
13702            }
13703        }
13704        Err(ErrorContext::new_missing(
13705            "IftypeAttrs",
13706            "P2pGo",
13707            self.orig_loc,
13708            self.buf.as_ptr() as usize,
13709        ))
13710    }
13711    pub fn get_p2p_device(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13712        let mut iter = self.clone();
13713        iter.pos = 0;
13714        for attr in iter {
13715            if let IftypeAttrs::P2pDevice(val) = attr? {
13716                return Ok(val);
13717            }
13718        }
13719        Err(ErrorContext::new_missing(
13720            "IftypeAttrs",
13721            "P2pDevice",
13722            self.orig_loc,
13723            self.buf.as_ptr() as usize,
13724        ))
13725    }
13726    pub fn get_ocb(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13727        let mut iter = self.clone();
13728        iter.pos = 0;
13729        for attr in iter {
13730            if let IftypeAttrs::Ocb(val) = attr? {
13731                return Ok(val);
13732            }
13733        }
13734        Err(ErrorContext::new_missing(
13735            "IftypeAttrs",
13736            "Ocb",
13737            self.orig_loc,
13738            self.buf.as_ptr() as usize,
13739        ))
13740    }
13741    pub fn get_nan(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13742        let mut iter = self.clone();
13743        iter.pos = 0;
13744        for attr in iter {
13745            if let IftypeAttrs::Nan(val) = attr? {
13746                return Ok(val);
13747            }
13748        }
13749        Err(ErrorContext::new_missing(
13750            "IftypeAttrs",
13751            "Nan",
13752            self.orig_loc,
13753            self.buf.as_ptr() as usize,
13754        ))
13755    }
13756}
13757impl IftypeAttrs<'_> {
13758    pub fn new<'a>(buf: &'a [u8]) -> IterableIftypeAttrs<'a> {
13759        IterableIftypeAttrs::with_loc(buf, buf.as_ptr() as usize)
13760    }
13761    fn attr_from_type(r#type: u16) -> Option<&'static str> {
13762        let res = match r#type {
13763            0u16 => "Unspecified",
13764            1u16 => "Adhoc",
13765            2u16 => "Station",
13766            3u16 => "Ap",
13767            4u16 => "ApVlan",
13768            5u16 => "Wds",
13769            6u16 => "Monitor",
13770            7u16 => "MeshPoint",
13771            8u16 => "P2pClient",
13772            9u16 => "P2pGo",
13773            10u16 => "P2pDevice",
13774            11u16 => "Ocb",
13775            12u16 => "Nan",
13776            _ => return None,
13777        };
13778        Some(res)
13779    }
13780}
13781#[derive(Clone, Copy, Default)]
13782pub struct IterableIftypeAttrs<'a> {
13783    buf: &'a [u8],
13784    pos: usize,
13785    orig_loc: usize,
13786}
13787impl<'a> IterableIftypeAttrs<'a> {
13788    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13789        Self {
13790            buf,
13791            pos: 0,
13792            orig_loc,
13793        }
13794    }
13795    pub fn get_buf(&self) -> &'a [u8] {
13796        self.buf
13797    }
13798}
13799impl<'a> Iterator for IterableIftypeAttrs<'a> {
13800    type Item = Result<IftypeAttrs<'a>, ErrorContext>;
13801    fn next(&mut self) -> Option<Self::Item> {
13802        let pos = self.pos;
13803        let mut r#type;
13804        loop {
13805            r#type = None;
13806            if self.buf.len() == self.pos {
13807                return None;
13808            }
13809            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13810                break;
13811            };
13812            r#type = Some(header.r#type);
13813            let res = match header.r#type {
13814                0u16 => IftypeAttrs::Unspecified({
13815                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13816                    let Some(val) = res else { break };
13817                    val
13818                }),
13819                1u16 => IftypeAttrs::Adhoc({
13820                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13821                    let Some(val) = res else { break };
13822                    val
13823                }),
13824                2u16 => IftypeAttrs::Station({
13825                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13826                    let Some(val) = res else { break };
13827                    val
13828                }),
13829                3u16 => IftypeAttrs::Ap({
13830                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13831                    let Some(val) = res else { break };
13832                    val
13833                }),
13834                4u16 => IftypeAttrs::ApVlan({
13835                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13836                    let Some(val) = res else { break };
13837                    val
13838                }),
13839                5u16 => IftypeAttrs::Wds({
13840                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13841                    let Some(val) = res else { break };
13842                    val
13843                }),
13844                6u16 => IftypeAttrs::Monitor({
13845                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13846                    let Some(val) = res else { break };
13847                    val
13848                }),
13849                7u16 => IftypeAttrs::MeshPoint({
13850                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13851                    let Some(val) = res else { break };
13852                    val
13853                }),
13854                8u16 => IftypeAttrs::P2pClient({
13855                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13856                    let Some(val) = res else { break };
13857                    val
13858                }),
13859                9u16 => IftypeAttrs::P2pGo({
13860                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13861                    let Some(val) = res else { break };
13862                    val
13863                }),
13864                10u16 => IftypeAttrs::P2pDevice({
13865                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13866                    let Some(val) = res else { break };
13867                    val
13868                }),
13869                11u16 => IftypeAttrs::Ocb({
13870                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13871                    let Some(val) = res else { break };
13872                    val
13873                }),
13874                12u16 => IftypeAttrs::Nan({
13875                    let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13876                    let Some(val) = res else { break };
13877                    val
13878                }),
13879                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13880                n => continue,
13881            };
13882            return Some(Ok(res));
13883        }
13884        Some(Err(ErrorContext::new(
13885            "IftypeAttrs",
13886            r#type.and_then(|t| IftypeAttrs::attr_from_type(t)),
13887            self.orig_loc,
13888            self.buf.as_ptr().wrapping_add(pos) as usize,
13889        )))
13890    }
13891}
13892impl<'a> std::fmt::Debug for IterableIftypeAttrs<'_> {
13893    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13894        let mut fmt = f.debug_struct("IftypeAttrs");
13895        for attr in self.clone() {
13896            let attr = match attr {
13897                Ok(a) => a,
13898                Err(err) => {
13899                    fmt.finish()?;
13900                    f.write_str("Err(")?;
13901                    err.fmt(f)?;
13902                    return f.write_str(")");
13903                }
13904            };
13905            match attr {
13906                IftypeAttrs::Unspecified(val) => fmt.field("Unspecified", &val),
13907                IftypeAttrs::Adhoc(val) => fmt.field("Adhoc", &val),
13908                IftypeAttrs::Station(val) => fmt.field("Station", &val),
13909                IftypeAttrs::Ap(val) => fmt.field("Ap", &val),
13910                IftypeAttrs::ApVlan(val) => fmt.field("ApVlan", &val),
13911                IftypeAttrs::Wds(val) => fmt.field("Wds", &val),
13912                IftypeAttrs::Monitor(val) => fmt.field("Monitor", &val),
13913                IftypeAttrs::MeshPoint(val) => fmt.field("MeshPoint", &val),
13914                IftypeAttrs::P2pClient(val) => fmt.field("P2pClient", &val),
13915                IftypeAttrs::P2pGo(val) => fmt.field("P2pGo", &val),
13916                IftypeAttrs::P2pDevice(val) => fmt.field("P2pDevice", &val),
13917                IftypeAttrs::Ocb(val) => fmt.field("Ocb", &val),
13918                IftypeAttrs::Nan(val) => fmt.field("Nan", &val),
13919            };
13920        }
13921        fmt.finish()
13922    }
13923}
13924impl IterableIftypeAttrs<'_> {
13925    pub fn lookup_attr(
13926        &self,
13927        offset: usize,
13928        missing_type: Option<u16>,
13929    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
13930        let mut stack = Vec::new();
13931        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
13932        if cur == offset {
13933            stack.push(("IftypeAttrs", offset));
13934            return (
13935                stack,
13936                missing_type.and_then(|t| IftypeAttrs::attr_from_type(t)),
13937            );
13938        }
13939        if cur > offset || cur + self.buf.len() < offset {
13940            return (stack, None);
13941        }
13942        let mut attrs = self.clone();
13943        let mut last_off = cur + attrs.pos;
13944        let mut missing = None;
13945        while let Some(attr) = attrs.next() {
13946            let Ok(attr) = attr else { break };
13947            match attr {
13948                IftypeAttrs::Unspecified(val) => {
13949                    (stack, missing) = val.lookup_attr(offset, missing_type);
13950                    if !stack.is_empty() {
13951                        break;
13952                    }
13953                }
13954                IftypeAttrs::Adhoc(val) => {
13955                    (stack, missing) = val.lookup_attr(offset, missing_type);
13956                    if !stack.is_empty() {
13957                        break;
13958                    }
13959                }
13960                IftypeAttrs::Station(val) => {
13961                    (stack, missing) = val.lookup_attr(offset, missing_type);
13962                    if !stack.is_empty() {
13963                        break;
13964                    }
13965                }
13966                IftypeAttrs::Ap(val) => {
13967                    (stack, missing) = val.lookup_attr(offset, missing_type);
13968                    if !stack.is_empty() {
13969                        break;
13970                    }
13971                }
13972                IftypeAttrs::ApVlan(val) => {
13973                    (stack, missing) = val.lookup_attr(offset, missing_type);
13974                    if !stack.is_empty() {
13975                        break;
13976                    }
13977                }
13978                IftypeAttrs::Wds(val) => {
13979                    (stack, missing) = val.lookup_attr(offset, missing_type);
13980                    if !stack.is_empty() {
13981                        break;
13982                    }
13983                }
13984                IftypeAttrs::Monitor(val) => {
13985                    (stack, missing) = val.lookup_attr(offset, missing_type);
13986                    if !stack.is_empty() {
13987                        break;
13988                    }
13989                }
13990                IftypeAttrs::MeshPoint(val) => {
13991                    (stack, missing) = val.lookup_attr(offset, missing_type);
13992                    if !stack.is_empty() {
13993                        break;
13994                    }
13995                }
13996                IftypeAttrs::P2pClient(val) => {
13997                    (stack, missing) = val.lookup_attr(offset, missing_type);
13998                    if !stack.is_empty() {
13999                        break;
14000                    }
14001                }
14002                IftypeAttrs::P2pGo(val) => {
14003                    (stack, missing) = val.lookup_attr(offset, missing_type);
14004                    if !stack.is_empty() {
14005                        break;
14006                    }
14007                }
14008                IftypeAttrs::P2pDevice(val) => {
14009                    (stack, missing) = val.lookup_attr(offset, missing_type);
14010                    if !stack.is_empty() {
14011                        break;
14012                    }
14013                }
14014                IftypeAttrs::Ocb(val) => {
14015                    (stack, missing) = val.lookup_attr(offset, missing_type);
14016                    if !stack.is_empty() {
14017                        break;
14018                    }
14019                }
14020                IftypeAttrs::Nan(val) => {
14021                    (stack, missing) = val.lookup_attr(offset, missing_type);
14022                    if !stack.is_empty() {
14023                        break;
14024                    }
14025                }
14026                _ => {}
14027            };
14028            last_off = cur + attrs.pos;
14029        }
14030        if !stack.is_empty() {
14031            stack.push(("IftypeAttrs", cur));
14032        }
14033        (stack, missing)
14034    }
14035}
14036#[derive(Clone)]
14037pub enum SarAttributes<'a> {
14038    Type(u32),
14039    Specs(IterableArraySarSpecs<'a>),
14040}
14041impl<'a> IterableSarAttributes<'a> {
14042    pub fn get_type(&self) -> Result<u32, ErrorContext> {
14043        let mut iter = self.clone();
14044        iter.pos = 0;
14045        for attr in iter {
14046            if let SarAttributes::Type(val) = attr? {
14047                return Ok(val);
14048            }
14049        }
14050        Err(ErrorContext::new_missing(
14051            "SarAttributes",
14052            "Type",
14053            self.orig_loc,
14054            self.buf.as_ptr() as usize,
14055        ))
14056    }
14057    pub fn get_specs(
14058        &self,
14059    ) -> Result<ArrayIterable<IterableArraySarSpecs<'a>, IterableSarSpecs<'a>>, ErrorContext> {
14060        for attr in self.clone() {
14061            if let SarAttributes::Specs(val) = attr? {
14062                return Ok(ArrayIterable::new(val));
14063            }
14064        }
14065        Err(ErrorContext::new_missing(
14066            "SarAttributes",
14067            "Specs",
14068            self.orig_loc,
14069            self.buf.as_ptr() as usize,
14070        ))
14071    }
14072}
14073impl SarSpecs {
14074    pub fn new_array(buf: &[u8]) -> IterableArraySarSpecs<'_> {
14075        IterableArraySarSpecs::with_loc(buf, buf.as_ptr() as usize)
14076    }
14077}
14078#[derive(Clone, Copy, Default)]
14079pub struct IterableArraySarSpecs<'a> {
14080    buf: &'a [u8],
14081    pos: usize,
14082    orig_loc: usize,
14083}
14084impl<'a> IterableArraySarSpecs<'a> {
14085    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14086        Self {
14087            buf,
14088            pos: 0,
14089            orig_loc,
14090        }
14091    }
14092    pub fn get_buf(&self) -> &'a [u8] {
14093        self.buf
14094    }
14095}
14096impl<'a> Iterator for IterableArraySarSpecs<'a> {
14097    type Item = Result<IterableSarSpecs<'a>, ErrorContext>;
14098    fn next(&mut self) -> Option<Self::Item> {
14099        if self.buf.len() == self.pos {
14100            return None;
14101        }
14102        while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
14103            {
14104                return Some(Ok(IterableSarSpecs::with_loc(next, self.orig_loc)));
14105            }
14106        }
14107        Some(Err(ErrorContext::new(
14108            "SarSpecs",
14109            None,
14110            self.orig_loc,
14111            self.buf.as_ptr().wrapping_add(self.pos) as usize,
14112        )))
14113    }
14114}
14115impl SarAttributes<'_> {
14116    pub fn new<'a>(buf: &'a [u8]) -> IterableSarAttributes<'a> {
14117        IterableSarAttributes::with_loc(buf, buf.as_ptr() as usize)
14118    }
14119    fn attr_from_type(r#type: u16) -> Option<&'static str> {
14120        let res = match r#type {
14121            1u16 => "Type",
14122            2u16 => "Specs",
14123            _ => return None,
14124        };
14125        Some(res)
14126    }
14127}
14128#[derive(Clone, Copy, Default)]
14129pub struct IterableSarAttributes<'a> {
14130    buf: &'a [u8],
14131    pos: usize,
14132    orig_loc: usize,
14133}
14134impl<'a> IterableSarAttributes<'a> {
14135    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14136        Self {
14137            buf,
14138            pos: 0,
14139            orig_loc,
14140        }
14141    }
14142    pub fn get_buf(&self) -> &'a [u8] {
14143        self.buf
14144    }
14145}
14146impl<'a> Iterator for IterableSarAttributes<'a> {
14147    type Item = Result<SarAttributes<'a>, ErrorContext>;
14148    fn next(&mut self) -> Option<Self::Item> {
14149        let pos = self.pos;
14150        let mut r#type;
14151        loop {
14152            r#type = None;
14153            if self.buf.len() == self.pos {
14154                return None;
14155            }
14156            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14157                break;
14158            };
14159            r#type = Some(header.r#type);
14160            let res = match header.r#type {
14161                1u16 => SarAttributes::Type({
14162                    let res = parse_u32(next);
14163                    let Some(val) = res else { break };
14164                    val
14165                }),
14166                2u16 => SarAttributes::Specs({
14167                    let res = Some(IterableArraySarSpecs::with_loc(next, self.orig_loc));
14168                    let Some(val) = res else { break };
14169                    val
14170                }),
14171                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14172                n => continue,
14173            };
14174            return Some(Ok(res));
14175        }
14176        Some(Err(ErrorContext::new(
14177            "SarAttributes",
14178            r#type.and_then(|t| SarAttributes::attr_from_type(t)),
14179            self.orig_loc,
14180            self.buf.as_ptr().wrapping_add(pos) as usize,
14181        )))
14182    }
14183}
14184impl std::fmt::Debug for IterableArraySarSpecs<'_> {
14185    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14186        fmt.debug_list()
14187            .entries(self.clone().map(FlattenErrorContext))
14188            .finish()
14189    }
14190}
14191impl<'a> std::fmt::Debug for IterableSarAttributes<'_> {
14192    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14193        let mut fmt = f.debug_struct("SarAttributes");
14194        for attr in self.clone() {
14195            let attr = match attr {
14196                Ok(a) => a,
14197                Err(err) => {
14198                    fmt.finish()?;
14199                    f.write_str("Err(")?;
14200                    err.fmt(f)?;
14201                    return f.write_str(")");
14202                }
14203            };
14204            match attr {
14205                SarAttributes::Type(val) => fmt.field("Type", &val),
14206                SarAttributes::Specs(val) => fmt.field("Specs", &val),
14207            };
14208        }
14209        fmt.finish()
14210    }
14211}
14212impl IterableSarAttributes<'_> {
14213    pub fn lookup_attr(
14214        &self,
14215        offset: usize,
14216        missing_type: Option<u16>,
14217    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14218        let mut stack = Vec::new();
14219        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14220        if cur == offset {
14221            stack.push(("SarAttributes", offset));
14222            return (
14223                stack,
14224                missing_type.and_then(|t| SarAttributes::attr_from_type(t)),
14225            );
14226        }
14227        if cur > offset || cur + self.buf.len() < offset {
14228            return (stack, None);
14229        }
14230        let mut attrs = self.clone();
14231        let mut last_off = cur + attrs.pos;
14232        let mut missing = None;
14233        while let Some(attr) = attrs.next() {
14234            let Ok(attr) = attr else { break };
14235            match attr {
14236                SarAttributes::Type(val) => {
14237                    if last_off == offset {
14238                        stack.push(("Type", last_off));
14239                        break;
14240                    }
14241                }
14242                SarAttributes::Specs(val) => {
14243                    for entry in val {
14244                        let Ok(attr) = entry else { break };
14245                        (stack, missing) = attr.lookup_attr(offset, missing_type);
14246                        if !stack.is_empty() {
14247                            break;
14248                        }
14249                    }
14250                    if !stack.is_empty() {
14251                        stack.push(("Specs", last_off));
14252                        break;
14253                    }
14254                }
14255                _ => {}
14256            };
14257            last_off = cur + attrs.pos;
14258        }
14259        if !stack.is_empty() {
14260            stack.push(("SarAttributes", cur));
14261        }
14262        (stack, missing)
14263    }
14264}
14265#[derive(Clone)]
14266pub enum SarSpecs {
14267    Power(i32),
14268    RangeIndex(u32),
14269    StartFreq(u32),
14270    EndFreq(u32),
14271}
14272impl<'a> IterableSarSpecs<'a> {
14273    pub fn get_power(&self) -> Result<i32, ErrorContext> {
14274        let mut iter = self.clone();
14275        iter.pos = 0;
14276        for attr in iter {
14277            if let SarSpecs::Power(val) = attr? {
14278                return Ok(val);
14279            }
14280        }
14281        Err(ErrorContext::new_missing(
14282            "SarSpecs",
14283            "Power",
14284            self.orig_loc,
14285            self.buf.as_ptr() as usize,
14286        ))
14287    }
14288    pub fn get_range_index(&self) -> Result<u32, ErrorContext> {
14289        let mut iter = self.clone();
14290        iter.pos = 0;
14291        for attr in iter {
14292            if let SarSpecs::RangeIndex(val) = attr? {
14293                return Ok(val);
14294            }
14295        }
14296        Err(ErrorContext::new_missing(
14297            "SarSpecs",
14298            "RangeIndex",
14299            self.orig_loc,
14300            self.buf.as_ptr() as usize,
14301        ))
14302    }
14303    pub fn get_start_freq(&self) -> Result<u32, ErrorContext> {
14304        let mut iter = self.clone();
14305        iter.pos = 0;
14306        for attr in iter {
14307            if let SarSpecs::StartFreq(val) = attr? {
14308                return Ok(val);
14309            }
14310        }
14311        Err(ErrorContext::new_missing(
14312            "SarSpecs",
14313            "StartFreq",
14314            self.orig_loc,
14315            self.buf.as_ptr() as usize,
14316        ))
14317    }
14318    pub fn get_end_freq(&self) -> Result<u32, ErrorContext> {
14319        let mut iter = self.clone();
14320        iter.pos = 0;
14321        for attr in iter {
14322            if let SarSpecs::EndFreq(val) = attr? {
14323                return Ok(val);
14324            }
14325        }
14326        Err(ErrorContext::new_missing(
14327            "SarSpecs",
14328            "EndFreq",
14329            self.orig_loc,
14330            self.buf.as_ptr() as usize,
14331        ))
14332    }
14333}
14334impl SarSpecs {
14335    pub fn new<'a>(buf: &'a [u8]) -> IterableSarSpecs<'a> {
14336        IterableSarSpecs::with_loc(buf, buf.as_ptr() as usize)
14337    }
14338    fn attr_from_type(r#type: u16) -> Option<&'static str> {
14339        let res = match r#type {
14340            1u16 => "Power",
14341            2u16 => "RangeIndex",
14342            3u16 => "StartFreq",
14343            4u16 => "EndFreq",
14344            _ => return None,
14345        };
14346        Some(res)
14347    }
14348}
14349#[derive(Clone, Copy, Default)]
14350pub struct IterableSarSpecs<'a> {
14351    buf: &'a [u8],
14352    pos: usize,
14353    orig_loc: usize,
14354}
14355impl<'a> IterableSarSpecs<'a> {
14356    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14357        Self {
14358            buf,
14359            pos: 0,
14360            orig_loc,
14361        }
14362    }
14363    pub fn get_buf(&self) -> &'a [u8] {
14364        self.buf
14365    }
14366}
14367impl<'a> Iterator for IterableSarSpecs<'a> {
14368    type Item = Result<SarSpecs, ErrorContext>;
14369    fn next(&mut self) -> Option<Self::Item> {
14370        let pos = self.pos;
14371        let mut r#type;
14372        loop {
14373            r#type = None;
14374            if self.buf.len() == self.pos {
14375                return None;
14376            }
14377            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14378                break;
14379            };
14380            r#type = Some(header.r#type);
14381            let res = match header.r#type {
14382                1u16 => SarSpecs::Power({
14383                    let res = parse_i32(next);
14384                    let Some(val) = res else { break };
14385                    val
14386                }),
14387                2u16 => SarSpecs::RangeIndex({
14388                    let res = parse_u32(next);
14389                    let Some(val) = res else { break };
14390                    val
14391                }),
14392                3u16 => SarSpecs::StartFreq({
14393                    let res = parse_u32(next);
14394                    let Some(val) = res else { break };
14395                    val
14396                }),
14397                4u16 => SarSpecs::EndFreq({
14398                    let res = parse_u32(next);
14399                    let Some(val) = res else { break };
14400                    val
14401                }),
14402                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14403                n => continue,
14404            };
14405            return Some(Ok(res));
14406        }
14407        Some(Err(ErrorContext::new(
14408            "SarSpecs",
14409            r#type.and_then(|t| SarSpecs::attr_from_type(t)),
14410            self.orig_loc,
14411            self.buf.as_ptr().wrapping_add(pos) as usize,
14412        )))
14413    }
14414}
14415impl std::fmt::Debug for IterableSarSpecs<'_> {
14416    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14417        let mut fmt = f.debug_struct("SarSpecs");
14418        for attr in self.clone() {
14419            let attr = match attr {
14420                Ok(a) => a,
14421                Err(err) => {
14422                    fmt.finish()?;
14423                    f.write_str("Err(")?;
14424                    err.fmt(f)?;
14425                    return f.write_str(")");
14426                }
14427            };
14428            match attr {
14429                SarSpecs::Power(val) => fmt.field("Power", &val),
14430                SarSpecs::RangeIndex(val) => fmt.field("RangeIndex", &val),
14431                SarSpecs::StartFreq(val) => fmt.field("StartFreq", &val),
14432                SarSpecs::EndFreq(val) => fmt.field("EndFreq", &val),
14433            };
14434        }
14435        fmt.finish()
14436    }
14437}
14438impl IterableSarSpecs<'_> {
14439    pub fn lookup_attr(
14440        &self,
14441        offset: usize,
14442        missing_type: Option<u16>,
14443    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14444        let mut stack = Vec::new();
14445        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14446        if cur == offset {
14447            stack.push(("SarSpecs", offset));
14448            return (
14449                stack,
14450                missing_type.and_then(|t| SarSpecs::attr_from_type(t)),
14451            );
14452        }
14453        if cur > offset || cur + self.buf.len() < offset {
14454            return (stack, None);
14455        }
14456        let mut attrs = self.clone();
14457        let mut last_off = cur + attrs.pos;
14458        while let Some(attr) = attrs.next() {
14459            let Ok(attr) = attr else { break };
14460            match attr {
14461                SarSpecs::Power(val) => {
14462                    if last_off == offset {
14463                        stack.push(("Power", last_off));
14464                        break;
14465                    }
14466                }
14467                SarSpecs::RangeIndex(val) => {
14468                    if last_off == offset {
14469                        stack.push(("RangeIndex", last_off));
14470                        break;
14471                    }
14472                }
14473                SarSpecs::StartFreq(val) => {
14474                    if last_off == offset {
14475                        stack.push(("StartFreq", last_off));
14476                        break;
14477                    }
14478                }
14479                SarSpecs::EndFreq(val) => {
14480                    if last_off == offset {
14481                        stack.push(("EndFreq", last_off));
14482                        break;
14483                    }
14484                }
14485                _ => {}
14486            };
14487            last_off = cur + attrs.pos;
14488        }
14489        if !stack.is_empty() {
14490            stack.push(("SarSpecs", cur));
14491        }
14492        (stack, None)
14493    }
14494}
14495#[derive(Clone)]
14496pub enum SupportedIftypes {
14497    Adhoc(()),
14498    Station(()),
14499    Ap(()),
14500    ApVlan(()),
14501    Wds(()),
14502    Monitor(()),
14503    MeshPoint(()),
14504    P2pClient(()),
14505    P2pGo(()),
14506    P2pDevice(()),
14507    Ocb(()),
14508    Nan(()),
14509}
14510impl<'a> IterableSupportedIftypes<'a> {
14511    pub fn get_adhoc(&self) -> Result<(), ErrorContext> {
14512        let mut iter = self.clone();
14513        iter.pos = 0;
14514        for attr in iter {
14515            if let SupportedIftypes::Adhoc(val) = attr? {
14516                return Ok(val);
14517            }
14518        }
14519        Err(ErrorContext::new_missing(
14520            "SupportedIftypes",
14521            "Adhoc",
14522            self.orig_loc,
14523            self.buf.as_ptr() as usize,
14524        ))
14525    }
14526    pub fn get_station(&self) -> Result<(), ErrorContext> {
14527        let mut iter = self.clone();
14528        iter.pos = 0;
14529        for attr in iter {
14530            if let SupportedIftypes::Station(val) = attr? {
14531                return Ok(val);
14532            }
14533        }
14534        Err(ErrorContext::new_missing(
14535            "SupportedIftypes",
14536            "Station",
14537            self.orig_loc,
14538            self.buf.as_ptr() as usize,
14539        ))
14540    }
14541    pub fn get_ap(&self) -> Result<(), ErrorContext> {
14542        let mut iter = self.clone();
14543        iter.pos = 0;
14544        for attr in iter {
14545            if let SupportedIftypes::Ap(val) = attr? {
14546                return Ok(val);
14547            }
14548        }
14549        Err(ErrorContext::new_missing(
14550            "SupportedIftypes",
14551            "Ap",
14552            self.orig_loc,
14553            self.buf.as_ptr() as usize,
14554        ))
14555    }
14556    pub fn get_ap_vlan(&self) -> Result<(), ErrorContext> {
14557        let mut iter = self.clone();
14558        iter.pos = 0;
14559        for attr in iter {
14560            if let SupportedIftypes::ApVlan(val) = attr? {
14561                return Ok(val);
14562            }
14563        }
14564        Err(ErrorContext::new_missing(
14565            "SupportedIftypes",
14566            "ApVlan",
14567            self.orig_loc,
14568            self.buf.as_ptr() as usize,
14569        ))
14570    }
14571    pub fn get_wds(&self) -> Result<(), ErrorContext> {
14572        let mut iter = self.clone();
14573        iter.pos = 0;
14574        for attr in iter {
14575            if let SupportedIftypes::Wds(val) = attr? {
14576                return Ok(val);
14577            }
14578        }
14579        Err(ErrorContext::new_missing(
14580            "SupportedIftypes",
14581            "Wds",
14582            self.orig_loc,
14583            self.buf.as_ptr() as usize,
14584        ))
14585    }
14586    pub fn get_monitor(&self) -> Result<(), ErrorContext> {
14587        let mut iter = self.clone();
14588        iter.pos = 0;
14589        for attr in iter {
14590            if let SupportedIftypes::Monitor(val) = attr? {
14591                return Ok(val);
14592            }
14593        }
14594        Err(ErrorContext::new_missing(
14595            "SupportedIftypes",
14596            "Monitor",
14597            self.orig_loc,
14598            self.buf.as_ptr() as usize,
14599        ))
14600    }
14601    pub fn get_mesh_point(&self) -> Result<(), ErrorContext> {
14602        let mut iter = self.clone();
14603        iter.pos = 0;
14604        for attr in iter {
14605            if let SupportedIftypes::MeshPoint(val) = attr? {
14606                return Ok(val);
14607            }
14608        }
14609        Err(ErrorContext::new_missing(
14610            "SupportedIftypes",
14611            "MeshPoint",
14612            self.orig_loc,
14613            self.buf.as_ptr() as usize,
14614        ))
14615    }
14616    pub fn get_p2p_client(&self) -> Result<(), ErrorContext> {
14617        let mut iter = self.clone();
14618        iter.pos = 0;
14619        for attr in iter {
14620            if let SupportedIftypes::P2pClient(val) = attr? {
14621                return Ok(val);
14622            }
14623        }
14624        Err(ErrorContext::new_missing(
14625            "SupportedIftypes",
14626            "P2pClient",
14627            self.orig_loc,
14628            self.buf.as_ptr() as usize,
14629        ))
14630    }
14631    pub fn get_p2p_go(&self) -> Result<(), ErrorContext> {
14632        let mut iter = self.clone();
14633        iter.pos = 0;
14634        for attr in iter {
14635            if let SupportedIftypes::P2pGo(val) = attr? {
14636                return Ok(val);
14637            }
14638        }
14639        Err(ErrorContext::new_missing(
14640            "SupportedIftypes",
14641            "P2pGo",
14642            self.orig_loc,
14643            self.buf.as_ptr() as usize,
14644        ))
14645    }
14646    pub fn get_p2p_device(&self) -> Result<(), ErrorContext> {
14647        let mut iter = self.clone();
14648        iter.pos = 0;
14649        for attr in iter {
14650            if let SupportedIftypes::P2pDevice(val) = attr? {
14651                return Ok(val);
14652            }
14653        }
14654        Err(ErrorContext::new_missing(
14655            "SupportedIftypes",
14656            "P2pDevice",
14657            self.orig_loc,
14658            self.buf.as_ptr() as usize,
14659        ))
14660    }
14661    pub fn get_ocb(&self) -> Result<(), ErrorContext> {
14662        let mut iter = self.clone();
14663        iter.pos = 0;
14664        for attr in iter {
14665            if let SupportedIftypes::Ocb(val) = attr? {
14666                return Ok(val);
14667            }
14668        }
14669        Err(ErrorContext::new_missing(
14670            "SupportedIftypes",
14671            "Ocb",
14672            self.orig_loc,
14673            self.buf.as_ptr() as usize,
14674        ))
14675    }
14676    pub fn get_nan(&self) -> Result<(), ErrorContext> {
14677        let mut iter = self.clone();
14678        iter.pos = 0;
14679        for attr in iter {
14680            if let SupportedIftypes::Nan(val) = attr? {
14681                return Ok(val);
14682            }
14683        }
14684        Err(ErrorContext::new_missing(
14685            "SupportedIftypes",
14686            "Nan",
14687            self.orig_loc,
14688            self.buf.as_ptr() as usize,
14689        ))
14690    }
14691}
14692impl SupportedIftypes {
14693    pub fn new<'a>(buf: &'a [u8]) -> IterableSupportedIftypes<'a> {
14694        IterableSupportedIftypes::with_loc(buf, buf.as_ptr() as usize)
14695    }
14696    fn attr_from_type(r#type: u16) -> Option<&'static str> {
14697        let res = match r#type {
14698            1u16 => "Adhoc",
14699            2u16 => "Station",
14700            3u16 => "Ap",
14701            4u16 => "ApVlan",
14702            5u16 => "Wds",
14703            6u16 => "Monitor",
14704            7u16 => "MeshPoint",
14705            8u16 => "P2pClient",
14706            9u16 => "P2pGo",
14707            10u16 => "P2pDevice",
14708            11u16 => "Ocb",
14709            12u16 => "Nan",
14710            _ => return None,
14711        };
14712        Some(res)
14713    }
14714}
14715#[derive(Clone, Copy, Default)]
14716pub struct IterableSupportedIftypes<'a> {
14717    buf: &'a [u8],
14718    pos: usize,
14719    orig_loc: usize,
14720}
14721impl<'a> IterableSupportedIftypes<'a> {
14722    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14723        Self {
14724            buf,
14725            pos: 0,
14726            orig_loc,
14727        }
14728    }
14729    pub fn get_buf(&self) -> &'a [u8] {
14730        self.buf
14731    }
14732}
14733impl<'a> Iterator for IterableSupportedIftypes<'a> {
14734    type Item = Result<SupportedIftypes, ErrorContext>;
14735    fn next(&mut self) -> Option<Self::Item> {
14736        let pos = self.pos;
14737        let mut r#type;
14738        loop {
14739            r#type = None;
14740            if self.buf.len() == self.pos {
14741                return None;
14742            }
14743            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14744                break;
14745            };
14746            r#type = Some(header.r#type);
14747            let res = match header.r#type {
14748                1u16 => SupportedIftypes::Adhoc(()),
14749                2u16 => SupportedIftypes::Station(()),
14750                3u16 => SupportedIftypes::Ap(()),
14751                4u16 => SupportedIftypes::ApVlan(()),
14752                5u16 => SupportedIftypes::Wds(()),
14753                6u16 => SupportedIftypes::Monitor(()),
14754                7u16 => SupportedIftypes::MeshPoint(()),
14755                8u16 => SupportedIftypes::P2pClient(()),
14756                9u16 => SupportedIftypes::P2pGo(()),
14757                10u16 => SupportedIftypes::P2pDevice(()),
14758                11u16 => SupportedIftypes::Ocb(()),
14759                12u16 => SupportedIftypes::Nan(()),
14760                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14761                n => continue,
14762            };
14763            return Some(Ok(res));
14764        }
14765        Some(Err(ErrorContext::new(
14766            "SupportedIftypes",
14767            r#type.and_then(|t| SupportedIftypes::attr_from_type(t)),
14768            self.orig_loc,
14769            self.buf.as_ptr().wrapping_add(pos) as usize,
14770        )))
14771    }
14772}
14773impl std::fmt::Debug for IterableSupportedIftypes<'_> {
14774    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14775        let mut fmt = f.debug_struct("SupportedIftypes");
14776        for attr in self.clone() {
14777            let attr = match attr {
14778                Ok(a) => a,
14779                Err(err) => {
14780                    fmt.finish()?;
14781                    f.write_str("Err(")?;
14782                    err.fmt(f)?;
14783                    return f.write_str(")");
14784                }
14785            };
14786            match attr {
14787                SupportedIftypes::Adhoc(val) => fmt.field("Adhoc", &val),
14788                SupportedIftypes::Station(val) => fmt.field("Station", &val),
14789                SupportedIftypes::Ap(val) => fmt.field("Ap", &val),
14790                SupportedIftypes::ApVlan(val) => fmt.field("ApVlan", &val),
14791                SupportedIftypes::Wds(val) => fmt.field("Wds", &val),
14792                SupportedIftypes::Monitor(val) => fmt.field("Monitor", &val),
14793                SupportedIftypes::MeshPoint(val) => fmt.field("MeshPoint", &val),
14794                SupportedIftypes::P2pClient(val) => fmt.field("P2pClient", &val),
14795                SupportedIftypes::P2pGo(val) => fmt.field("P2pGo", &val),
14796                SupportedIftypes::P2pDevice(val) => fmt.field("P2pDevice", &val),
14797                SupportedIftypes::Ocb(val) => fmt.field("Ocb", &val),
14798                SupportedIftypes::Nan(val) => fmt.field("Nan", &val),
14799            };
14800        }
14801        fmt.finish()
14802    }
14803}
14804impl IterableSupportedIftypes<'_> {
14805    pub fn lookup_attr(
14806        &self,
14807        offset: usize,
14808        missing_type: Option<u16>,
14809    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14810        let mut stack = Vec::new();
14811        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14812        if cur == offset {
14813            stack.push(("SupportedIftypes", offset));
14814            return (
14815                stack,
14816                missing_type.and_then(|t| SupportedIftypes::attr_from_type(t)),
14817            );
14818        }
14819        if cur > offset || cur + self.buf.len() < offset {
14820            return (stack, None);
14821        }
14822        let mut attrs = self.clone();
14823        let mut last_off = cur + attrs.pos;
14824        while let Some(attr) = attrs.next() {
14825            let Ok(attr) = attr else { break };
14826            match attr {
14827                SupportedIftypes::Adhoc(val) => {
14828                    if last_off == offset {
14829                        stack.push(("Adhoc", last_off));
14830                        break;
14831                    }
14832                }
14833                SupportedIftypes::Station(val) => {
14834                    if last_off == offset {
14835                        stack.push(("Station", last_off));
14836                        break;
14837                    }
14838                }
14839                SupportedIftypes::Ap(val) => {
14840                    if last_off == offset {
14841                        stack.push(("Ap", last_off));
14842                        break;
14843                    }
14844                }
14845                SupportedIftypes::ApVlan(val) => {
14846                    if last_off == offset {
14847                        stack.push(("ApVlan", last_off));
14848                        break;
14849                    }
14850                }
14851                SupportedIftypes::Wds(val) => {
14852                    if last_off == offset {
14853                        stack.push(("Wds", last_off));
14854                        break;
14855                    }
14856                }
14857                SupportedIftypes::Monitor(val) => {
14858                    if last_off == offset {
14859                        stack.push(("Monitor", last_off));
14860                        break;
14861                    }
14862                }
14863                SupportedIftypes::MeshPoint(val) => {
14864                    if last_off == offset {
14865                        stack.push(("MeshPoint", last_off));
14866                        break;
14867                    }
14868                }
14869                SupportedIftypes::P2pClient(val) => {
14870                    if last_off == offset {
14871                        stack.push(("P2pClient", last_off));
14872                        break;
14873                    }
14874                }
14875                SupportedIftypes::P2pGo(val) => {
14876                    if last_off == offset {
14877                        stack.push(("P2pGo", last_off));
14878                        break;
14879                    }
14880                }
14881                SupportedIftypes::P2pDevice(val) => {
14882                    if last_off == offset {
14883                        stack.push(("P2pDevice", last_off));
14884                        break;
14885                    }
14886                }
14887                SupportedIftypes::Ocb(val) => {
14888                    if last_off == offset {
14889                        stack.push(("Ocb", last_off));
14890                        break;
14891                    }
14892                }
14893                SupportedIftypes::Nan(val) => {
14894                    if last_off == offset {
14895                        stack.push(("Nan", last_off));
14896                        break;
14897                    }
14898                }
14899                _ => {}
14900            };
14901            last_off = cur + attrs.pos;
14902        }
14903        if !stack.is_empty() {
14904            stack.push(("SupportedIftypes", cur));
14905        }
14906        (stack, None)
14907    }
14908}
14909#[derive(Clone)]
14910pub enum TxqStatsAttrs {
14911    BacklogBytes(u32),
14912    BacklogPackets(u32),
14913    Flows(u32),
14914    Drops(u32),
14915    EcnMarks(u32),
14916    Overlimit(u32),
14917    Overmemory(u32),
14918    Collisions(u32),
14919    TxBytes(u32),
14920    TxPackets(u32),
14921    MaxFlows(u32),
14922}
14923impl<'a> IterableTxqStatsAttrs<'a> {
14924    pub fn get_backlog_bytes(&self) -> Result<u32, ErrorContext> {
14925        let mut iter = self.clone();
14926        iter.pos = 0;
14927        for attr in iter {
14928            if let TxqStatsAttrs::BacklogBytes(val) = attr? {
14929                return Ok(val);
14930            }
14931        }
14932        Err(ErrorContext::new_missing(
14933            "TxqStatsAttrs",
14934            "BacklogBytes",
14935            self.orig_loc,
14936            self.buf.as_ptr() as usize,
14937        ))
14938    }
14939    pub fn get_backlog_packets(&self) -> Result<u32, ErrorContext> {
14940        let mut iter = self.clone();
14941        iter.pos = 0;
14942        for attr in iter {
14943            if let TxqStatsAttrs::BacklogPackets(val) = attr? {
14944                return Ok(val);
14945            }
14946        }
14947        Err(ErrorContext::new_missing(
14948            "TxqStatsAttrs",
14949            "BacklogPackets",
14950            self.orig_loc,
14951            self.buf.as_ptr() as usize,
14952        ))
14953    }
14954    pub fn get_flows(&self) -> Result<u32, ErrorContext> {
14955        let mut iter = self.clone();
14956        iter.pos = 0;
14957        for attr in iter {
14958            if let TxqStatsAttrs::Flows(val) = attr? {
14959                return Ok(val);
14960            }
14961        }
14962        Err(ErrorContext::new_missing(
14963            "TxqStatsAttrs",
14964            "Flows",
14965            self.orig_loc,
14966            self.buf.as_ptr() as usize,
14967        ))
14968    }
14969    pub fn get_drops(&self) -> Result<u32, ErrorContext> {
14970        let mut iter = self.clone();
14971        iter.pos = 0;
14972        for attr in iter {
14973            if let TxqStatsAttrs::Drops(val) = attr? {
14974                return Ok(val);
14975            }
14976        }
14977        Err(ErrorContext::new_missing(
14978            "TxqStatsAttrs",
14979            "Drops",
14980            self.orig_loc,
14981            self.buf.as_ptr() as usize,
14982        ))
14983    }
14984    pub fn get_ecn_marks(&self) -> Result<u32, ErrorContext> {
14985        let mut iter = self.clone();
14986        iter.pos = 0;
14987        for attr in iter {
14988            if let TxqStatsAttrs::EcnMarks(val) = attr? {
14989                return Ok(val);
14990            }
14991        }
14992        Err(ErrorContext::new_missing(
14993            "TxqStatsAttrs",
14994            "EcnMarks",
14995            self.orig_loc,
14996            self.buf.as_ptr() as usize,
14997        ))
14998    }
14999    pub fn get_overlimit(&self) -> Result<u32, ErrorContext> {
15000        let mut iter = self.clone();
15001        iter.pos = 0;
15002        for attr in iter {
15003            if let TxqStatsAttrs::Overlimit(val) = attr? {
15004                return Ok(val);
15005            }
15006        }
15007        Err(ErrorContext::new_missing(
15008            "TxqStatsAttrs",
15009            "Overlimit",
15010            self.orig_loc,
15011            self.buf.as_ptr() as usize,
15012        ))
15013    }
15014    pub fn get_overmemory(&self) -> Result<u32, ErrorContext> {
15015        let mut iter = self.clone();
15016        iter.pos = 0;
15017        for attr in iter {
15018            if let TxqStatsAttrs::Overmemory(val) = attr? {
15019                return Ok(val);
15020            }
15021        }
15022        Err(ErrorContext::new_missing(
15023            "TxqStatsAttrs",
15024            "Overmemory",
15025            self.orig_loc,
15026            self.buf.as_ptr() as usize,
15027        ))
15028    }
15029    pub fn get_collisions(&self) -> Result<u32, ErrorContext> {
15030        let mut iter = self.clone();
15031        iter.pos = 0;
15032        for attr in iter {
15033            if let TxqStatsAttrs::Collisions(val) = attr? {
15034                return Ok(val);
15035            }
15036        }
15037        Err(ErrorContext::new_missing(
15038            "TxqStatsAttrs",
15039            "Collisions",
15040            self.orig_loc,
15041            self.buf.as_ptr() as usize,
15042        ))
15043    }
15044    pub fn get_tx_bytes(&self) -> Result<u32, ErrorContext> {
15045        let mut iter = self.clone();
15046        iter.pos = 0;
15047        for attr in iter {
15048            if let TxqStatsAttrs::TxBytes(val) = attr? {
15049                return Ok(val);
15050            }
15051        }
15052        Err(ErrorContext::new_missing(
15053            "TxqStatsAttrs",
15054            "TxBytes",
15055            self.orig_loc,
15056            self.buf.as_ptr() as usize,
15057        ))
15058    }
15059    pub fn get_tx_packets(&self) -> Result<u32, ErrorContext> {
15060        let mut iter = self.clone();
15061        iter.pos = 0;
15062        for attr in iter {
15063            if let TxqStatsAttrs::TxPackets(val) = attr? {
15064                return Ok(val);
15065            }
15066        }
15067        Err(ErrorContext::new_missing(
15068            "TxqStatsAttrs",
15069            "TxPackets",
15070            self.orig_loc,
15071            self.buf.as_ptr() as usize,
15072        ))
15073    }
15074    pub fn get_max_flows(&self) -> Result<u32, ErrorContext> {
15075        let mut iter = self.clone();
15076        iter.pos = 0;
15077        for attr in iter {
15078            if let TxqStatsAttrs::MaxFlows(val) = attr? {
15079                return Ok(val);
15080            }
15081        }
15082        Err(ErrorContext::new_missing(
15083            "TxqStatsAttrs",
15084            "MaxFlows",
15085            self.orig_loc,
15086            self.buf.as_ptr() as usize,
15087        ))
15088    }
15089}
15090impl TxqStatsAttrs {
15091    pub fn new<'a>(buf: &'a [u8]) -> IterableTxqStatsAttrs<'a> {
15092        IterableTxqStatsAttrs::with_loc(buf, buf.as_ptr() as usize)
15093    }
15094    fn attr_from_type(r#type: u16) -> Option<&'static str> {
15095        let res = match r#type {
15096            1u16 => "BacklogBytes",
15097            2u16 => "BacklogPackets",
15098            3u16 => "Flows",
15099            4u16 => "Drops",
15100            5u16 => "EcnMarks",
15101            6u16 => "Overlimit",
15102            7u16 => "Overmemory",
15103            8u16 => "Collisions",
15104            9u16 => "TxBytes",
15105            10u16 => "TxPackets",
15106            11u16 => "MaxFlows",
15107            _ => return None,
15108        };
15109        Some(res)
15110    }
15111}
15112#[derive(Clone, Copy, Default)]
15113pub struct IterableTxqStatsAttrs<'a> {
15114    buf: &'a [u8],
15115    pos: usize,
15116    orig_loc: usize,
15117}
15118impl<'a> IterableTxqStatsAttrs<'a> {
15119    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
15120        Self {
15121            buf,
15122            pos: 0,
15123            orig_loc,
15124        }
15125    }
15126    pub fn get_buf(&self) -> &'a [u8] {
15127        self.buf
15128    }
15129}
15130impl<'a> Iterator for IterableTxqStatsAttrs<'a> {
15131    type Item = Result<TxqStatsAttrs, ErrorContext>;
15132    fn next(&mut self) -> Option<Self::Item> {
15133        let pos = self.pos;
15134        let mut r#type;
15135        loop {
15136            r#type = None;
15137            if self.buf.len() == self.pos {
15138                return None;
15139            }
15140            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
15141                break;
15142            };
15143            r#type = Some(header.r#type);
15144            let res = match header.r#type {
15145                1u16 => TxqStatsAttrs::BacklogBytes({
15146                    let res = parse_u32(next);
15147                    let Some(val) = res else { break };
15148                    val
15149                }),
15150                2u16 => TxqStatsAttrs::BacklogPackets({
15151                    let res = parse_u32(next);
15152                    let Some(val) = res else { break };
15153                    val
15154                }),
15155                3u16 => TxqStatsAttrs::Flows({
15156                    let res = parse_u32(next);
15157                    let Some(val) = res else { break };
15158                    val
15159                }),
15160                4u16 => TxqStatsAttrs::Drops({
15161                    let res = parse_u32(next);
15162                    let Some(val) = res else { break };
15163                    val
15164                }),
15165                5u16 => TxqStatsAttrs::EcnMarks({
15166                    let res = parse_u32(next);
15167                    let Some(val) = res else { break };
15168                    val
15169                }),
15170                6u16 => TxqStatsAttrs::Overlimit({
15171                    let res = parse_u32(next);
15172                    let Some(val) = res else { break };
15173                    val
15174                }),
15175                7u16 => TxqStatsAttrs::Overmemory({
15176                    let res = parse_u32(next);
15177                    let Some(val) = res else { break };
15178                    val
15179                }),
15180                8u16 => TxqStatsAttrs::Collisions({
15181                    let res = parse_u32(next);
15182                    let Some(val) = res else { break };
15183                    val
15184                }),
15185                9u16 => TxqStatsAttrs::TxBytes({
15186                    let res = parse_u32(next);
15187                    let Some(val) = res else { break };
15188                    val
15189                }),
15190                10u16 => TxqStatsAttrs::TxPackets({
15191                    let res = parse_u32(next);
15192                    let Some(val) = res else { break };
15193                    val
15194                }),
15195                11u16 => TxqStatsAttrs::MaxFlows({
15196                    let res = parse_u32(next);
15197                    let Some(val) = res else { break };
15198                    val
15199                }),
15200                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
15201                n => continue,
15202            };
15203            return Some(Ok(res));
15204        }
15205        Some(Err(ErrorContext::new(
15206            "TxqStatsAttrs",
15207            r#type.and_then(|t| TxqStatsAttrs::attr_from_type(t)),
15208            self.orig_loc,
15209            self.buf.as_ptr().wrapping_add(pos) as usize,
15210        )))
15211    }
15212}
15213impl std::fmt::Debug for IterableTxqStatsAttrs<'_> {
15214    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15215        let mut fmt = f.debug_struct("TxqStatsAttrs");
15216        for attr in self.clone() {
15217            let attr = match attr {
15218                Ok(a) => a,
15219                Err(err) => {
15220                    fmt.finish()?;
15221                    f.write_str("Err(")?;
15222                    err.fmt(f)?;
15223                    return f.write_str(")");
15224                }
15225            };
15226            match attr {
15227                TxqStatsAttrs::BacklogBytes(val) => fmt.field("BacklogBytes", &val),
15228                TxqStatsAttrs::BacklogPackets(val) => fmt.field("BacklogPackets", &val),
15229                TxqStatsAttrs::Flows(val) => fmt.field("Flows", &val),
15230                TxqStatsAttrs::Drops(val) => fmt.field("Drops", &val),
15231                TxqStatsAttrs::EcnMarks(val) => fmt.field("EcnMarks", &val),
15232                TxqStatsAttrs::Overlimit(val) => fmt.field("Overlimit", &val),
15233                TxqStatsAttrs::Overmemory(val) => fmt.field("Overmemory", &val),
15234                TxqStatsAttrs::Collisions(val) => fmt.field("Collisions", &val),
15235                TxqStatsAttrs::TxBytes(val) => fmt.field("TxBytes", &val),
15236                TxqStatsAttrs::TxPackets(val) => fmt.field("TxPackets", &val),
15237                TxqStatsAttrs::MaxFlows(val) => fmt.field("MaxFlows", &val),
15238            };
15239        }
15240        fmt.finish()
15241    }
15242}
15243impl IterableTxqStatsAttrs<'_> {
15244    pub fn lookup_attr(
15245        &self,
15246        offset: usize,
15247        missing_type: Option<u16>,
15248    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
15249        let mut stack = Vec::new();
15250        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
15251        if cur == offset {
15252            stack.push(("TxqStatsAttrs", offset));
15253            return (
15254                stack,
15255                missing_type.and_then(|t| TxqStatsAttrs::attr_from_type(t)),
15256            );
15257        }
15258        if cur > offset || cur + self.buf.len() < offset {
15259            return (stack, None);
15260        }
15261        let mut attrs = self.clone();
15262        let mut last_off = cur + attrs.pos;
15263        while let Some(attr) = attrs.next() {
15264            let Ok(attr) = attr else { break };
15265            match attr {
15266                TxqStatsAttrs::BacklogBytes(val) => {
15267                    if last_off == offset {
15268                        stack.push(("BacklogBytes", last_off));
15269                        break;
15270                    }
15271                }
15272                TxqStatsAttrs::BacklogPackets(val) => {
15273                    if last_off == offset {
15274                        stack.push(("BacklogPackets", last_off));
15275                        break;
15276                    }
15277                }
15278                TxqStatsAttrs::Flows(val) => {
15279                    if last_off == offset {
15280                        stack.push(("Flows", last_off));
15281                        break;
15282                    }
15283                }
15284                TxqStatsAttrs::Drops(val) => {
15285                    if last_off == offset {
15286                        stack.push(("Drops", last_off));
15287                        break;
15288                    }
15289                }
15290                TxqStatsAttrs::EcnMarks(val) => {
15291                    if last_off == offset {
15292                        stack.push(("EcnMarks", last_off));
15293                        break;
15294                    }
15295                }
15296                TxqStatsAttrs::Overlimit(val) => {
15297                    if last_off == offset {
15298                        stack.push(("Overlimit", last_off));
15299                        break;
15300                    }
15301                }
15302                TxqStatsAttrs::Overmemory(val) => {
15303                    if last_off == offset {
15304                        stack.push(("Overmemory", last_off));
15305                        break;
15306                    }
15307                }
15308                TxqStatsAttrs::Collisions(val) => {
15309                    if last_off == offset {
15310                        stack.push(("Collisions", last_off));
15311                        break;
15312                    }
15313                }
15314                TxqStatsAttrs::TxBytes(val) => {
15315                    if last_off == offset {
15316                        stack.push(("TxBytes", last_off));
15317                        break;
15318                    }
15319                }
15320                TxqStatsAttrs::TxPackets(val) => {
15321                    if last_off == offset {
15322                        stack.push(("TxPackets", last_off));
15323                        break;
15324                    }
15325                }
15326                TxqStatsAttrs::MaxFlows(val) => {
15327                    if last_off == offset {
15328                        stack.push(("MaxFlows", last_off));
15329                        break;
15330                    }
15331                }
15332                _ => {}
15333            };
15334            last_off = cur + attrs.pos;
15335        }
15336        if !stack.is_empty() {
15337            stack.push(("TxqStatsAttrs", cur));
15338        }
15339        (stack, None)
15340    }
15341}
15342#[derive(Clone)]
15343pub enum WmmAttrs {
15344    CwMin(u16),
15345    CwMax(u16),
15346    Aifsn(u8),
15347    Txop(u16),
15348}
15349impl<'a> IterableWmmAttrs<'a> {
15350    pub fn get_cw_min(&self) -> Result<u16, ErrorContext> {
15351        let mut iter = self.clone();
15352        iter.pos = 0;
15353        for attr in iter {
15354            if let WmmAttrs::CwMin(val) = attr? {
15355                return Ok(val);
15356            }
15357        }
15358        Err(ErrorContext::new_missing(
15359            "WmmAttrs",
15360            "CwMin",
15361            self.orig_loc,
15362            self.buf.as_ptr() as usize,
15363        ))
15364    }
15365    pub fn get_cw_max(&self) -> Result<u16, ErrorContext> {
15366        let mut iter = self.clone();
15367        iter.pos = 0;
15368        for attr in iter {
15369            if let WmmAttrs::CwMax(val) = attr? {
15370                return Ok(val);
15371            }
15372        }
15373        Err(ErrorContext::new_missing(
15374            "WmmAttrs",
15375            "CwMax",
15376            self.orig_loc,
15377            self.buf.as_ptr() as usize,
15378        ))
15379    }
15380    pub fn get_aifsn(&self) -> Result<u8, ErrorContext> {
15381        let mut iter = self.clone();
15382        iter.pos = 0;
15383        for attr in iter {
15384            if let WmmAttrs::Aifsn(val) = attr? {
15385                return Ok(val);
15386            }
15387        }
15388        Err(ErrorContext::new_missing(
15389            "WmmAttrs",
15390            "Aifsn",
15391            self.orig_loc,
15392            self.buf.as_ptr() as usize,
15393        ))
15394    }
15395    pub fn get_txop(&self) -> Result<u16, ErrorContext> {
15396        let mut iter = self.clone();
15397        iter.pos = 0;
15398        for attr in iter {
15399            if let WmmAttrs::Txop(val) = attr? {
15400                return Ok(val);
15401            }
15402        }
15403        Err(ErrorContext::new_missing(
15404            "WmmAttrs",
15405            "Txop",
15406            self.orig_loc,
15407            self.buf.as_ptr() as usize,
15408        ))
15409    }
15410}
15411impl WmmAttrs {
15412    pub fn new<'a>(buf: &'a [u8]) -> IterableWmmAttrs<'a> {
15413        IterableWmmAttrs::with_loc(buf, buf.as_ptr() as usize)
15414    }
15415    fn attr_from_type(r#type: u16) -> Option<&'static str> {
15416        let res = match r#type {
15417            1u16 => "CwMin",
15418            2u16 => "CwMax",
15419            3u16 => "Aifsn",
15420            4u16 => "Txop",
15421            _ => return None,
15422        };
15423        Some(res)
15424    }
15425}
15426#[derive(Clone, Copy, Default)]
15427pub struct IterableWmmAttrs<'a> {
15428    buf: &'a [u8],
15429    pos: usize,
15430    orig_loc: usize,
15431}
15432impl<'a> IterableWmmAttrs<'a> {
15433    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
15434        Self {
15435            buf,
15436            pos: 0,
15437            orig_loc,
15438        }
15439    }
15440    pub fn get_buf(&self) -> &'a [u8] {
15441        self.buf
15442    }
15443}
15444impl<'a> Iterator for IterableWmmAttrs<'a> {
15445    type Item = Result<WmmAttrs, ErrorContext>;
15446    fn next(&mut self) -> Option<Self::Item> {
15447        let pos = self.pos;
15448        let mut r#type;
15449        loop {
15450            r#type = None;
15451            if self.buf.len() == self.pos {
15452                return None;
15453            }
15454            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
15455                break;
15456            };
15457            r#type = Some(header.r#type);
15458            let res = match header.r#type {
15459                1u16 => WmmAttrs::CwMin({
15460                    let res = parse_u16(next);
15461                    let Some(val) = res else { break };
15462                    val
15463                }),
15464                2u16 => WmmAttrs::CwMax({
15465                    let res = parse_u16(next);
15466                    let Some(val) = res else { break };
15467                    val
15468                }),
15469                3u16 => WmmAttrs::Aifsn({
15470                    let res = parse_u8(next);
15471                    let Some(val) = res else { break };
15472                    val
15473                }),
15474                4u16 => WmmAttrs::Txop({
15475                    let res = parse_u16(next);
15476                    let Some(val) = res else { break };
15477                    val
15478                }),
15479                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
15480                n => continue,
15481            };
15482            return Some(Ok(res));
15483        }
15484        Some(Err(ErrorContext::new(
15485            "WmmAttrs",
15486            r#type.and_then(|t| WmmAttrs::attr_from_type(t)),
15487            self.orig_loc,
15488            self.buf.as_ptr().wrapping_add(pos) as usize,
15489        )))
15490    }
15491}
15492impl std::fmt::Debug for IterableWmmAttrs<'_> {
15493    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15494        let mut fmt = f.debug_struct("WmmAttrs");
15495        for attr in self.clone() {
15496            let attr = match attr {
15497                Ok(a) => a,
15498                Err(err) => {
15499                    fmt.finish()?;
15500                    f.write_str("Err(")?;
15501                    err.fmt(f)?;
15502                    return f.write_str(")");
15503                }
15504            };
15505            match attr {
15506                WmmAttrs::CwMin(val) => fmt.field("CwMin", &val),
15507                WmmAttrs::CwMax(val) => fmt.field("CwMax", &val),
15508                WmmAttrs::Aifsn(val) => fmt.field("Aifsn", &val),
15509                WmmAttrs::Txop(val) => fmt.field("Txop", &val),
15510            };
15511        }
15512        fmt.finish()
15513    }
15514}
15515impl IterableWmmAttrs<'_> {
15516    pub fn lookup_attr(
15517        &self,
15518        offset: usize,
15519        missing_type: Option<u16>,
15520    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
15521        let mut stack = Vec::new();
15522        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
15523        if cur == offset {
15524            stack.push(("WmmAttrs", offset));
15525            return (
15526                stack,
15527                missing_type.and_then(|t| WmmAttrs::attr_from_type(t)),
15528            );
15529        }
15530        if cur > offset || cur + self.buf.len() < offset {
15531            return (stack, None);
15532        }
15533        let mut attrs = self.clone();
15534        let mut last_off = cur + attrs.pos;
15535        while let Some(attr) = attrs.next() {
15536            let Ok(attr) = attr else { break };
15537            match attr {
15538                WmmAttrs::CwMin(val) => {
15539                    if last_off == offset {
15540                        stack.push(("CwMin", last_off));
15541                        break;
15542                    }
15543                }
15544                WmmAttrs::CwMax(val) => {
15545                    if last_off == offset {
15546                        stack.push(("CwMax", last_off));
15547                        break;
15548                    }
15549                }
15550                WmmAttrs::Aifsn(val) => {
15551                    if last_off == offset {
15552                        stack.push(("Aifsn", last_off));
15553                        break;
15554                    }
15555                }
15556                WmmAttrs::Txop(val) => {
15557                    if last_off == offset {
15558                        stack.push(("Txop", last_off));
15559                        break;
15560                    }
15561                }
15562                _ => {}
15563            };
15564            last_off = cur + attrs.pos;
15565        }
15566        if !stack.is_empty() {
15567            stack.push(("WmmAttrs", cur));
15568        }
15569        (stack, None)
15570    }
15571}
15572#[derive(Clone)]
15573pub enum WowlanTriggersAttrs {
15574    Any(()),
15575    Disconnect(()),
15576    MagicPkt(()),
15577    PktPattern(()),
15578    GtkRekeySupported(()),
15579    GtkRekeyFailure(()),
15580    EapIdentRequest(()),
15581    _4wayHandshake(()),
15582    RfkillRelease(()),
15583    WakeupPkt80211(()),
15584    WakeupPkt80211Len(()),
15585    WakeupPkt8023(()),
15586    WakeupPkt8023Len(()),
15587    TcpConnection(()),
15588    WakeupTcpMatch(()),
15589    WakeupTcpConnlost(()),
15590    WakeupTcpNomoretokens(()),
15591    NetDetect(()),
15592    NetDetectResults(()),
15593    UnprotectedDeauthDisassoc(()),
15594}
15595impl<'a> IterableWowlanTriggersAttrs<'a> {
15596    pub fn get_any(&self) -> Result<(), ErrorContext> {
15597        let mut iter = self.clone();
15598        iter.pos = 0;
15599        for attr in iter {
15600            if let WowlanTriggersAttrs::Any(val) = attr? {
15601                return Ok(val);
15602            }
15603        }
15604        Err(ErrorContext::new_missing(
15605            "WowlanTriggersAttrs",
15606            "Any",
15607            self.orig_loc,
15608            self.buf.as_ptr() as usize,
15609        ))
15610    }
15611    pub fn get_disconnect(&self) -> Result<(), ErrorContext> {
15612        let mut iter = self.clone();
15613        iter.pos = 0;
15614        for attr in iter {
15615            if let WowlanTriggersAttrs::Disconnect(val) = attr? {
15616                return Ok(val);
15617            }
15618        }
15619        Err(ErrorContext::new_missing(
15620            "WowlanTriggersAttrs",
15621            "Disconnect",
15622            self.orig_loc,
15623            self.buf.as_ptr() as usize,
15624        ))
15625    }
15626    pub fn get_magic_pkt(&self) -> Result<(), ErrorContext> {
15627        let mut iter = self.clone();
15628        iter.pos = 0;
15629        for attr in iter {
15630            if let WowlanTriggersAttrs::MagicPkt(val) = attr? {
15631                return Ok(val);
15632            }
15633        }
15634        Err(ErrorContext::new_missing(
15635            "WowlanTriggersAttrs",
15636            "MagicPkt",
15637            self.orig_loc,
15638            self.buf.as_ptr() as usize,
15639        ))
15640    }
15641    pub fn get_pkt_pattern(&self) -> Result<(), ErrorContext> {
15642        let mut iter = self.clone();
15643        iter.pos = 0;
15644        for attr in iter {
15645            if let WowlanTriggersAttrs::PktPattern(val) = attr? {
15646                return Ok(val);
15647            }
15648        }
15649        Err(ErrorContext::new_missing(
15650            "WowlanTriggersAttrs",
15651            "PktPattern",
15652            self.orig_loc,
15653            self.buf.as_ptr() as usize,
15654        ))
15655    }
15656    pub fn get_gtk_rekey_supported(&self) -> Result<(), ErrorContext> {
15657        let mut iter = self.clone();
15658        iter.pos = 0;
15659        for attr in iter {
15660            if let WowlanTriggersAttrs::GtkRekeySupported(val) = attr? {
15661                return Ok(val);
15662            }
15663        }
15664        Err(ErrorContext::new_missing(
15665            "WowlanTriggersAttrs",
15666            "GtkRekeySupported",
15667            self.orig_loc,
15668            self.buf.as_ptr() as usize,
15669        ))
15670    }
15671    pub fn get_gtk_rekey_failure(&self) -> Result<(), ErrorContext> {
15672        let mut iter = self.clone();
15673        iter.pos = 0;
15674        for attr in iter {
15675            if let WowlanTriggersAttrs::GtkRekeyFailure(val) = attr? {
15676                return Ok(val);
15677            }
15678        }
15679        Err(ErrorContext::new_missing(
15680            "WowlanTriggersAttrs",
15681            "GtkRekeyFailure",
15682            self.orig_loc,
15683            self.buf.as_ptr() as usize,
15684        ))
15685    }
15686    pub fn get_eap_ident_request(&self) -> Result<(), ErrorContext> {
15687        let mut iter = self.clone();
15688        iter.pos = 0;
15689        for attr in iter {
15690            if let WowlanTriggersAttrs::EapIdentRequest(val) = attr? {
15691                return Ok(val);
15692            }
15693        }
15694        Err(ErrorContext::new_missing(
15695            "WowlanTriggersAttrs",
15696            "EapIdentRequest",
15697            self.orig_loc,
15698            self.buf.as_ptr() as usize,
15699        ))
15700    }
15701    pub fn get_4way_handshake(&self) -> Result<(), ErrorContext> {
15702        let mut iter = self.clone();
15703        iter.pos = 0;
15704        for attr in iter {
15705            if let WowlanTriggersAttrs::_4wayHandshake(val) = attr? {
15706                return Ok(val);
15707            }
15708        }
15709        Err(ErrorContext::new_missing(
15710            "WowlanTriggersAttrs",
15711            "4wayHandshake",
15712            self.orig_loc,
15713            self.buf.as_ptr() as usize,
15714        ))
15715    }
15716    pub fn get_rfkill_release(&self) -> Result<(), ErrorContext> {
15717        let mut iter = self.clone();
15718        iter.pos = 0;
15719        for attr in iter {
15720            if let WowlanTriggersAttrs::RfkillRelease(val) = attr? {
15721                return Ok(val);
15722            }
15723        }
15724        Err(ErrorContext::new_missing(
15725            "WowlanTriggersAttrs",
15726            "RfkillRelease",
15727            self.orig_loc,
15728            self.buf.as_ptr() as usize,
15729        ))
15730    }
15731    pub fn get_wakeup_pkt_80211(&self) -> Result<(), ErrorContext> {
15732        let mut iter = self.clone();
15733        iter.pos = 0;
15734        for attr in iter {
15735            if let WowlanTriggersAttrs::WakeupPkt80211(val) = attr? {
15736                return Ok(val);
15737            }
15738        }
15739        Err(ErrorContext::new_missing(
15740            "WowlanTriggersAttrs",
15741            "WakeupPkt80211",
15742            self.orig_loc,
15743            self.buf.as_ptr() as usize,
15744        ))
15745    }
15746    pub fn get_wakeup_pkt_80211_len(&self) -> Result<(), ErrorContext> {
15747        let mut iter = self.clone();
15748        iter.pos = 0;
15749        for attr in iter {
15750            if let WowlanTriggersAttrs::WakeupPkt80211Len(val) = attr? {
15751                return Ok(val);
15752            }
15753        }
15754        Err(ErrorContext::new_missing(
15755            "WowlanTriggersAttrs",
15756            "WakeupPkt80211Len",
15757            self.orig_loc,
15758            self.buf.as_ptr() as usize,
15759        ))
15760    }
15761    pub fn get_wakeup_pkt_8023(&self) -> Result<(), ErrorContext> {
15762        let mut iter = self.clone();
15763        iter.pos = 0;
15764        for attr in iter {
15765            if let WowlanTriggersAttrs::WakeupPkt8023(val) = attr? {
15766                return Ok(val);
15767            }
15768        }
15769        Err(ErrorContext::new_missing(
15770            "WowlanTriggersAttrs",
15771            "WakeupPkt8023",
15772            self.orig_loc,
15773            self.buf.as_ptr() as usize,
15774        ))
15775    }
15776    pub fn get_wakeup_pkt_8023_len(&self) -> Result<(), ErrorContext> {
15777        let mut iter = self.clone();
15778        iter.pos = 0;
15779        for attr in iter {
15780            if let WowlanTriggersAttrs::WakeupPkt8023Len(val) = attr? {
15781                return Ok(val);
15782            }
15783        }
15784        Err(ErrorContext::new_missing(
15785            "WowlanTriggersAttrs",
15786            "WakeupPkt8023Len",
15787            self.orig_loc,
15788            self.buf.as_ptr() as usize,
15789        ))
15790    }
15791    pub fn get_tcp_connection(&self) -> Result<(), ErrorContext> {
15792        let mut iter = self.clone();
15793        iter.pos = 0;
15794        for attr in iter {
15795            if let WowlanTriggersAttrs::TcpConnection(val) = attr? {
15796                return Ok(val);
15797            }
15798        }
15799        Err(ErrorContext::new_missing(
15800            "WowlanTriggersAttrs",
15801            "TcpConnection",
15802            self.orig_loc,
15803            self.buf.as_ptr() as usize,
15804        ))
15805    }
15806    pub fn get_wakeup_tcp_match(&self) -> Result<(), ErrorContext> {
15807        let mut iter = self.clone();
15808        iter.pos = 0;
15809        for attr in iter {
15810            if let WowlanTriggersAttrs::WakeupTcpMatch(val) = attr? {
15811                return Ok(val);
15812            }
15813        }
15814        Err(ErrorContext::new_missing(
15815            "WowlanTriggersAttrs",
15816            "WakeupTcpMatch",
15817            self.orig_loc,
15818            self.buf.as_ptr() as usize,
15819        ))
15820    }
15821    pub fn get_wakeup_tcp_connlost(&self) -> Result<(), ErrorContext> {
15822        let mut iter = self.clone();
15823        iter.pos = 0;
15824        for attr in iter {
15825            if let WowlanTriggersAttrs::WakeupTcpConnlost(val) = attr? {
15826                return Ok(val);
15827            }
15828        }
15829        Err(ErrorContext::new_missing(
15830            "WowlanTriggersAttrs",
15831            "WakeupTcpConnlost",
15832            self.orig_loc,
15833            self.buf.as_ptr() as usize,
15834        ))
15835    }
15836    pub fn get_wakeup_tcp_nomoretokens(&self) -> Result<(), ErrorContext> {
15837        let mut iter = self.clone();
15838        iter.pos = 0;
15839        for attr in iter {
15840            if let WowlanTriggersAttrs::WakeupTcpNomoretokens(val) = attr? {
15841                return Ok(val);
15842            }
15843        }
15844        Err(ErrorContext::new_missing(
15845            "WowlanTriggersAttrs",
15846            "WakeupTcpNomoretokens",
15847            self.orig_loc,
15848            self.buf.as_ptr() as usize,
15849        ))
15850    }
15851    pub fn get_net_detect(&self) -> Result<(), ErrorContext> {
15852        let mut iter = self.clone();
15853        iter.pos = 0;
15854        for attr in iter {
15855            if let WowlanTriggersAttrs::NetDetect(val) = attr? {
15856                return Ok(val);
15857            }
15858        }
15859        Err(ErrorContext::new_missing(
15860            "WowlanTriggersAttrs",
15861            "NetDetect",
15862            self.orig_loc,
15863            self.buf.as_ptr() as usize,
15864        ))
15865    }
15866    pub fn get_net_detect_results(&self) -> Result<(), ErrorContext> {
15867        let mut iter = self.clone();
15868        iter.pos = 0;
15869        for attr in iter {
15870            if let WowlanTriggersAttrs::NetDetectResults(val) = attr? {
15871                return Ok(val);
15872            }
15873        }
15874        Err(ErrorContext::new_missing(
15875            "WowlanTriggersAttrs",
15876            "NetDetectResults",
15877            self.orig_loc,
15878            self.buf.as_ptr() as usize,
15879        ))
15880    }
15881    pub fn get_unprotected_deauth_disassoc(&self) -> Result<(), ErrorContext> {
15882        let mut iter = self.clone();
15883        iter.pos = 0;
15884        for attr in iter {
15885            if let WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) = attr? {
15886                return Ok(val);
15887            }
15888        }
15889        Err(ErrorContext::new_missing(
15890            "WowlanTriggersAttrs",
15891            "UnprotectedDeauthDisassoc",
15892            self.orig_loc,
15893            self.buf.as_ptr() as usize,
15894        ))
15895    }
15896}
15897impl WowlanTriggersAttrs {
15898    pub fn new<'a>(buf: &'a [u8]) -> IterableWowlanTriggersAttrs<'a> {
15899        IterableWowlanTriggersAttrs::with_loc(buf, buf.as_ptr() as usize)
15900    }
15901    fn attr_from_type(r#type: u16) -> Option<&'static str> {
15902        let res = match r#type {
15903            1u16 => "Any",
15904            2u16 => "Disconnect",
15905            3u16 => "MagicPkt",
15906            4u16 => "PktPattern",
15907            5u16 => "GtkRekeySupported",
15908            6u16 => "GtkRekeyFailure",
15909            7u16 => "EapIdentRequest",
15910            8u16 => "4wayHandshake",
15911            9u16 => "RfkillRelease",
15912            10u16 => "WakeupPkt80211",
15913            11u16 => "WakeupPkt80211Len",
15914            12u16 => "WakeupPkt8023",
15915            13u16 => "WakeupPkt8023Len",
15916            14u16 => "TcpConnection",
15917            15u16 => "WakeupTcpMatch",
15918            16u16 => "WakeupTcpConnlost",
15919            17u16 => "WakeupTcpNomoretokens",
15920            18u16 => "NetDetect",
15921            19u16 => "NetDetectResults",
15922            20u16 => "UnprotectedDeauthDisassoc",
15923            _ => return None,
15924        };
15925        Some(res)
15926    }
15927}
15928#[derive(Clone, Copy, Default)]
15929pub struct IterableWowlanTriggersAttrs<'a> {
15930    buf: &'a [u8],
15931    pos: usize,
15932    orig_loc: usize,
15933}
15934impl<'a> IterableWowlanTriggersAttrs<'a> {
15935    fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
15936        Self {
15937            buf,
15938            pos: 0,
15939            orig_loc,
15940        }
15941    }
15942    pub fn get_buf(&self) -> &'a [u8] {
15943        self.buf
15944    }
15945}
15946impl<'a> Iterator for IterableWowlanTriggersAttrs<'a> {
15947    type Item = Result<WowlanTriggersAttrs, ErrorContext>;
15948    fn next(&mut self) -> Option<Self::Item> {
15949        let pos = self.pos;
15950        let mut r#type;
15951        loop {
15952            r#type = None;
15953            if self.buf.len() == self.pos {
15954                return None;
15955            }
15956            let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
15957                break;
15958            };
15959            r#type = Some(header.r#type);
15960            let res = match header.r#type {
15961                1u16 => WowlanTriggersAttrs::Any(()),
15962                2u16 => WowlanTriggersAttrs::Disconnect(()),
15963                3u16 => WowlanTriggersAttrs::MagicPkt(()),
15964                4u16 => WowlanTriggersAttrs::PktPattern(()),
15965                5u16 => WowlanTriggersAttrs::GtkRekeySupported(()),
15966                6u16 => WowlanTriggersAttrs::GtkRekeyFailure(()),
15967                7u16 => WowlanTriggersAttrs::EapIdentRequest(()),
15968                8u16 => WowlanTriggersAttrs::_4wayHandshake(()),
15969                9u16 => WowlanTriggersAttrs::RfkillRelease(()),
15970                10u16 => WowlanTriggersAttrs::WakeupPkt80211(()),
15971                11u16 => WowlanTriggersAttrs::WakeupPkt80211Len(()),
15972                12u16 => WowlanTriggersAttrs::WakeupPkt8023(()),
15973                13u16 => WowlanTriggersAttrs::WakeupPkt8023Len(()),
15974                14u16 => WowlanTriggersAttrs::TcpConnection(()),
15975                15u16 => WowlanTriggersAttrs::WakeupTcpMatch(()),
15976                16u16 => WowlanTriggersAttrs::WakeupTcpConnlost(()),
15977                17u16 => WowlanTriggersAttrs::WakeupTcpNomoretokens(()),
15978                18u16 => WowlanTriggersAttrs::NetDetect(()),
15979                19u16 => WowlanTriggersAttrs::NetDetectResults(()),
15980                20u16 => WowlanTriggersAttrs::UnprotectedDeauthDisassoc(()),
15981                n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
15982                n => continue,
15983            };
15984            return Some(Ok(res));
15985        }
15986        Some(Err(ErrorContext::new(
15987            "WowlanTriggersAttrs",
15988            r#type.and_then(|t| WowlanTriggersAttrs::attr_from_type(t)),
15989            self.orig_loc,
15990            self.buf.as_ptr().wrapping_add(pos) as usize,
15991        )))
15992    }
15993}
15994impl std::fmt::Debug for IterableWowlanTriggersAttrs<'_> {
15995    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15996        let mut fmt = f.debug_struct("WowlanTriggersAttrs");
15997        for attr in self.clone() {
15998            let attr = match attr {
15999                Ok(a) => a,
16000                Err(err) => {
16001                    fmt.finish()?;
16002                    f.write_str("Err(")?;
16003                    err.fmt(f)?;
16004                    return f.write_str(")");
16005                }
16006            };
16007            match attr {
16008                WowlanTriggersAttrs::Any(val) => fmt.field("Any", &val),
16009                WowlanTriggersAttrs::Disconnect(val) => fmt.field("Disconnect", &val),
16010                WowlanTriggersAttrs::MagicPkt(val) => fmt.field("MagicPkt", &val),
16011                WowlanTriggersAttrs::PktPattern(val) => fmt.field("PktPattern", &val),
16012                WowlanTriggersAttrs::GtkRekeySupported(val) => fmt.field("GtkRekeySupported", &val),
16013                WowlanTriggersAttrs::GtkRekeyFailure(val) => fmt.field("GtkRekeyFailure", &val),
16014                WowlanTriggersAttrs::EapIdentRequest(val) => fmt.field("EapIdentRequest", &val),
16015                WowlanTriggersAttrs::_4wayHandshake(val) => fmt.field("_4wayHandshake", &val),
16016                WowlanTriggersAttrs::RfkillRelease(val) => fmt.field("RfkillRelease", &val),
16017                WowlanTriggersAttrs::WakeupPkt80211(val) => fmt.field("WakeupPkt80211", &val),
16018                WowlanTriggersAttrs::WakeupPkt80211Len(val) => fmt.field("WakeupPkt80211Len", &val),
16019                WowlanTriggersAttrs::WakeupPkt8023(val) => fmt.field("WakeupPkt8023", &val),
16020                WowlanTriggersAttrs::WakeupPkt8023Len(val) => fmt.field("WakeupPkt8023Len", &val),
16021                WowlanTriggersAttrs::TcpConnection(val) => fmt.field("TcpConnection", &val),
16022                WowlanTriggersAttrs::WakeupTcpMatch(val) => fmt.field("WakeupTcpMatch", &val),
16023                WowlanTriggersAttrs::WakeupTcpConnlost(val) => fmt.field("WakeupTcpConnlost", &val),
16024                WowlanTriggersAttrs::WakeupTcpNomoretokens(val) => {
16025                    fmt.field("WakeupTcpNomoretokens", &val)
16026                }
16027                WowlanTriggersAttrs::NetDetect(val) => fmt.field("NetDetect", &val),
16028                WowlanTriggersAttrs::NetDetectResults(val) => fmt.field("NetDetectResults", &val),
16029                WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) => {
16030                    fmt.field("UnprotectedDeauthDisassoc", &val)
16031                }
16032            };
16033        }
16034        fmt.finish()
16035    }
16036}
16037impl IterableWowlanTriggersAttrs<'_> {
16038    pub fn lookup_attr(
16039        &self,
16040        offset: usize,
16041        missing_type: Option<u16>,
16042    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
16043        let mut stack = Vec::new();
16044        let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
16045        if cur == offset {
16046            stack.push(("WowlanTriggersAttrs", offset));
16047            return (
16048                stack,
16049                missing_type.and_then(|t| WowlanTriggersAttrs::attr_from_type(t)),
16050            );
16051        }
16052        if cur > offset || cur + self.buf.len() < offset {
16053            return (stack, None);
16054        }
16055        let mut attrs = self.clone();
16056        let mut last_off = cur + attrs.pos;
16057        while let Some(attr) = attrs.next() {
16058            let Ok(attr) = attr else { break };
16059            match attr {
16060                WowlanTriggersAttrs::Any(val) => {
16061                    if last_off == offset {
16062                        stack.push(("Any", last_off));
16063                        break;
16064                    }
16065                }
16066                WowlanTriggersAttrs::Disconnect(val) => {
16067                    if last_off == offset {
16068                        stack.push(("Disconnect", last_off));
16069                        break;
16070                    }
16071                }
16072                WowlanTriggersAttrs::MagicPkt(val) => {
16073                    if last_off == offset {
16074                        stack.push(("MagicPkt", last_off));
16075                        break;
16076                    }
16077                }
16078                WowlanTriggersAttrs::PktPattern(val) => {
16079                    if last_off == offset {
16080                        stack.push(("PktPattern", last_off));
16081                        break;
16082                    }
16083                }
16084                WowlanTriggersAttrs::GtkRekeySupported(val) => {
16085                    if last_off == offset {
16086                        stack.push(("GtkRekeySupported", last_off));
16087                        break;
16088                    }
16089                }
16090                WowlanTriggersAttrs::GtkRekeyFailure(val) => {
16091                    if last_off == offset {
16092                        stack.push(("GtkRekeyFailure", last_off));
16093                        break;
16094                    }
16095                }
16096                WowlanTriggersAttrs::EapIdentRequest(val) => {
16097                    if last_off == offset {
16098                        stack.push(("EapIdentRequest", last_off));
16099                        break;
16100                    }
16101                }
16102                WowlanTriggersAttrs::_4wayHandshake(val) => {
16103                    if last_off == offset {
16104                        stack.push(("4wayHandshake", last_off));
16105                        break;
16106                    }
16107                }
16108                WowlanTriggersAttrs::RfkillRelease(val) => {
16109                    if last_off == offset {
16110                        stack.push(("RfkillRelease", last_off));
16111                        break;
16112                    }
16113                }
16114                WowlanTriggersAttrs::WakeupPkt80211(val) => {
16115                    if last_off == offset {
16116                        stack.push(("WakeupPkt80211", last_off));
16117                        break;
16118                    }
16119                }
16120                WowlanTriggersAttrs::WakeupPkt80211Len(val) => {
16121                    if last_off == offset {
16122                        stack.push(("WakeupPkt80211Len", last_off));
16123                        break;
16124                    }
16125                }
16126                WowlanTriggersAttrs::WakeupPkt8023(val) => {
16127                    if last_off == offset {
16128                        stack.push(("WakeupPkt8023", last_off));
16129                        break;
16130                    }
16131                }
16132                WowlanTriggersAttrs::WakeupPkt8023Len(val) => {
16133                    if last_off == offset {
16134                        stack.push(("WakeupPkt8023Len", last_off));
16135                        break;
16136                    }
16137                }
16138                WowlanTriggersAttrs::TcpConnection(val) => {
16139                    if last_off == offset {
16140                        stack.push(("TcpConnection", last_off));
16141                        break;
16142                    }
16143                }
16144                WowlanTriggersAttrs::WakeupTcpMatch(val) => {
16145                    if last_off == offset {
16146                        stack.push(("WakeupTcpMatch", last_off));
16147                        break;
16148                    }
16149                }
16150                WowlanTriggersAttrs::WakeupTcpConnlost(val) => {
16151                    if last_off == offset {
16152                        stack.push(("WakeupTcpConnlost", last_off));
16153                        break;
16154                    }
16155                }
16156                WowlanTriggersAttrs::WakeupTcpNomoretokens(val) => {
16157                    if last_off == offset {
16158                        stack.push(("WakeupTcpNomoretokens", last_off));
16159                        break;
16160                    }
16161                }
16162                WowlanTriggersAttrs::NetDetect(val) => {
16163                    if last_off == offset {
16164                        stack.push(("NetDetect", last_off));
16165                        break;
16166                    }
16167                }
16168                WowlanTriggersAttrs::NetDetectResults(val) => {
16169                    if last_off == offset {
16170                        stack.push(("NetDetectResults", last_off));
16171                        break;
16172                    }
16173                }
16174                WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) => {
16175                    if last_off == offset {
16176                        stack.push(("UnprotectedDeauthDisassoc", last_off));
16177                        break;
16178                    }
16179                }
16180                _ => {}
16181            };
16182            last_off = cur + attrs.pos;
16183        }
16184        if !stack.is_empty() {
16185            stack.push(("WowlanTriggersAttrs", cur));
16186        }
16187        (stack, None)
16188    }
16189}
16190pub struct PushNl80211Attrs<Prev: Rec> {
16191    pub(crate) prev: Option<Prev>,
16192    pub(crate) header_offset: Option<usize>,
16193}
16194impl<Prev: Rec> Rec for PushNl80211Attrs<Prev> {
16195    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
16196        self.prev.as_mut().unwrap().as_rec_mut()
16197    }
16198    fn as_rec(&self) -> &Vec<u8> {
16199        self.prev.as_ref().unwrap().as_rec()
16200    }
16201}
16202pub struct PushArrayU32<Prev: Rec> {
16203    pub(crate) prev: Option<Prev>,
16204    pub(crate) header_offset: Option<usize>,
16205    pub(crate) counter: u16,
16206}
16207impl<Prev: Rec> Rec for PushArrayU32<Prev> {
16208    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
16209        self.prev.as_mut().unwrap().as_rec_mut()
16210    }
16211    fn as_rec(&self) -> &Vec<u8> {
16212        self.prev.as_ref().unwrap().as_rec()
16213    }
16214}
16215impl<Prev: Rec> PushArrayU32<Prev> {
16216    pub fn new(prev: Prev) -> Self {
16217        Self {
16218            prev: Some(prev),
16219            header_offset: None,
16220            counter: 0,
16221        }
16222    }
16223    pub fn end_array(mut self) -> Prev {
16224        let mut prev = self.prev.take().unwrap();
16225        if let Some(header_offset) = &self.header_offset {
16226            finalize_nested_header(prev.as_rec_mut(), *header_offset);
16227        }
16228        prev
16229    }
16230    pub fn entry(mut self, value: u32) -> Self {
16231        let index = self.counter;
16232        self.counter += 1;
16233        push_header(self.as_rec_mut(), index, 4 as u16);
16234        self.as_rec_mut().extend(value.to_ne_bytes());
16235        self
16236    }
16237}
16238impl<Prev: Rec> Drop for PushArrayU32<Prev> {
16239    fn drop(&mut self) {
16240        if let Some(prev) = &mut self.prev {
16241            if let Some(header_offset) = &self.header_offset {
16242                finalize_nested_header(prev.as_rec_mut(), *header_offset);
16243            }
16244        }
16245    }
16246}
16247pub struct PushArrayIfCombinationAttributes<Prev: Rec> {
16248    pub(crate) prev: Option<Prev>,
16249    pub(crate) header_offset: Option<usize>,
16250    pub(crate) counter: u16,
16251}
16252impl<Prev: Rec> Rec for PushArrayIfCombinationAttributes<Prev> {
16253    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
16254        self.prev.as_mut().unwrap().as_rec_mut()
16255    }
16256    fn as_rec(&self) -> &Vec<u8> {
16257        self.prev.as_ref().unwrap().as_rec()
16258    }
16259}
16260impl<Prev: Rec> PushArrayIfCombinationAttributes<Prev> {
16261    pub fn new(prev: Prev) -> Self {
16262        Self {
16263            prev: Some(prev),
16264            header_offset: None,
16265            counter: 0,
16266        }
16267    }
16268    pub fn end_array(mut self) -> Prev {
16269        let mut prev = self.prev.take().unwrap();
16270        if let Some(header_offset) = &self.header_offset {
16271            finalize_nested_header(prev.as_rec_mut(), *header_offset);
16272        }
16273        prev
16274    }
16275    pub fn entry_nested(mut self) -> PushIfCombinationAttributes<Self> {
16276        let index = self.counter;
16277        self.counter += 1;
16278        let header_offset = push_nested_header(self.as_rec_mut(), index);
16279        PushIfCombinationAttributes {
16280            prev: Some(self),
16281            header_offset: Some(header_offset),
16282        }
16283    }
16284}
16285impl<Prev: Rec> Drop for PushArrayIfCombinationAttributes<Prev> {
16286    fn drop(&mut self) {
16287        if let Some(prev) = &mut self.prev {
16288            if let Some(header_offset) = &self.header_offset {
16289                finalize_nested_header(prev.as_rec_mut(), *header_offset);
16290            }
16291        }
16292    }
16293}
16294impl<Prev: Rec> PushNl80211Attrs<Prev> {
16295    pub fn new(prev: Prev) -> Self {
16296        Self {
16297            prev: Some(prev),
16298            header_offset: None,
16299        }
16300    }
16301    pub fn end_nested(mut self) -> Prev {
16302        let mut prev = self.prev.take().unwrap();
16303        if let Some(header_offset) = &self.header_offset {
16304            finalize_nested_header(prev.as_rec_mut(), *header_offset);
16305        }
16306        prev
16307    }
16308    pub fn push_wiphy(mut self, value: u32) -> Self {
16309        push_header(self.as_rec_mut(), 1u16, 4 as u16);
16310        self.as_rec_mut().extend(value.to_ne_bytes());
16311        self
16312    }
16313    pub fn push_wiphy_name(mut self, value: &CStr) -> Self {
16314        push_header(
16315            self.as_rec_mut(),
16316            2u16,
16317            value.to_bytes_with_nul().len() as u16,
16318        );
16319        self.as_rec_mut().extend(value.to_bytes_with_nul());
16320        self
16321    }
16322    pub fn push_wiphy_name_bytes(mut self, value: &[u8]) -> Self {
16323        push_header(self.as_rec_mut(), 2u16, (value.len() + 1) as u16);
16324        self.as_rec_mut().extend(value);
16325        self.as_rec_mut().push(0);
16326        self
16327    }
16328    pub fn push_ifindex(mut self, value: u32) -> Self {
16329        push_header(self.as_rec_mut(), 3u16, 4 as u16);
16330        self.as_rec_mut().extend(value.to_ne_bytes());
16331        self
16332    }
16333    pub fn push_ifname(mut self, value: &CStr) -> Self {
16334        push_header(
16335            self.as_rec_mut(),
16336            4u16,
16337            value.to_bytes_with_nul().len() as u16,
16338        );
16339        self.as_rec_mut().extend(value.to_bytes_with_nul());
16340        self
16341    }
16342    pub fn push_ifname_bytes(mut self, value: &[u8]) -> Self {
16343        push_header(self.as_rec_mut(), 4u16, (value.len() + 1) as u16);
16344        self.as_rec_mut().extend(value);
16345        self.as_rec_mut().push(0);
16346        self
16347    }
16348    pub fn push_iftype(mut self, value: u32) -> Self {
16349        push_header(self.as_rec_mut(), 5u16, 4 as u16);
16350        self.as_rec_mut().extend(value.to_ne_bytes());
16351        self
16352    }
16353    pub fn push_mac(mut self, value: &[u8]) -> Self {
16354        push_header(self.as_rec_mut(), 6u16, value.len() as u16);
16355        self.as_rec_mut().extend(value);
16356        self
16357    }
16358    pub fn push_key_data(mut self, value: &[u8]) -> Self {
16359        push_header(self.as_rec_mut(), 7u16, value.len() as u16);
16360        self.as_rec_mut().extend(value);
16361        self
16362    }
16363    pub fn push_key_idx(mut self, value: u8) -> Self {
16364        push_header(self.as_rec_mut(), 8u16, 1 as u16);
16365        self.as_rec_mut().extend(value.to_ne_bytes());
16366        self
16367    }
16368    pub fn push_key_cipher(mut self, value: u32) -> Self {
16369        push_header(self.as_rec_mut(), 9u16, 4 as u16);
16370        self.as_rec_mut().extend(value.to_ne_bytes());
16371        self
16372    }
16373    pub fn push_key_seq(mut self, value: &[u8]) -> Self {
16374        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
16375        self.as_rec_mut().extend(value);
16376        self
16377    }
16378    pub fn push_key_default(mut self, value: ()) -> Self {
16379        push_header(self.as_rec_mut(), 11u16, 0 as u16);
16380        self
16381    }
16382    pub fn push_beacon_interval(mut self, value: u32) -> Self {
16383        push_header(self.as_rec_mut(), 12u16, 4 as u16);
16384        self.as_rec_mut().extend(value.to_ne_bytes());
16385        self
16386    }
16387    pub fn push_dtim_period(mut self, value: u32) -> Self {
16388        push_header(self.as_rec_mut(), 13u16, 4 as u16);
16389        self.as_rec_mut().extend(value.to_ne_bytes());
16390        self
16391    }
16392    pub fn push_beacon_head(mut self, value: &[u8]) -> Self {
16393        push_header(self.as_rec_mut(), 14u16, value.len() as u16);
16394        self.as_rec_mut().extend(value);
16395        self
16396    }
16397    pub fn push_beacon_tail(mut self, value: &[u8]) -> Self {
16398        push_header(self.as_rec_mut(), 15u16, value.len() as u16);
16399        self.as_rec_mut().extend(value);
16400        self
16401    }
16402    pub fn push_sta_aid(mut self, value: u16) -> Self {
16403        push_header(self.as_rec_mut(), 16u16, 2 as u16);
16404        self.as_rec_mut().extend(value.to_ne_bytes());
16405        self
16406    }
16407    pub fn push_sta_flags(mut self, value: &[u8]) -> Self {
16408        push_header(self.as_rec_mut(), 17u16, value.len() as u16);
16409        self.as_rec_mut().extend(value);
16410        self
16411    }
16412    pub fn push_sta_listen_interval(mut self, value: u16) -> Self {
16413        push_header(self.as_rec_mut(), 18u16, 2 as u16);
16414        self.as_rec_mut().extend(value.to_ne_bytes());
16415        self
16416    }
16417    pub fn push_sta_supported_rates(mut self, value: &[u8]) -> Self {
16418        push_header(self.as_rec_mut(), 19u16, value.len() as u16);
16419        self.as_rec_mut().extend(value);
16420        self
16421    }
16422    pub fn push_sta_vlan(mut self, value: u32) -> Self {
16423        push_header(self.as_rec_mut(), 20u16, 4 as u16);
16424        self.as_rec_mut().extend(value.to_ne_bytes());
16425        self
16426    }
16427    pub fn push_sta_info(mut self, value: &[u8]) -> Self {
16428        push_header(self.as_rec_mut(), 21u16, value.len() as u16);
16429        self.as_rec_mut().extend(value);
16430        self
16431    }
16432    pub fn nested_wiphy_bands(mut self) -> PushWiphyBands<Self> {
16433        let header_offset = push_nested_header(self.as_rec_mut(), 22u16);
16434        PushWiphyBands {
16435            prev: Some(self),
16436            header_offset: Some(header_offset),
16437        }
16438    }
16439    pub fn push_mntr_flags(mut self, value: &[u8]) -> Self {
16440        push_header(self.as_rec_mut(), 23u16, value.len() as u16);
16441        self.as_rec_mut().extend(value);
16442        self
16443    }
16444    pub fn push_mesh_id(mut self, value: &[u8]) -> Self {
16445        push_header(self.as_rec_mut(), 24u16, value.len() as u16);
16446        self.as_rec_mut().extend(value);
16447        self
16448    }
16449    pub fn push_sta_plink_action(mut self, value: u8) -> Self {
16450        push_header(self.as_rec_mut(), 25u16, 1 as u16);
16451        self.as_rec_mut().extend(value.to_ne_bytes());
16452        self
16453    }
16454    pub fn push_mpath_next_hop(mut self, value: &[u8]) -> Self {
16455        push_header(self.as_rec_mut(), 26u16, value.len() as u16);
16456        self.as_rec_mut().extend(value);
16457        self
16458    }
16459    pub fn push_mpath_info(mut self, value: &[u8]) -> Self {
16460        push_header(self.as_rec_mut(), 27u16, value.len() as u16);
16461        self.as_rec_mut().extend(value);
16462        self
16463    }
16464    pub fn push_bss_cts_prot(mut self, value: u8) -> Self {
16465        push_header(self.as_rec_mut(), 28u16, 1 as u16);
16466        self.as_rec_mut().extend(value.to_ne_bytes());
16467        self
16468    }
16469    pub fn push_bss_short_preamble(mut self, value: u8) -> Self {
16470        push_header(self.as_rec_mut(), 29u16, 1 as u16);
16471        self.as_rec_mut().extend(value.to_ne_bytes());
16472        self
16473    }
16474    pub fn push_bss_short_slot_time(mut self, value: u8) -> Self {
16475        push_header(self.as_rec_mut(), 30u16, 1 as u16);
16476        self.as_rec_mut().extend(value.to_ne_bytes());
16477        self
16478    }
16479    pub fn push_ht_capability(mut self, value: &[u8]) -> Self {
16480        push_header(self.as_rec_mut(), 31u16, value.len() as u16);
16481        self.as_rec_mut().extend(value);
16482        self
16483    }
16484    pub fn nested_supported_iftypes(mut self) -> PushSupportedIftypes<Self> {
16485        let header_offset = push_nested_header(self.as_rec_mut(), 32u16);
16486        PushSupportedIftypes {
16487            prev: Some(self),
16488            header_offset: Some(header_offset),
16489        }
16490    }
16491    pub fn push_reg_alpha2(mut self, value: &[u8]) -> Self {
16492        push_header(self.as_rec_mut(), 33u16, value.len() as u16);
16493        self.as_rec_mut().extend(value);
16494        self
16495    }
16496    pub fn push_reg_rules(mut self, value: &[u8]) -> Self {
16497        push_header(self.as_rec_mut(), 34u16, value.len() as u16);
16498        self.as_rec_mut().extend(value);
16499        self
16500    }
16501    pub fn push_mesh_config(mut self, value: &[u8]) -> Self {
16502        push_header(self.as_rec_mut(), 35u16, value.len() as u16);
16503        self.as_rec_mut().extend(value);
16504        self
16505    }
16506    pub fn push_bss_basic_rates(mut self, value: &[u8]) -> Self {
16507        push_header(self.as_rec_mut(), 36u16, value.len() as u16);
16508        self.as_rec_mut().extend(value);
16509        self
16510    }
16511    pub fn push_wiphy_txq_params(mut self, value: &[u8]) -> Self {
16512        push_header(self.as_rec_mut(), 37u16, value.len() as u16);
16513        self.as_rec_mut().extend(value);
16514        self
16515    }
16516    pub fn push_wiphy_freq(mut self, value: u32) -> Self {
16517        push_header(self.as_rec_mut(), 38u16, 4 as u16);
16518        self.as_rec_mut().extend(value.to_ne_bytes());
16519        self
16520    }
16521    #[doc = "Associated type: \"ChannelType\" (enum)"]
16522    pub fn push_wiphy_channel_type(mut self, value: u32) -> Self {
16523        push_header(self.as_rec_mut(), 39u16, 4 as u16);
16524        self.as_rec_mut().extend(value.to_ne_bytes());
16525        self
16526    }
16527    pub fn push_key_default_mgmt(mut self, value: ()) -> Self {
16528        push_header(self.as_rec_mut(), 40u16, 0 as u16);
16529        self
16530    }
16531    pub fn push_mgmt_subtype(mut self, value: u8) -> Self {
16532        push_header(self.as_rec_mut(), 41u16, 1 as u16);
16533        self.as_rec_mut().extend(value.to_ne_bytes());
16534        self
16535    }
16536    pub fn push_ie(mut self, value: &[u8]) -> Self {
16537        push_header(self.as_rec_mut(), 42u16, value.len() as u16);
16538        self.as_rec_mut().extend(value);
16539        self
16540    }
16541    pub fn push_max_num_scan_ssids(mut self, value: u8) -> Self {
16542        push_header(self.as_rec_mut(), 43u16, 1 as u16);
16543        self.as_rec_mut().extend(value.to_ne_bytes());
16544        self
16545    }
16546    pub fn push_scan_frequencies(mut self, value: &[u8]) -> Self {
16547        push_header(self.as_rec_mut(), 44u16, value.len() as u16);
16548        self.as_rec_mut().extend(value);
16549        self
16550    }
16551    pub fn push_scan_ssids(mut self, value: &[u8]) -> Self {
16552        push_header(self.as_rec_mut(), 45u16, value.len() as u16);
16553        self.as_rec_mut().extend(value);
16554        self
16555    }
16556    pub fn push_generation(mut self, value: u32) -> Self {
16557        push_header(self.as_rec_mut(), 46u16, 4 as u16);
16558        self.as_rec_mut().extend(value.to_ne_bytes());
16559        self
16560    }
16561    pub fn push_bss(mut self, value: &[u8]) -> Self {
16562        push_header(self.as_rec_mut(), 47u16, value.len() as u16);
16563        self.as_rec_mut().extend(value);
16564        self
16565    }
16566    pub fn push_reg_initiator(mut self, value: u8) -> Self {
16567        push_header(self.as_rec_mut(), 48u16, 1 as u16);
16568        self.as_rec_mut().extend(value.to_ne_bytes());
16569        self
16570    }
16571    pub fn push_reg_type(mut self, value: u8) -> Self {
16572        push_header(self.as_rec_mut(), 49u16, 1 as u16);
16573        self.as_rec_mut().extend(value.to_ne_bytes());
16574        self
16575    }
16576    #[doc = "Associated type: \"Commands\" (enum)"]
16577    pub fn array_supported_commands(mut self) -> PushArrayU32<Self> {
16578        let header_offset = push_nested_header(self.as_rec_mut(), 50u16);
16579        PushArrayU32 {
16580            prev: Some(self),
16581            header_offset: Some(header_offset),
16582            counter: 0,
16583        }
16584    }
16585    pub fn push_frame(mut self, value: &[u8]) -> Self {
16586        push_header(self.as_rec_mut(), 51u16, value.len() as u16);
16587        self.as_rec_mut().extend(value);
16588        self
16589    }
16590    pub fn push_ssid(mut self, value: &[u8]) -> Self {
16591        push_header(self.as_rec_mut(), 52u16, value.len() as u16);
16592        self.as_rec_mut().extend(value);
16593        self
16594    }
16595    pub fn push_auth_type(mut self, value: u32) -> Self {
16596        push_header(self.as_rec_mut(), 53u16, 4 as u16);
16597        self.as_rec_mut().extend(value.to_ne_bytes());
16598        self
16599    }
16600    pub fn push_reason_code(mut self, value: u16) -> Self {
16601        push_header(self.as_rec_mut(), 54u16, 2 as u16);
16602        self.as_rec_mut().extend(value.to_ne_bytes());
16603        self
16604    }
16605    pub fn push_key_type(mut self, value: u32) -> Self {
16606        push_header(self.as_rec_mut(), 55u16, 4 as u16);
16607        self.as_rec_mut().extend(value.to_ne_bytes());
16608        self
16609    }
16610    pub fn push_max_scan_ie_len(mut self, value: u16) -> Self {
16611        push_header(self.as_rec_mut(), 56u16, 2 as u16);
16612        self.as_rec_mut().extend(value.to_ne_bytes());
16613        self
16614    }
16615    pub fn push_cipher_suites(mut self, value: &[u8]) -> Self {
16616        push_header(self.as_rec_mut(), 57u16, value.len() as u16);
16617        self.as_rec_mut().extend(value);
16618        self
16619    }
16620    pub fn push_freq_before(mut self, value: &[u8]) -> Self {
16621        push_header(self.as_rec_mut(), 58u16, value.len() as u16);
16622        self.as_rec_mut().extend(value);
16623        self
16624    }
16625    pub fn push_freq_after(mut self, value: &[u8]) -> Self {
16626        push_header(self.as_rec_mut(), 59u16, value.len() as u16);
16627        self.as_rec_mut().extend(value);
16628        self
16629    }
16630    pub fn push_freq_fixed(mut self, value: ()) -> Self {
16631        push_header(self.as_rec_mut(), 60u16, 0 as u16);
16632        self
16633    }
16634    pub fn push_wiphy_retry_short(mut self, value: u8) -> Self {
16635        push_header(self.as_rec_mut(), 61u16, 1 as u16);
16636        self.as_rec_mut().extend(value.to_ne_bytes());
16637        self
16638    }
16639    pub fn push_wiphy_retry_long(mut self, value: u8) -> Self {
16640        push_header(self.as_rec_mut(), 62u16, 1 as u16);
16641        self.as_rec_mut().extend(value.to_ne_bytes());
16642        self
16643    }
16644    pub fn push_wiphy_frag_threshold(mut self, value: u32) -> Self {
16645        push_header(self.as_rec_mut(), 63u16, 4 as u16);
16646        self.as_rec_mut().extend(value.to_ne_bytes());
16647        self
16648    }
16649    pub fn push_wiphy_rts_threshold(mut self, value: u32) -> Self {
16650        push_header(self.as_rec_mut(), 64u16, 4 as u16);
16651        self.as_rec_mut().extend(value.to_ne_bytes());
16652        self
16653    }
16654    pub fn push_timed_out(mut self, value: ()) -> Self {
16655        push_header(self.as_rec_mut(), 65u16, 0 as u16);
16656        self
16657    }
16658    pub fn push_use_mfp(mut self, value: u32) -> Self {
16659        push_header(self.as_rec_mut(), 66u16, 4 as u16);
16660        self.as_rec_mut().extend(value.to_ne_bytes());
16661        self
16662    }
16663    pub fn push_sta_flags2(mut self, value: PushStaFlagUpdate) -> Self {
16664        push_header(self.as_rec_mut(), 67u16, value.as_slice().len() as u16);
16665        self.as_rec_mut().extend(value.as_slice());
16666        self
16667    }
16668    pub fn push_control_port(mut self, value: ()) -> Self {
16669        push_header(self.as_rec_mut(), 68u16, 0 as u16);
16670        self
16671    }
16672    pub fn push_testdata(mut self, value: &[u8]) -> Self {
16673        push_header(self.as_rec_mut(), 69u16, value.len() as u16);
16674        self.as_rec_mut().extend(value);
16675        self
16676    }
16677    pub fn push_privacy(mut self, value: ()) -> Self {
16678        push_header(self.as_rec_mut(), 70u16, 0 as u16);
16679        self
16680    }
16681    pub fn push_disconnected_by_ap(mut self, value: ()) -> Self {
16682        push_header(self.as_rec_mut(), 71u16, 0 as u16);
16683        self
16684    }
16685    pub fn push_status_code(mut self, value: u16) -> Self {
16686        push_header(self.as_rec_mut(), 72u16, 2 as u16);
16687        self.as_rec_mut().extend(value.to_ne_bytes());
16688        self
16689    }
16690    pub fn push_cipher_suites_pairwise(mut self, value: &[u8]) -> Self {
16691        push_header(self.as_rec_mut(), 73u16, value.len() as u16);
16692        self.as_rec_mut().extend(value);
16693        self
16694    }
16695    pub fn push_cipher_suite_group(mut self, value: u32) -> Self {
16696        push_header(self.as_rec_mut(), 74u16, 4 as u16);
16697        self.as_rec_mut().extend(value.to_ne_bytes());
16698        self
16699    }
16700    pub fn push_wpa_versions(mut self, value: u32) -> Self {
16701        push_header(self.as_rec_mut(), 75u16, 4 as u16);
16702        self.as_rec_mut().extend(value.to_ne_bytes());
16703        self
16704    }
16705    pub fn push_akm_suites(mut self, value: &[u8]) -> Self {
16706        push_header(self.as_rec_mut(), 76u16, value.len() as u16);
16707        self.as_rec_mut().extend(value);
16708        self
16709    }
16710    pub fn push_req_ie(mut self, value: &[u8]) -> Self {
16711        push_header(self.as_rec_mut(), 77u16, value.len() as u16);
16712        self.as_rec_mut().extend(value);
16713        self
16714    }
16715    pub fn push_resp_ie(mut self, value: &[u8]) -> Self {
16716        push_header(self.as_rec_mut(), 78u16, value.len() as u16);
16717        self.as_rec_mut().extend(value);
16718        self
16719    }
16720    pub fn push_prev_bssid(mut self, value: &[u8]) -> Self {
16721        push_header(self.as_rec_mut(), 79u16, value.len() as u16);
16722        self.as_rec_mut().extend(value);
16723        self
16724    }
16725    pub fn push_key(mut self, value: &[u8]) -> Self {
16726        push_header(self.as_rec_mut(), 80u16, value.len() as u16);
16727        self.as_rec_mut().extend(value);
16728        self
16729    }
16730    pub fn push_keys(mut self, value: &[u8]) -> Self {
16731        push_header(self.as_rec_mut(), 81u16, value.len() as u16);
16732        self.as_rec_mut().extend(value);
16733        self
16734    }
16735    pub fn push_pid(mut self, value: u32) -> Self {
16736        push_header(self.as_rec_mut(), 82u16, 4 as u16);
16737        self.as_rec_mut().extend(value.to_ne_bytes());
16738        self
16739    }
16740    pub fn push_4addr(mut self, value: u8) -> Self {
16741        push_header(self.as_rec_mut(), 83u16, 1 as u16);
16742        self.as_rec_mut().extend(value.to_ne_bytes());
16743        self
16744    }
16745    pub fn push_survey_info(mut self, value: &[u8]) -> Self {
16746        push_header(self.as_rec_mut(), 84u16, value.len() as u16);
16747        self.as_rec_mut().extend(value);
16748        self
16749    }
16750    pub fn push_pmkid(mut self, value: &[u8]) -> Self {
16751        push_header(self.as_rec_mut(), 85u16, value.len() as u16);
16752        self.as_rec_mut().extend(value);
16753        self
16754    }
16755    pub fn push_max_num_pmkids(mut self, value: u8) -> Self {
16756        push_header(self.as_rec_mut(), 86u16, 1 as u16);
16757        self.as_rec_mut().extend(value.to_ne_bytes());
16758        self
16759    }
16760    pub fn push_duration(mut self, value: u32) -> Self {
16761        push_header(self.as_rec_mut(), 87u16, 4 as u16);
16762        self.as_rec_mut().extend(value.to_ne_bytes());
16763        self
16764    }
16765    pub fn push_cookie(mut self, value: u64) -> Self {
16766        push_header(self.as_rec_mut(), 88u16, 8 as u16);
16767        self.as_rec_mut().extend(value.to_ne_bytes());
16768        self
16769    }
16770    pub fn push_wiphy_coverage_class(mut self, value: u8) -> Self {
16771        push_header(self.as_rec_mut(), 89u16, 1 as u16);
16772        self.as_rec_mut().extend(value.to_ne_bytes());
16773        self
16774    }
16775    pub fn push_tx_rates(mut self, value: &[u8]) -> Self {
16776        push_header(self.as_rec_mut(), 90u16, value.len() as u16);
16777        self.as_rec_mut().extend(value);
16778        self
16779    }
16780    pub fn push_frame_match(mut self, value: &[u8]) -> Self {
16781        push_header(self.as_rec_mut(), 91u16, value.len() as u16);
16782        self.as_rec_mut().extend(value);
16783        self
16784    }
16785    pub fn push_ack(mut self, value: ()) -> Self {
16786        push_header(self.as_rec_mut(), 92u16, 0 as u16);
16787        self
16788    }
16789    pub fn push_ps_state(mut self, value: u32) -> Self {
16790        push_header(self.as_rec_mut(), 93u16, 4 as u16);
16791        self.as_rec_mut().extend(value.to_ne_bytes());
16792        self
16793    }
16794    pub fn push_cqm(mut self, value: &[u8]) -> Self {
16795        push_header(self.as_rec_mut(), 94u16, value.len() as u16);
16796        self.as_rec_mut().extend(value);
16797        self
16798    }
16799    pub fn push_local_state_change(mut self, value: ()) -> Self {
16800        push_header(self.as_rec_mut(), 95u16, 0 as u16);
16801        self
16802    }
16803    pub fn push_ap_isolate(mut self, value: u8) -> Self {
16804        push_header(self.as_rec_mut(), 96u16, 1 as u16);
16805        self.as_rec_mut().extend(value.to_ne_bytes());
16806        self
16807    }
16808    pub fn push_wiphy_tx_power_setting(mut self, value: u32) -> Self {
16809        push_header(self.as_rec_mut(), 97u16, 4 as u16);
16810        self.as_rec_mut().extend(value.to_ne_bytes());
16811        self
16812    }
16813    pub fn push_wiphy_tx_power_level(mut self, value: u32) -> Self {
16814        push_header(self.as_rec_mut(), 98u16, 4 as u16);
16815        self.as_rec_mut().extend(value.to_ne_bytes());
16816        self
16817    }
16818    pub fn nested_tx_frame_types(mut self) -> PushIftypeAttrs<Self> {
16819        let header_offset = push_nested_header(self.as_rec_mut(), 99u16);
16820        PushIftypeAttrs {
16821            prev: Some(self),
16822            header_offset: Some(header_offset),
16823        }
16824    }
16825    pub fn nested_rx_frame_types(mut self) -> PushIftypeAttrs<Self> {
16826        let header_offset = push_nested_header(self.as_rec_mut(), 100u16);
16827        PushIftypeAttrs {
16828            prev: Some(self),
16829            header_offset: Some(header_offset),
16830        }
16831    }
16832    pub fn push_frame_type(mut self, value: u16) -> Self {
16833        push_header(self.as_rec_mut(), 101u16, 2 as u16);
16834        self.as_rec_mut().extend(value.to_ne_bytes());
16835        self
16836    }
16837    pub fn push_control_port_ethertype(mut self, value: ()) -> Self {
16838        push_header(self.as_rec_mut(), 102u16, 0 as u16);
16839        self
16840    }
16841    pub fn push_control_port_no_encrypt(mut self, value: ()) -> Self {
16842        push_header(self.as_rec_mut(), 103u16, 0 as u16);
16843        self
16844    }
16845    pub fn push_support_ibss_rsn(mut self, value: ()) -> Self {
16846        push_header(self.as_rec_mut(), 104u16, 0 as u16);
16847        self
16848    }
16849    pub fn push_wiphy_antenna_tx(mut self, value: u32) -> Self {
16850        push_header(self.as_rec_mut(), 105u16, 4 as u16);
16851        self.as_rec_mut().extend(value.to_ne_bytes());
16852        self
16853    }
16854    pub fn push_wiphy_antenna_rx(mut self, value: u32) -> Self {
16855        push_header(self.as_rec_mut(), 106u16, 4 as u16);
16856        self.as_rec_mut().extend(value.to_ne_bytes());
16857        self
16858    }
16859    pub fn push_mcast_rate(mut self, value: u32) -> Self {
16860        push_header(self.as_rec_mut(), 107u16, 4 as u16);
16861        self.as_rec_mut().extend(value.to_ne_bytes());
16862        self
16863    }
16864    pub fn push_offchannel_tx_ok(mut self, value: ()) -> Self {
16865        push_header(self.as_rec_mut(), 108u16, 0 as u16);
16866        self
16867    }
16868    pub fn push_bss_ht_opmode(mut self, value: u16) -> Self {
16869        push_header(self.as_rec_mut(), 109u16, 2 as u16);
16870        self.as_rec_mut().extend(value.to_ne_bytes());
16871        self
16872    }
16873    pub fn push_key_default_types(mut self, value: &[u8]) -> Self {
16874        push_header(self.as_rec_mut(), 110u16, value.len() as u16);
16875        self.as_rec_mut().extend(value);
16876        self
16877    }
16878    pub fn push_max_remain_on_channel_duration(mut self, value: u32) -> Self {
16879        push_header(self.as_rec_mut(), 111u16, 4 as u16);
16880        self.as_rec_mut().extend(value.to_ne_bytes());
16881        self
16882    }
16883    pub fn push_mesh_setup(mut self, value: &[u8]) -> Self {
16884        push_header(self.as_rec_mut(), 112u16, value.len() as u16);
16885        self.as_rec_mut().extend(value);
16886        self
16887    }
16888    pub fn push_wiphy_antenna_avail_tx(mut self, value: u32) -> Self {
16889        push_header(self.as_rec_mut(), 113u16, 4 as u16);
16890        self.as_rec_mut().extend(value.to_ne_bytes());
16891        self
16892    }
16893    pub fn push_wiphy_antenna_avail_rx(mut self, value: u32) -> Self {
16894        push_header(self.as_rec_mut(), 114u16, 4 as u16);
16895        self.as_rec_mut().extend(value.to_ne_bytes());
16896        self
16897    }
16898    pub fn push_support_mesh_auth(mut self, value: ()) -> Self {
16899        push_header(self.as_rec_mut(), 115u16, 0 as u16);
16900        self
16901    }
16902    pub fn push_sta_plink_state(mut self, value: u8) -> Self {
16903        push_header(self.as_rec_mut(), 116u16, 1 as u16);
16904        self.as_rec_mut().extend(value.to_ne_bytes());
16905        self
16906    }
16907    pub fn push_wowlan_triggers(mut self, value: &[u8]) -> Self {
16908        push_header(self.as_rec_mut(), 117u16, value.len() as u16);
16909        self.as_rec_mut().extend(value);
16910        self
16911    }
16912    pub fn nested_wowlan_triggers_supported(mut self) -> PushWowlanTriggersAttrs<Self> {
16913        let header_offset = push_nested_header(self.as_rec_mut(), 118u16);
16914        PushWowlanTriggersAttrs {
16915            prev: Some(self),
16916            header_offset: Some(header_offset),
16917        }
16918    }
16919    pub fn push_sched_scan_interval(mut self, value: u32) -> Self {
16920        push_header(self.as_rec_mut(), 119u16, 4 as u16);
16921        self.as_rec_mut().extend(value.to_ne_bytes());
16922        self
16923    }
16924    pub fn array_interface_combinations(mut self) -> PushArrayIfCombinationAttributes<Self> {
16925        let header_offset = push_nested_header(self.as_rec_mut(), 120u16);
16926        PushArrayIfCombinationAttributes {
16927            prev: Some(self),
16928            header_offset: Some(header_offset),
16929            counter: 0,
16930        }
16931    }
16932    pub fn nested_software_iftypes(mut self) -> PushSupportedIftypes<Self> {
16933        let header_offset = push_nested_header(self.as_rec_mut(), 121u16);
16934        PushSupportedIftypes {
16935            prev: Some(self),
16936            header_offset: Some(header_offset),
16937        }
16938    }
16939    pub fn push_rekey_data(mut self, value: &[u8]) -> Self {
16940        push_header(self.as_rec_mut(), 122u16, value.len() as u16);
16941        self.as_rec_mut().extend(value);
16942        self
16943    }
16944    pub fn push_max_num_sched_scan_ssids(mut self, value: u8) -> Self {
16945        push_header(self.as_rec_mut(), 123u16, 1 as u16);
16946        self.as_rec_mut().extend(value.to_ne_bytes());
16947        self
16948    }
16949    pub fn push_max_sched_scan_ie_len(mut self, value: u16) -> Self {
16950        push_header(self.as_rec_mut(), 124u16, 2 as u16);
16951        self.as_rec_mut().extend(value.to_ne_bytes());
16952        self
16953    }
16954    pub fn push_scan_supp_rates(mut self, value: &[u8]) -> Self {
16955        push_header(self.as_rec_mut(), 125u16, value.len() as u16);
16956        self.as_rec_mut().extend(value);
16957        self
16958    }
16959    pub fn push_hidden_ssid(mut self, value: u32) -> Self {
16960        push_header(self.as_rec_mut(), 126u16, 4 as u16);
16961        self.as_rec_mut().extend(value.to_ne_bytes());
16962        self
16963    }
16964    pub fn push_ie_probe_resp(mut self, value: &[u8]) -> Self {
16965        push_header(self.as_rec_mut(), 127u16, value.len() as u16);
16966        self.as_rec_mut().extend(value);
16967        self
16968    }
16969    pub fn push_ie_assoc_resp(mut self, value: &[u8]) -> Self {
16970        push_header(self.as_rec_mut(), 128u16, value.len() as u16);
16971        self.as_rec_mut().extend(value);
16972        self
16973    }
16974    pub fn push_sta_wme(mut self, value: &[u8]) -> Self {
16975        push_header(self.as_rec_mut(), 129u16, value.len() as u16);
16976        self.as_rec_mut().extend(value);
16977        self
16978    }
16979    pub fn push_support_ap_uapsd(mut self, value: ()) -> Self {
16980        push_header(self.as_rec_mut(), 130u16, 0 as u16);
16981        self
16982    }
16983    pub fn push_roam_support(mut self, value: ()) -> Self {
16984        push_header(self.as_rec_mut(), 131u16, 0 as u16);
16985        self
16986    }
16987    pub fn push_sched_scan_match(mut self, value: &[u8]) -> Self {
16988        push_header(self.as_rec_mut(), 132u16, value.len() as u16);
16989        self.as_rec_mut().extend(value);
16990        self
16991    }
16992    pub fn push_max_match_sets(mut self, value: u8) -> Self {
16993        push_header(self.as_rec_mut(), 133u16, 1 as u16);
16994        self.as_rec_mut().extend(value.to_ne_bytes());
16995        self
16996    }
16997    pub fn push_pmksa_candidate(mut self, value: &[u8]) -> Self {
16998        push_header(self.as_rec_mut(), 134u16, value.len() as u16);
16999        self.as_rec_mut().extend(value);
17000        self
17001    }
17002    pub fn push_tx_no_cck_rate(mut self, value: ()) -> Self {
17003        push_header(self.as_rec_mut(), 135u16, 0 as u16);
17004        self
17005    }
17006    pub fn push_tdls_action(mut self, value: u8) -> Self {
17007        push_header(self.as_rec_mut(), 136u16, 1 as u16);
17008        self.as_rec_mut().extend(value.to_ne_bytes());
17009        self
17010    }
17011    pub fn push_tdls_dialog_token(mut self, value: u8) -> Self {
17012        push_header(self.as_rec_mut(), 137u16, 1 as u16);
17013        self.as_rec_mut().extend(value.to_ne_bytes());
17014        self
17015    }
17016    pub fn push_tdls_operation(mut self, value: u8) -> Self {
17017        push_header(self.as_rec_mut(), 138u16, 1 as u16);
17018        self.as_rec_mut().extend(value.to_ne_bytes());
17019        self
17020    }
17021    pub fn push_tdls_support(mut self, value: ()) -> Self {
17022        push_header(self.as_rec_mut(), 139u16, 0 as u16);
17023        self
17024    }
17025    pub fn push_tdls_external_setup(mut self, value: ()) -> Self {
17026        push_header(self.as_rec_mut(), 140u16, 0 as u16);
17027        self
17028    }
17029    pub fn push_device_ap_sme(mut self, value: u32) -> Self {
17030        push_header(self.as_rec_mut(), 141u16, 4 as u16);
17031        self.as_rec_mut().extend(value.to_ne_bytes());
17032        self
17033    }
17034    pub fn push_dont_wait_for_ack(mut self, value: ()) -> Self {
17035        push_header(self.as_rec_mut(), 142u16, 0 as u16);
17036        self
17037    }
17038    #[doc = "Associated type: \"FeatureFlags\" (1 bit per enumeration)"]
17039    pub fn push_feature_flags(mut self, value: u32) -> Self {
17040        push_header(self.as_rec_mut(), 143u16, 4 as u16);
17041        self.as_rec_mut().extend(value.to_ne_bytes());
17042        self
17043    }
17044    pub fn push_probe_resp_offload(mut self, value: u32) -> Self {
17045        push_header(self.as_rec_mut(), 144u16, 4 as u16);
17046        self.as_rec_mut().extend(value.to_ne_bytes());
17047        self
17048    }
17049    pub fn push_probe_resp(mut self, value: &[u8]) -> Self {
17050        push_header(self.as_rec_mut(), 145u16, value.len() as u16);
17051        self.as_rec_mut().extend(value);
17052        self
17053    }
17054    pub fn push_dfs_region(mut self, value: u8) -> Self {
17055        push_header(self.as_rec_mut(), 146u16, 1 as u16);
17056        self.as_rec_mut().extend(value.to_ne_bytes());
17057        self
17058    }
17059    pub fn push_disable_ht(mut self, value: ()) -> Self {
17060        push_header(self.as_rec_mut(), 147u16, 0 as u16);
17061        self
17062    }
17063    pub fn push_ht_capability_mask(mut self, value: &[u8]) -> Self {
17064        push_header(self.as_rec_mut(), 148u16, value.len() as u16);
17065        self.as_rec_mut().extend(value);
17066        self
17067    }
17068    pub fn push_noack_map(mut self, value: u16) -> Self {
17069        push_header(self.as_rec_mut(), 149u16, 2 as u16);
17070        self.as_rec_mut().extend(value.to_ne_bytes());
17071        self
17072    }
17073    pub fn push_inactivity_timeout(mut self, value: u16) -> Self {
17074        push_header(self.as_rec_mut(), 150u16, 2 as u16);
17075        self.as_rec_mut().extend(value.to_ne_bytes());
17076        self
17077    }
17078    pub fn push_rx_signal_dbm(mut self, value: u32) -> Self {
17079        push_header(self.as_rec_mut(), 151u16, 4 as u16);
17080        self.as_rec_mut().extend(value.to_ne_bytes());
17081        self
17082    }
17083    pub fn push_bg_scan_period(mut self, value: u16) -> Self {
17084        push_header(self.as_rec_mut(), 152u16, 2 as u16);
17085        self.as_rec_mut().extend(value.to_ne_bytes());
17086        self
17087    }
17088    pub fn push_wdev(mut self, value: u64) -> Self {
17089        push_header(self.as_rec_mut(), 153u16, 8 as u16);
17090        self.as_rec_mut().extend(value.to_ne_bytes());
17091        self
17092    }
17093    pub fn push_user_reg_hint_type(mut self, value: u32) -> Self {
17094        push_header(self.as_rec_mut(), 154u16, 4 as u16);
17095        self.as_rec_mut().extend(value.to_ne_bytes());
17096        self
17097    }
17098    pub fn push_conn_failed_reason(mut self, value: u32) -> Self {
17099        push_header(self.as_rec_mut(), 155u16, 4 as u16);
17100        self.as_rec_mut().extend(value.to_ne_bytes());
17101        self
17102    }
17103    pub fn push_auth_data(mut self, value: &[u8]) -> Self {
17104        push_header(self.as_rec_mut(), 156u16, value.len() as u16);
17105        self.as_rec_mut().extend(value);
17106        self
17107    }
17108    pub fn push_vht_capability(mut self, value: &[u8]) -> Self {
17109        push_header(self.as_rec_mut(), 157u16, value.len() as u16);
17110        self.as_rec_mut().extend(value);
17111        self
17112    }
17113    pub fn push_scan_flags(mut self, value: u32) -> Self {
17114        push_header(self.as_rec_mut(), 158u16, 4 as u16);
17115        self.as_rec_mut().extend(value.to_ne_bytes());
17116        self
17117    }
17118    pub fn push_channel_width(mut self, value: u32) -> Self {
17119        push_header(self.as_rec_mut(), 159u16, 4 as u16);
17120        self.as_rec_mut().extend(value.to_ne_bytes());
17121        self
17122    }
17123    pub fn push_center_freq1(mut self, value: u32) -> Self {
17124        push_header(self.as_rec_mut(), 160u16, 4 as u16);
17125        self.as_rec_mut().extend(value.to_ne_bytes());
17126        self
17127    }
17128    pub fn push_center_freq2(mut self, value: u32) -> Self {
17129        push_header(self.as_rec_mut(), 161u16, 4 as u16);
17130        self.as_rec_mut().extend(value.to_ne_bytes());
17131        self
17132    }
17133    pub fn push_p2p_ctwindow(mut self, value: u8) -> Self {
17134        push_header(self.as_rec_mut(), 162u16, 1 as u16);
17135        self.as_rec_mut().extend(value.to_ne_bytes());
17136        self
17137    }
17138    pub fn push_p2p_oppps(mut self, value: u8) -> Self {
17139        push_header(self.as_rec_mut(), 163u16, 1 as u16);
17140        self.as_rec_mut().extend(value.to_ne_bytes());
17141        self
17142    }
17143    pub fn push_local_mesh_power_mode(mut self, value: u32) -> Self {
17144        push_header(self.as_rec_mut(), 164u16, 4 as u16);
17145        self.as_rec_mut().extend(value.to_ne_bytes());
17146        self
17147    }
17148    pub fn push_acl_policy(mut self, value: u32) -> Self {
17149        push_header(self.as_rec_mut(), 165u16, 4 as u16);
17150        self.as_rec_mut().extend(value.to_ne_bytes());
17151        self
17152    }
17153    pub fn push_mac_addrs(mut self, value: &[u8]) -> Self {
17154        push_header(self.as_rec_mut(), 166u16, value.len() as u16);
17155        self.as_rec_mut().extend(value);
17156        self
17157    }
17158    pub fn push_mac_acl_max(mut self, value: u32) -> Self {
17159        push_header(self.as_rec_mut(), 167u16, 4 as u16);
17160        self.as_rec_mut().extend(value.to_ne_bytes());
17161        self
17162    }
17163    pub fn push_radar_event(mut self, value: u32) -> Self {
17164        push_header(self.as_rec_mut(), 168u16, 4 as u16);
17165        self.as_rec_mut().extend(value.to_ne_bytes());
17166        self
17167    }
17168    pub fn push_ext_capa(mut self, value: &[u8]) -> Self {
17169        push_header(self.as_rec_mut(), 169u16, value.len() as u16);
17170        self.as_rec_mut().extend(value);
17171        self
17172    }
17173    pub fn push_ext_capa_mask(mut self, value: &[u8]) -> Self {
17174        push_header(self.as_rec_mut(), 170u16, value.len() as u16);
17175        self.as_rec_mut().extend(value);
17176        self
17177    }
17178    pub fn push_sta_capability(mut self, value: u16) -> Self {
17179        push_header(self.as_rec_mut(), 171u16, 2 as u16);
17180        self.as_rec_mut().extend(value.to_ne_bytes());
17181        self
17182    }
17183    pub fn push_sta_ext_capability(mut self, value: &[u8]) -> Self {
17184        push_header(self.as_rec_mut(), 172u16, value.len() as u16);
17185        self.as_rec_mut().extend(value);
17186        self
17187    }
17188    #[doc = "Associated type: \"ProtocolFeatures\" (enum)"]
17189    pub fn push_protocol_features(mut self, value: u32) -> Self {
17190        push_header(self.as_rec_mut(), 173u16, 4 as u16);
17191        self.as_rec_mut().extend(value.to_ne_bytes());
17192        self
17193    }
17194    pub fn push_split_wiphy_dump(mut self, value: ()) -> Self {
17195        push_header(self.as_rec_mut(), 174u16, 0 as u16);
17196        self
17197    }
17198    pub fn push_disable_vht(mut self, value: ()) -> Self {
17199        push_header(self.as_rec_mut(), 175u16, 0 as u16);
17200        self
17201    }
17202    pub fn push_vht_capability_mask(mut self, value: &[u8]) -> Self {
17203        push_header(self.as_rec_mut(), 176u16, value.len() as u16);
17204        self.as_rec_mut().extend(value);
17205        self
17206    }
17207    pub fn push_mdid(mut self, value: u16) -> Self {
17208        push_header(self.as_rec_mut(), 177u16, 2 as u16);
17209        self.as_rec_mut().extend(value.to_ne_bytes());
17210        self
17211    }
17212    pub fn push_ie_ric(mut self, value: &[u8]) -> Self {
17213        push_header(self.as_rec_mut(), 178u16, value.len() as u16);
17214        self.as_rec_mut().extend(value);
17215        self
17216    }
17217    pub fn push_crit_prot_id(mut self, value: u16) -> Self {
17218        push_header(self.as_rec_mut(), 179u16, 2 as u16);
17219        self.as_rec_mut().extend(value.to_ne_bytes());
17220        self
17221    }
17222    pub fn push_max_crit_prot_duration(mut self, value: u16) -> Self {
17223        push_header(self.as_rec_mut(), 180u16, 2 as u16);
17224        self.as_rec_mut().extend(value.to_ne_bytes());
17225        self
17226    }
17227    pub fn push_peer_aid(mut self, value: u16) -> Self {
17228        push_header(self.as_rec_mut(), 181u16, 2 as u16);
17229        self.as_rec_mut().extend(value.to_ne_bytes());
17230        self
17231    }
17232    pub fn push_coalesce_rule(mut self, value: &[u8]) -> Self {
17233        push_header(self.as_rec_mut(), 182u16, value.len() as u16);
17234        self.as_rec_mut().extend(value);
17235        self
17236    }
17237    pub fn push_ch_switch_count(mut self, value: u32) -> Self {
17238        push_header(self.as_rec_mut(), 183u16, 4 as u16);
17239        self.as_rec_mut().extend(value.to_ne_bytes());
17240        self
17241    }
17242    pub fn push_ch_switch_block_tx(mut self, value: ()) -> Self {
17243        push_header(self.as_rec_mut(), 184u16, 0 as u16);
17244        self
17245    }
17246    pub fn push_csa_ies(mut self, value: &[u8]) -> Self {
17247        push_header(self.as_rec_mut(), 185u16, value.len() as u16);
17248        self.as_rec_mut().extend(value);
17249        self
17250    }
17251    pub fn push_cntdwn_offs_beacon(mut self, value: &[u8]) -> Self {
17252        push_header(self.as_rec_mut(), 186u16, value.len() as u16);
17253        self.as_rec_mut().extend(value);
17254        self
17255    }
17256    pub fn push_cntdwn_offs_presp(mut self, value: &[u8]) -> Self {
17257        push_header(self.as_rec_mut(), 187u16, value.len() as u16);
17258        self.as_rec_mut().extend(value);
17259        self
17260    }
17261    pub fn push_rxmgmt_flags(mut self, value: &[u8]) -> Self {
17262        push_header(self.as_rec_mut(), 188u16, value.len() as u16);
17263        self.as_rec_mut().extend(value);
17264        self
17265    }
17266    pub fn push_sta_supported_channels(mut self, value: &[u8]) -> Self {
17267        push_header(self.as_rec_mut(), 189u16, value.len() as u16);
17268        self.as_rec_mut().extend(value);
17269        self
17270    }
17271    pub fn push_sta_supported_oper_classes(mut self, value: &[u8]) -> Self {
17272        push_header(self.as_rec_mut(), 190u16, value.len() as u16);
17273        self.as_rec_mut().extend(value);
17274        self
17275    }
17276    pub fn push_handle_dfs(mut self, value: ()) -> Self {
17277        push_header(self.as_rec_mut(), 191u16, 0 as u16);
17278        self
17279    }
17280    pub fn push_support_5_mhz(mut self, value: ()) -> Self {
17281        push_header(self.as_rec_mut(), 192u16, 0 as u16);
17282        self
17283    }
17284    pub fn push_support_10_mhz(mut self, value: ()) -> Self {
17285        push_header(self.as_rec_mut(), 193u16, 0 as u16);
17286        self
17287    }
17288    pub fn push_opmode_notif(mut self, value: u8) -> Self {
17289        push_header(self.as_rec_mut(), 194u16, 1 as u16);
17290        self.as_rec_mut().extend(value.to_ne_bytes());
17291        self
17292    }
17293    pub fn push_vendor_id(mut self, value: u32) -> Self {
17294        push_header(self.as_rec_mut(), 195u16, 4 as u16);
17295        self.as_rec_mut().extend(value.to_ne_bytes());
17296        self
17297    }
17298    pub fn push_vendor_subcmd(mut self, value: u32) -> Self {
17299        push_header(self.as_rec_mut(), 196u16, 4 as u16);
17300        self.as_rec_mut().extend(value.to_ne_bytes());
17301        self
17302    }
17303    pub fn push_vendor_data(mut self, value: &[u8]) -> Self {
17304        push_header(self.as_rec_mut(), 197u16, value.len() as u16);
17305        self.as_rec_mut().extend(value);
17306        self
17307    }
17308    pub fn push_vendor_events(mut self, value: &[u8]) -> Self {
17309        push_header(self.as_rec_mut(), 198u16, value.len() as u16);
17310        self.as_rec_mut().extend(value);
17311        self
17312    }
17313    pub fn push_qos_map(mut self, value: &[u8]) -> Self {
17314        push_header(self.as_rec_mut(), 199u16, value.len() as u16);
17315        self.as_rec_mut().extend(value);
17316        self
17317    }
17318    pub fn push_mac_hint(mut self, value: &[u8]) -> Self {
17319        push_header(self.as_rec_mut(), 200u16, value.len() as u16);
17320        self.as_rec_mut().extend(value);
17321        self
17322    }
17323    pub fn push_wiphy_freq_hint(mut self, value: u32) -> Self {
17324        push_header(self.as_rec_mut(), 201u16, 4 as u16);
17325        self.as_rec_mut().extend(value.to_ne_bytes());
17326        self
17327    }
17328    pub fn push_max_ap_assoc_sta(mut self, value: u32) -> Self {
17329        push_header(self.as_rec_mut(), 202u16, 4 as u16);
17330        self.as_rec_mut().extend(value.to_ne_bytes());
17331        self
17332    }
17333    pub fn push_tdls_peer_capability(mut self, value: u32) -> Self {
17334        push_header(self.as_rec_mut(), 203u16, 4 as u16);
17335        self.as_rec_mut().extend(value.to_ne_bytes());
17336        self
17337    }
17338    pub fn push_socket_owner(mut self, value: ()) -> Self {
17339        push_header(self.as_rec_mut(), 204u16, 0 as u16);
17340        self
17341    }
17342    pub fn push_csa_c_offsets_tx(mut self, value: &[u8]) -> Self {
17343        push_header(self.as_rec_mut(), 205u16, value.len() as u16);
17344        self.as_rec_mut().extend(value);
17345        self
17346    }
17347    pub fn push_max_csa_counters(mut self, value: u8) -> Self {
17348        push_header(self.as_rec_mut(), 206u16, 1 as u16);
17349        self.as_rec_mut().extend(value.to_ne_bytes());
17350        self
17351    }
17352    pub fn push_tdls_initiator(mut self, value: ()) -> Self {
17353        push_header(self.as_rec_mut(), 207u16, 0 as u16);
17354        self
17355    }
17356    pub fn push_use_rrm(mut self, value: ()) -> Self {
17357        push_header(self.as_rec_mut(), 208u16, 0 as u16);
17358        self
17359    }
17360    pub fn push_wiphy_dyn_ack(mut self, value: ()) -> Self {
17361        push_header(self.as_rec_mut(), 209u16, 0 as u16);
17362        self
17363    }
17364    pub fn push_tsid(mut self, value: u8) -> Self {
17365        push_header(self.as_rec_mut(), 210u16, 1 as u16);
17366        self.as_rec_mut().extend(value.to_ne_bytes());
17367        self
17368    }
17369    pub fn push_user_prio(mut self, value: u8) -> Self {
17370        push_header(self.as_rec_mut(), 211u16, 1 as u16);
17371        self.as_rec_mut().extend(value.to_ne_bytes());
17372        self
17373    }
17374    pub fn push_admitted_time(mut self, value: u16) -> Self {
17375        push_header(self.as_rec_mut(), 212u16, 2 as u16);
17376        self.as_rec_mut().extend(value.to_ne_bytes());
17377        self
17378    }
17379    pub fn push_smps_mode(mut self, value: u8) -> Self {
17380        push_header(self.as_rec_mut(), 213u16, 1 as u16);
17381        self.as_rec_mut().extend(value.to_ne_bytes());
17382        self
17383    }
17384    pub fn push_oper_class(mut self, value: u8) -> Self {
17385        push_header(self.as_rec_mut(), 214u16, 1 as u16);
17386        self.as_rec_mut().extend(value.to_ne_bytes());
17387        self
17388    }
17389    pub fn push_mac_mask(mut self, value: &[u8]) -> Self {
17390        push_header(self.as_rec_mut(), 215u16, value.len() as u16);
17391        self.as_rec_mut().extend(value);
17392        self
17393    }
17394    pub fn push_wiphy_self_managed_reg(mut self, value: ()) -> Self {
17395        push_header(self.as_rec_mut(), 216u16, 0 as u16);
17396        self
17397    }
17398    pub fn push_ext_features(mut self, value: &[u8]) -> Self {
17399        push_header(self.as_rec_mut(), 217u16, value.len() as u16);
17400        self.as_rec_mut().extend(value);
17401        self
17402    }
17403    pub fn push_survey_radio_stats(mut self, value: &[u8]) -> Self {
17404        push_header(self.as_rec_mut(), 218u16, value.len() as u16);
17405        self.as_rec_mut().extend(value);
17406        self
17407    }
17408    pub fn push_netns_fd(mut self, value: u32) -> Self {
17409        push_header(self.as_rec_mut(), 219u16, 4 as u16);
17410        self.as_rec_mut().extend(value.to_ne_bytes());
17411        self
17412    }
17413    pub fn push_sched_scan_delay(mut self, value: u32) -> Self {
17414        push_header(self.as_rec_mut(), 220u16, 4 as u16);
17415        self.as_rec_mut().extend(value.to_ne_bytes());
17416        self
17417    }
17418    pub fn push_reg_indoor(mut self, value: ()) -> Self {
17419        push_header(self.as_rec_mut(), 221u16, 0 as u16);
17420        self
17421    }
17422    pub fn push_max_num_sched_scan_plans(mut self, value: u32) -> Self {
17423        push_header(self.as_rec_mut(), 222u16, 4 as u16);
17424        self.as_rec_mut().extend(value.to_ne_bytes());
17425        self
17426    }
17427    pub fn push_max_scan_plan_interval(mut self, value: u32) -> Self {
17428        push_header(self.as_rec_mut(), 223u16, 4 as u16);
17429        self.as_rec_mut().extend(value.to_ne_bytes());
17430        self
17431    }
17432    pub fn push_max_scan_plan_iterations(mut self, value: u32) -> Self {
17433        push_header(self.as_rec_mut(), 224u16, 4 as u16);
17434        self.as_rec_mut().extend(value.to_ne_bytes());
17435        self
17436    }
17437    pub fn push_sched_scan_plans(mut self, value: &[u8]) -> Self {
17438        push_header(self.as_rec_mut(), 225u16, value.len() as u16);
17439        self.as_rec_mut().extend(value);
17440        self
17441    }
17442    pub fn push_pbss(mut self, value: ()) -> Self {
17443        push_header(self.as_rec_mut(), 226u16, 0 as u16);
17444        self
17445    }
17446    pub fn push_bss_select(mut self, value: &[u8]) -> Self {
17447        push_header(self.as_rec_mut(), 227u16, value.len() as u16);
17448        self.as_rec_mut().extend(value);
17449        self
17450    }
17451    pub fn push_sta_support_p2p_ps(mut self, value: u8) -> Self {
17452        push_header(self.as_rec_mut(), 228u16, 1 as u16);
17453        self.as_rec_mut().extend(value.to_ne_bytes());
17454        self
17455    }
17456    pub fn push_pad(mut self, value: &[u8]) -> Self {
17457        push_header(self.as_rec_mut(), 229u16, value.len() as u16);
17458        self.as_rec_mut().extend(value);
17459        self
17460    }
17461    pub fn push_iftype_ext_capa(mut self, value: &[u8]) -> Self {
17462        push_header(self.as_rec_mut(), 230u16, value.len() as u16);
17463        self.as_rec_mut().extend(value);
17464        self
17465    }
17466    pub fn push_mu_mimo_group_data(mut self, value: &[u8]) -> Self {
17467        push_header(self.as_rec_mut(), 231u16, value.len() as u16);
17468        self.as_rec_mut().extend(value);
17469        self
17470    }
17471    pub fn push_mu_mimo_follow_mac_addr(mut self, value: &[u8]) -> Self {
17472        push_header(self.as_rec_mut(), 232u16, value.len() as u16);
17473        self.as_rec_mut().extend(value);
17474        self
17475    }
17476    pub fn push_scan_start_time_tsf(mut self, value: u64) -> Self {
17477        push_header(self.as_rec_mut(), 233u16, 8 as u16);
17478        self.as_rec_mut().extend(value.to_ne_bytes());
17479        self
17480    }
17481    pub fn push_scan_start_time_tsf_bssid(mut self, value: &[u8]) -> Self {
17482        push_header(self.as_rec_mut(), 234u16, value.len() as u16);
17483        self.as_rec_mut().extend(value);
17484        self
17485    }
17486    pub fn push_measurement_duration(mut self, value: u16) -> Self {
17487        push_header(self.as_rec_mut(), 235u16, 2 as u16);
17488        self.as_rec_mut().extend(value.to_ne_bytes());
17489        self
17490    }
17491    pub fn push_measurement_duration_mandatory(mut self, value: ()) -> Self {
17492        push_header(self.as_rec_mut(), 236u16, 0 as u16);
17493        self
17494    }
17495    pub fn push_mesh_peer_aid(mut self, value: u16) -> Self {
17496        push_header(self.as_rec_mut(), 237u16, 2 as u16);
17497        self.as_rec_mut().extend(value.to_ne_bytes());
17498        self
17499    }
17500    pub fn push_nan_master_pref(mut self, value: u8) -> Self {
17501        push_header(self.as_rec_mut(), 238u16, 1 as u16);
17502        self.as_rec_mut().extend(value.to_ne_bytes());
17503        self
17504    }
17505    pub fn push_bands(mut self, value: u32) -> Self {
17506        push_header(self.as_rec_mut(), 239u16, 4 as u16);
17507        self.as_rec_mut().extend(value.to_ne_bytes());
17508        self
17509    }
17510    pub fn push_nan_func(mut self, value: &[u8]) -> Self {
17511        push_header(self.as_rec_mut(), 240u16, value.len() as u16);
17512        self.as_rec_mut().extend(value);
17513        self
17514    }
17515    pub fn push_nan_match(mut self, value: &[u8]) -> Self {
17516        push_header(self.as_rec_mut(), 241u16, value.len() as u16);
17517        self.as_rec_mut().extend(value);
17518        self
17519    }
17520    pub fn push_fils_kek(mut self, value: &[u8]) -> Self {
17521        push_header(self.as_rec_mut(), 242u16, value.len() as u16);
17522        self.as_rec_mut().extend(value);
17523        self
17524    }
17525    pub fn push_fils_nonces(mut self, value: &[u8]) -> Self {
17526        push_header(self.as_rec_mut(), 243u16, value.len() as u16);
17527        self.as_rec_mut().extend(value);
17528        self
17529    }
17530    pub fn push_multicast_to_unicast_enabled(mut self, value: ()) -> Self {
17531        push_header(self.as_rec_mut(), 244u16, 0 as u16);
17532        self
17533    }
17534    pub fn push_bssid(mut self, value: &[u8]) -> Self {
17535        push_header(self.as_rec_mut(), 245u16, value.len() as u16);
17536        self.as_rec_mut().extend(value);
17537        self
17538    }
17539    pub fn push_sched_scan_relative_rssi(mut self, value: i8) -> Self {
17540        push_header(self.as_rec_mut(), 246u16, 1 as u16);
17541        self.as_rec_mut().extend(value.to_ne_bytes());
17542        self
17543    }
17544    pub fn push_sched_scan_rssi_adjust(mut self, value: &[u8]) -> Self {
17545        push_header(self.as_rec_mut(), 247u16, value.len() as u16);
17546        self.as_rec_mut().extend(value);
17547        self
17548    }
17549    pub fn push_timeout_reason(mut self, value: u32) -> Self {
17550        push_header(self.as_rec_mut(), 248u16, 4 as u16);
17551        self.as_rec_mut().extend(value.to_ne_bytes());
17552        self
17553    }
17554    pub fn push_fils_erp_username(mut self, value: &[u8]) -> Self {
17555        push_header(self.as_rec_mut(), 249u16, value.len() as u16);
17556        self.as_rec_mut().extend(value);
17557        self
17558    }
17559    pub fn push_fils_erp_realm(mut self, value: &[u8]) -> Self {
17560        push_header(self.as_rec_mut(), 250u16, value.len() as u16);
17561        self.as_rec_mut().extend(value);
17562        self
17563    }
17564    pub fn push_fils_erp_next_seq_num(mut self, value: u16) -> Self {
17565        push_header(self.as_rec_mut(), 251u16, 2 as u16);
17566        self.as_rec_mut().extend(value.to_ne_bytes());
17567        self
17568    }
17569    pub fn push_fils_erp_rrk(mut self, value: &[u8]) -> Self {
17570        push_header(self.as_rec_mut(), 252u16, value.len() as u16);
17571        self.as_rec_mut().extend(value);
17572        self
17573    }
17574    pub fn push_fils_cache_id(mut self, value: &[u8]) -> Self {
17575        push_header(self.as_rec_mut(), 253u16, value.len() as u16);
17576        self.as_rec_mut().extend(value);
17577        self
17578    }
17579    pub fn push_pmk(mut self, value: &[u8]) -> Self {
17580        push_header(self.as_rec_mut(), 254u16, value.len() as u16);
17581        self.as_rec_mut().extend(value);
17582        self
17583    }
17584    pub fn push_sched_scan_multi(mut self, value: ()) -> Self {
17585        push_header(self.as_rec_mut(), 255u16, 0 as u16);
17586        self
17587    }
17588    pub fn push_sched_scan_max_reqs(mut self, value: u32) -> Self {
17589        push_header(self.as_rec_mut(), 256u16, 4 as u16);
17590        self.as_rec_mut().extend(value.to_ne_bytes());
17591        self
17592    }
17593    pub fn push_want_1x_4way_hs(mut self, value: ()) -> Self {
17594        push_header(self.as_rec_mut(), 257u16, 0 as u16);
17595        self
17596    }
17597    pub fn push_pmkr0_name(mut self, value: &[u8]) -> Self {
17598        push_header(self.as_rec_mut(), 258u16, value.len() as u16);
17599        self.as_rec_mut().extend(value);
17600        self
17601    }
17602    pub fn push_port_authorized(mut self, value: &[u8]) -> Self {
17603        push_header(self.as_rec_mut(), 259u16, value.len() as u16);
17604        self.as_rec_mut().extend(value);
17605        self
17606    }
17607    pub fn push_external_auth_action(mut self, value: u32) -> Self {
17608        push_header(self.as_rec_mut(), 260u16, 4 as u16);
17609        self.as_rec_mut().extend(value.to_ne_bytes());
17610        self
17611    }
17612    pub fn push_external_auth_support(mut self, value: ()) -> Self {
17613        push_header(self.as_rec_mut(), 261u16, 0 as u16);
17614        self
17615    }
17616    pub fn push_nss(mut self, value: u8) -> Self {
17617        push_header(self.as_rec_mut(), 262u16, 1 as u16);
17618        self.as_rec_mut().extend(value.to_ne_bytes());
17619        self
17620    }
17621    pub fn push_ack_signal(mut self, value: i32) -> Self {
17622        push_header(self.as_rec_mut(), 263u16, 4 as u16);
17623        self.as_rec_mut().extend(value.to_ne_bytes());
17624        self
17625    }
17626    pub fn push_control_port_over_nl80211(mut self, value: ()) -> Self {
17627        push_header(self.as_rec_mut(), 264u16, 0 as u16);
17628        self
17629    }
17630    pub fn nested_txq_stats(mut self) -> PushTxqStatsAttrs<Self> {
17631        let header_offset = push_nested_header(self.as_rec_mut(), 265u16);
17632        PushTxqStatsAttrs {
17633            prev: Some(self),
17634            header_offset: Some(header_offset),
17635        }
17636    }
17637    pub fn push_txq_limit(mut self, value: u32) -> Self {
17638        push_header(self.as_rec_mut(), 266u16, 4 as u16);
17639        self.as_rec_mut().extend(value.to_ne_bytes());
17640        self
17641    }
17642    pub fn push_txq_memory_limit(mut self, value: u32) -> Self {
17643        push_header(self.as_rec_mut(), 267u16, 4 as u16);
17644        self.as_rec_mut().extend(value.to_ne_bytes());
17645        self
17646    }
17647    pub fn push_txq_quantum(mut self, value: u32) -> Self {
17648        push_header(self.as_rec_mut(), 268u16, 4 as u16);
17649        self.as_rec_mut().extend(value.to_ne_bytes());
17650        self
17651    }
17652    pub fn push_he_capability(mut self, value: &[u8]) -> Self {
17653        push_header(self.as_rec_mut(), 269u16, value.len() as u16);
17654        self.as_rec_mut().extend(value);
17655        self
17656    }
17657    pub fn push_ftm_responder(mut self, value: &[u8]) -> Self {
17658        push_header(self.as_rec_mut(), 270u16, value.len() as u16);
17659        self.as_rec_mut().extend(value);
17660        self
17661    }
17662    pub fn push_ftm_responder_stats(mut self, value: &[u8]) -> Self {
17663        push_header(self.as_rec_mut(), 271u16, value.len() as u16);
17664        self.as_rec_mut().extend(value);
17665        self
17666    }
17667    pub fn push_timeout(mut self, value: u32) -> Self {
17668        push_header(self.as_rec_mut(), 272u16, 4 as u16);
17669        self.as_rec_mut().extend(value.to_ne_bytes());
17670        self
17671    }
17672    pub fn push_peer_measurements(mut self, value: &[u8]) -> Self {
17673        push_header(self.as_rec_mut(), 273u16, value.len() as u16);
17674        self.as_rec_mut().extend(value);
17675        self
17676    }
17677    pub fn push_airtime_weight(mut self, value: u16) -> Self {
17678        push_header(self.as_rec_mut(), 274u16, 2 as u16);
17679        self.as_rec_mut().extend(value.to_ne_bytes());
17680        self
17681    }
17682    pub fn push_sta_tx_power_setting(mut self, value: u8) -> Self {
17683        push_header(self.as_rec_mut(), 275u16, 1 as u16);
17684        self.as_rec_mut().extend(value.to_ne_bytes());
17685        self
17686    }
17687    pub fn push_sta_tx_power(mut self, value: i16) -> Self {
17688        push_header(self.as_rec_mut(), 276u16, 2 as u16);
17689        self.as_rec_mut().extend(value.to_ne_bytes());
17690        self
17691    }
17692    pub fn push_sae_password(mut self, value: &[u8]) -> Self {
17693        push_header(self.as_rec_mut(), 277u16, value.len() as u16);
17694        self.as_rec_mut().extend(value);
17695        self
17696    }
17697    pub fn push_twt_responder(mut self, value: ()) -> Self {
17698        push_header(self.as_rec_mut(), 278u16, 0 as u16);
17699        self
17700    }
17701    pub fn push_he_obss_pd(mut self, value: &[u8]) -> Self {
17702        push_header(self.as_rec_mut(), 279u16, value.len() as u16);
17703        self.as_rec_mut().extend(value);
17704        self
17705    }
17706    pub fn push_wiphy_edmg_channels(mut self, value: u8) -> Self {
17707        push_header(self.as_rec_mut(), 280u16, 1 as u16);
17708        self.as_rec_mut().extend(value.to_ne_bytes());
17709        self
17710    }
17711    pub fn push_wiphy_edmg_bw_config(mut self, value: u8) -> Self {
17712        push_header(self.as_rec_mut(), 281u16, 1 as u16);
17713        self.as_rec_mut().extend(value.to_ne_bytes());
17714        self
17715    }
17716    pub fn push_vlan_id(mut self, value: u16) -> Self {
17717        push_header(self.as_rec_mut(), 282u16, 2 as u16);
17718        self.as_rec_mut().extend(value.to_ne_bytes());
17719        self
17720    }
17721    pub fn push_he_bss_color(mut self, value: &[u8]) -> Self {
17722        push_header(self.as_rec_mut(), 283u16, value.len() as u16);
17723        self.as_rec_mut().extend(value);
17724        self
17725    }
17726    pub fn push_iftype_akm_suites(mut self, value: &[u8]) -> Self {
17727        push_header(self.as_rec_mut(), 284u16, value.len() as u16);
17728        self.as_rec_mut().extend(value);
17729        self
17730    }
17731    pub fn push_tid_config(mut self, value: &[u8]) -> Self {
17732        push_header(self.as_rec_mut(), 285u16, value.len() as u16);
17733        self.as_rec_mut().extend(value);
17734        self
17735    }
17736    pub fn push_control_port_no_preauth(mut self, value: ()) -> Self {
17737        push_header(self.as_rec_mut(), 286u16, 0 as u16);
17738        self
17739    }
17740    pub fn push_pmk_lifetime(mut self, value: u32) -> Self {
17741        push_header(self.as_rec_mut(), 287u16, 4 as u16);
17742        self.as_rec_mut().extend(value.to_ne_bytes());
17743        self
17744    }
17745    pub fn push_pmk_reauth_threshold(mut self, value: u8) -> Self {
17746        push_header(self.as_rec_mut(), 288u16, 1 as u16);
17747        self.as_rec_mut().extend(value.to_ne_bytes());
17748        self
17749    }
17750    pub fn push_receive_multicast(mut self, value: ()) -> Self {
17751        push_header(self.as_rec_mut(), 289u16, 0 as u16);
17752        self
17753    }
17754    pub fn push_wiphy_freq_offset(mut self, value: u32) -> Self {
17755        push_header(self.as_rec_mut(), 290u16, 4 as u16);
17756        self.as_rec_mut().extend(value.to_ne_bytes());
17757        self
17758    }
17759    pub fn push_center_freq1_offset(mut self, value: u32) -> Self {
17760        push_header(self.as_rec_mut(), 291u16, 4 as u16);
17761        self.as_rec_mut().extend(value.to_ne_bytes());
17762        self
17763    }
17764    pub fn push_scan_freq_khz(mut self, value: &[u8]) -> Self {
17765        push_header(self.as_rec_mut(), 292u16, value.len() as u16);
17766        self.as_rec_mut().extend(value);
17767        self
17768    }
17769    pub fn push_he_6ghz_capability(mut self, value: &[u8]) -> Self {
17770        push_header(self.as_rec_mut(), 293u16, value.len() as u16);
17771        self.as_rec_mut().extend(value);
17772        self
17773    }
17774    pub fn push_fils_discovery(mut self, value: &[u8]) -> Self {
17775        push_header(self.as_rec_mut(), 294u16, value.len() as u16);
17776        self.as_rec_mut().extend(value);
17777        self
17778    }
17779    pub fn push_unsol_bcast_probe_resp(mut self, value: &[u8]) -> Self {
17780        push_header(self.as_rec_mut(), 295u16, value.len() as u16);
17781        self.as_rec_mut().extend(value);
17782        self
17783    }
17784    pub fn push_s1g_capability(mut self, value: &[u8]) -> Self {
17785        push_header(self.as_rec_mut(), 296u16, value.len() as u16);
17786        self.as_rec_mut().extend(value);
17787        self
17788    }
17789    pub fn push_s1g_capability_mask(mut self, value: &[u8]) -> Self {
17790        push_header(self.as_rec_mut(), 297u16, value.len() as u16);
17791        self.as_rec_mut().extend(value);
17792        self
17793    }
17794    pub fn push_sae_pwe(mut self, value: u8) -> Self {
17795        push_header(self.as_rec_mut(), 298u16, 1 as u16);
17796        self.as_rec_mut().extend(value.to_ne_bytes());
17797        self
17798    }
17799    pub fn push_reconnect_requested(mut self, value: &[u8]) -> Self {
17800        push_header(self.as_rec_mut(), 299u16, value.len() as u16);
17801        self.as_rec_mut().extend(value);
17802        self
17803    }
17804    pub fn nested_sar_spec(mut self) -> PushSarAttributes<Self> {
17805        let header_offset = push_nested_header(self.as_rec_mut(), 300u16);
17806        PushSarAttributes {
17807            prev: Some(self),
17808            header_offset: Some(header_offset),
17809        }
17810    }
17811    pub fn push_disable_he(mut self, value: ()) -> Self {
17812        push_header(self.as_rec_mut(), 301u16, 0 as u16);
17813        self
17814    }
17815    pub fn push_obss_color_bitmap(mut self, value: u64) -> Self {
17816        push_header(self.as_rec_mut(), 302u16, 8 as u16);
17817        self.as_rec_mut().extend(value.to_ne_bytes());
17818        self
17819    }
17820    pub fn push_color_change_count(mut self, value: u8) -> Self {
17821        push_header(self.as_rec_mut(), 303u16, 1 as u16);
17822        self.as_rec_mut().extend(value.to_ne_bytes());
17823        self
17824    }
17825    pub fn push_color_change_color(mut self, value: u8) -> Self {
17826        push_header(self.as_rec_mut(), 304u16, 1 as u16);
17827        self.as_rec_mut().extend(value.to_ne_bytes());
17828        self
17829    }
17830    pub fn push_color_change_elems(mut self, value: &[u8]) -> Self {
17831        push_header(self.as_rec_mut(), 305u16, value.len() as u16);
17832        self.as_rec_mut().extend(value);
17833        self
17834    }
17835    pub fn push_mbssid_config(mut self, value: &[u8]) -> Self {
17836        push_header(self.as_rec_mut(), 306u16, value.len() as u16);
17837        self.as_rec_mut().extend(value);
17838        self
17839    }
17840    pub fn push_mbssid_elems(mut self, value: &[u8]) -> Self {
17841        push_header(self.as_rec_mut(), 307u16, value.len() as u16);
17842        self.as_rec_mut().extend(value);
17843        self
17844    }
17845    pub fn push_radar_background(mut self, value: ()) -> Self {
17846        push_header(self.as_rec_mut(), 308u16, 0 as u16);
17847        self
17848    }
17849    pub fn push_ap_settings_flags(mut self, value: u32) -> Self {
17850        push_header(self.as_rec_mut(), 309u16, 4 as u16);
17851        self.as_rec_mut().extend(value.to_ne_bytes());
17852        self
17853    }
17854    pub fn push_eht_capability(mut self, value: &[u8]) -> Self {
17855        push_header(self.as_rec_mut(), 310u16, value.len() as u16);
17856        self.as_rec_mut().extend(value);
17857        self
17858    }
17859    pub fn push_disable_eht(mut self, value: ()) -> Self {
17860        push_header(self.as_rec_mut(), 311u16, 0 as u16);
17861        self
17862    }
17863    pub fn push_mlo_links(mut self, value: &[u8]) -> Self {
17864        push_header(self.as_rec_mut(), 312u16, value.len() as u16);
17865        self.as_rec_mut().extend(value);
17866        self
17867    }
17868    pub fn push_mlo_link_id(mut self, value: u8) -> Self {
17869        push_header(self.as_rec_mut(), 313u16, 1 as u16);
17870        self.as_rec_mut().extend(value.to_ne_bytes());
17871        self
17872    }
17873    pub fn push_mld_addr(mut self, value: &[u8]) -> Self {
17874        push_header(self.as_rec_mut(), 314u16, value.len() as u16);
17875        self.as_rec_mut().extend(value);
17876        self
17877    }
17878    pub fn push_mlo_support(mut self, value: ()) -> Self {
17879        push_header(self.as_rec_mut(), 315u16, 0 as u16);
17880        self
17881    }
17882    pub fn push_max_num_akm_suites(mut self, value: &[u8]) -> Self {
17883        push_header(self.as_rec_mut(), 316u16, value.len() as u16);
17884        self.as_rec_mut().extend(value);
17885        self
17886    }
17887    pub fn push_eml_capability(mut self, value: u16) -> Self {
17888        push_header(self.as_rec_mut(), 317u16, 2 as u16);
17889        self.as_rec_mut().extend(value.to_ne_bytes());
17890        self
17891    }
17892    pub fn push_mld_capa_and_ops(mut self, value: u16) -> Self {
17893        push_header(self.as_rec_mut(), 318u16, 2 as u16);
17894        self.as_rec_mut().extend(value.to_ne_bytes());
17895        self
17896    }
17897    pub fn push_tx_hw_timestamp(mut self, value: u64) -> Self {
17898        push_header(self.as_rec_mut(), 319u16, 8 as u16);
17899        self.as_rec_mut().extend(value.to_ne_bytes());
17900        self
17901    }
17902    pub fn push_rx_hw_timestamp(mut self, value: u64) -> Self {
17903        push_header(self.as_rec_mut(), 320u16, 8 as u16);
17904        self.as_rec_mut().extend(value.to_ne_bytes());
17905        self
17906    }
17907    pub fn push_td_bitmap(mut self, value: &[u8]) -> Self {
17908        push_header(self.as_rec_mut(), 321u16, value.len() as u16);
17909        self.as_rec_mut().extend(value);
17910        self
17911    }
17912    pub fn push_punct_bitmap(mut self, value: u32) -> Self {
17913        push_header(self.as_rec_mut(), 322u16, 4 as u16);
17914        self.as_rec_mut().extend(value.to_ne_bytes());
17915        self
17916    }
17917    pub fn push_max_hw_timestamp_peers(mut self, value: u16) -> Self {
17918        push_header(self.as_rec_mut(), 323u16, 2 as u16);
17919        self.as_rec_mut().extend(value.to_ne_bytes());
17920        self
17921    }
17922    pub fn push_hw_timestamp_enabled(mut self, value: ()) -> Self {
17923        push_header(self.as_rec_mut(), 324u16, 0 as u16);
17924        self
17925    }
17926    pub fn push_ema_rnr_elems(mut self, value: &[u8]) -> Self {
17927        push_header(self.as_rec_mut(), 325u16, value.len() as u16);
17928        self.as_rec_mut().extend(value);
17929        self
17930    }
17931    pub fn push_mlo_link_disabled(mut self, value: ()) -> Self {
17932        push_header(self.as_rec_mut(), 326u16, 0 as u16);
17933        self
17934    }
17935    pub fn push_bss_dump_include_use_data(mut self, value: ()) -> Self {
17936        push_header(self.as_rec_mut(), 327u16, 0 as u16);
17937        self
17938    }
17939    pub fn push_mlo_ttlm_dlink(mut self, value: u16) -> Self {
17940        push_header(self.as_rec_mut(), 328u16, 2 as u16);
17941        self.as_rec_mut().extend(value.to_ne_bytes());
17942        self
17943    }
17944    pub fn push_mlo_ttlm_ulink(mut self, value: u16) -> Self {
17945        push_header(self.as_rec_mut(), 329u16, 2 as u16);
17946        self.as_rec_mut().extend(value.to_ne_bytes());
17947        self
17948    }
17949    pub fn push_assoc_spp_amsdu(mut self, value: ()) -> Self {
17950        push_header(self.as_rec_mut(), 330u16, 0 as u16);
17951        self
17952    }
17953    pub fn push_wiphy_radios(mut self, value: &[u8]) -> Self {
17954        push_header(self.as_rec_mut(), 331u16, value.len() as u16);
17955        self.as_rec_mut().extend(value);
17956        self
17957    }
17958    pub fn push_wiphy_interface_combinations(mut self, value: &[u8]) -> Self {
17959        push_header(self.as_rec_mut(), 332u16, value.len() as u16);
17960        self.as_rec_mut().extend(value);
17961        self
17962    }
17963    pub fn push_vif_radio_mask(mut self, value: u32) -> Self {
17964        push_header(self.as_rec_mut(), 333u16, 4 as u16);
17965        self.as_rec_mut().extend(value.to_ne_bytes());
17966        self
17967    }
17968}
17969impl<Prev: Rec> Drop for PushNl80211Attrs<Prev> {
17970    fn drop(&mut self) {
17971        if let Some(prev) = &mut self.prev {
17972            if let Some(header_offset) = &self.header_offset {
17973                finalize_nested_header(prev.as_rec_mut(), *header_offset);
17974            }
17975        }
17976    }
17977}
17978pub struct PushFrameTypeAttrs<Prev: Rec> {
17979    pub(crate) prev: Option<Prev>,
17980    pub(crate) header_offset: Option<usize>,
17981}
17982impl<Prev: Rec> Rec for PushFrameTypeAttrs<Prev> {
17983    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
17984        self.prev.as_mut().unwrap().as_rec_mut()
17985    }
17986    fn as_rec(&self) -> &Vec<u8> {
17987        self.prev.as_ref().unwrap().as_rec()
17988    }
17989}
17990impl<Prev: Rec> PushFrameTypeAttrs<Prev> {
17991    pub fn new(prev: Prev) -> Self {
17992        Self {
17993            prev: Some(prev),
17994            header_offset: None,
17995        }
17996    }
17997    pub fn end_nested(mut self) -> Prev {
17998        let mut prev = self.prev.take().unwrap();
17999        if let Some(header_offset) = &self.header_offset {
18000            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18001        }
18002        prev
18003    }
18004    pub fn push_frame_type(mut self, value: u16) -> Self {
18005        push_header(self.as_rec_mut(), 101u16, 2 as u16);
18006        self.as_rec_mut().extend(value.to_ne_bytes());
18007        self
18008    }
18009}
18010impl<Prev: Rec> Drop for PushFrameTypeAttrs<Prev> {
18011    fn drop(&mut self) {
18012        if let Some(prev) = &mut self.prev {
18013            if let Some(header_offset) = &self.header_offset {
18014                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18015            }
18016        }
18017    }
18018}
18019pub struct PushWiphyBands<Prev: Rec> {
18020    pub(crate) prev: Option<Prev>,
18021    pub(crate) header_offset: Option<usize>,
18022}
18023impl<Prev: Rec> Rec for PushWiphyBands<Prev> {
18024    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18025        self.prev.as_mut().unwrap().as_rec_mut()
18026    }
18027    fn as_rec(&self) -> &Vec<u8> {
18028        self.prev.as_ref().unwrap().as_rec()
18029    }
18030}
18031impl<Prev: Rec> PushWiphyBands<Prev> {
18032    pub fn new(prev: Prev) -> Self {
18033        Self {
18034            prev: Some(prev),
18035            header_offset: None,
18036        }
18037    }
18038    pub fn end_nested(mut self) -> Prev {
18039        let mut prev = self.prev.take().unwrap();
18040        if let Some(header_offset) = &self.header_offset {
18041            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18042        }
18043        prev
18044    }
18045    #[doc = "2.4 GHz ISM band"]
18046    pub fn nested_2ghz(mut self) -> PushBandAttrs<Self> {
18047        let header_offset = push_nested_header(self.as_rec_mut(), 0u16);
18048        PushBandAttrs {
18049            prev: Some(self),
18050            header_offset: Some(header_offset),
18051        }
18052    }
18053    #[doc = "around 5 GHz band (4.9 - 5.7 GHz)"]
18054    pub fn nested_5ghz(mut self) -> PushBandAttrs<Self> {
18055        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
18056        PushBandAttrs {
18057            prev: Some(self),
18058            header_offset: Some(header_offset),
18059        }
18060    }
18061    #[doc = "around 60 GHz band (58.32 - 69.12 GHz)"]
18062    pub fn nested_60ghz(mut self) -> PushBandAttrs<Self> {
18063        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
18064        PushBandAttrs {
18065            prev: Some(self),
18066            header_offset: Some(header_offset),
18067        }
18068    }
18069    pub fn nested_6ghz(mut self) -> PushBandAttrs<Self> {
18070        let header_offset = push_nested_header(self.as_rec_mut(), 3u16);
18071        PushBandAttrs {
18072            prev: Some(self),
18073            header_offset: Some(header_offset),
18074        }
18075    }
18076    pub fn nested_s1ghz(mut self) -> PushBandAttrs<Self> {
18077        let header_offset = push_nested_header(self.as_rec_mut(), 4u16);
18078        PushBandAttrs {
18079            prev: Some(self),
18080            header_offset: Some(header_offset),
18081        }
18082    }
18083    pub fn nested_lc(mut self) -> PushBandAttrs<Self> {
18084        let header_offset = push_nested_header(self.as_rec_mut(), 5u16);
18085        PushBandAttrs {
18086            prev: Some(self),
18087            header_offset: Some(header_offset),
18088        }
18089    }
18090}
18091impl<Prev: Rec> Drop for PushWiphyBands<Prev> {
18092    fn drop(&mut self) {
18093        if let Some(prev) = &mut self.prev {
18094            if let Some(header_offset) = &self.header_offset {
18095                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18096            }
18097        }
18098    }
18099}
18100pub struct PushBandAttrs<Prev: Rec> {
18101    pub(crate) prev: Option<Prev>,
18102    pub(crate) header_offset: Option<usize>,
18103}
18104impl<Prev: Rec> Rec for PushBandAttrs<Prev> {
18105    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18106        self.prev.as_mut().unwrap().as_rec_mut()
18107    }
18108    fn as_rec(&self) -> &Vec<u8> {
18109        self.prev.as_ref().unwrap().as_rec()
18110    }
18111}
18112pub struct PushArrayFrequencyAttrs<Prev: Rec> {
18113    pub(crate) prev: Option<Prev>,
18114    pub(crate) header_offset: Option<usize>,
18115    pub(crate) counter: u16,
18116}
18117impl<Prev: Rec> Rec for PushArrayFrequencyAttrs<Prev> {
18118    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18119        self.prev.as_mut().unwrap().as_rec_mut()
18120    }
18121    fn as_rec(&self) -> &Vec<u8> {
18122        self.prev.as_ref().unwrap().as_rec()
18123    }
18124}
18125impl<Prev: Rec> PushArrayFrequencyAttrs<Prev> {
18126    pub fn new(prev: Prev) -> Self {
18127        Self {
18128            prev: Some(prev),
18129            header_offset: None,
18130            counter: 0,
18131        }
18132    }
18133    pub fn end_array(mut self) -> Prev {
18134        let mut prev = self.prev.take().unwrap();
18135        if let Some(header_offset) = &self.header_offset {
18136            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18137        }
18138        prev
18139    }
18140    pub fn entry_nested(mut self) -> PushFrequencyAttrs<Self> {
18141        let index = self.counter;
18142        self.counter += 1;
18143        let header_offset = push_nested_header(self.as_rec_mut(), index);
18144        PushFrequencyAttrs {
18145            prev: Some(self),
18146            header_offset: Some(header_offset),
18147        }
18148    }
18149}
18150impl<Prev: Rec> Drop for PushArrayFrequencyAttrs<Prev> {
18151    fn drop(&mut self) {
18152        if let Some(prev) = &mut self.prev {
18153            if let Some(header_offset) = &self.header_offset {
18154                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18155            }
18156        }
18157    }
18158}
18159pub struct PushArrayBitrateAttrs<Prev: Rec> {
18160    pub(crate) prev: Option<Prev>,
18161    pub(crate) header_offset: Option<usize>,
18162    pub(crate) counter: u16,
18163}
18164impl<Prev: Rec> Rec for PushArrayBitrateAttrs<Prev> {
18165    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18166        self.prev.as_mut().unwrap().as_rec_mut()
18167    }
18168    fn as_rec(&self) -> &Vec<u8> {
18169        self.prev.as_ref().unwrap().as_rec()
18170    }
18171}
18172impl<Prev: Rec> PushArrayBitrateAttrs<Prev> {
18173    pub fn new(prev: Prev) -> Self {
18174        Self {
18175            prev: Some(prev),
18176            header_offset: None,
18177            counter: 0,
18178        }
18179    }
18180    pub fn end_array(mut self) -> Prev {
18181        let mut prev = self.prev.take().unwrap();
18182        if let Some(header_offset) = &self.header_offset {
18183            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18184        }
18185        prev
18186    }
18187    pub fn entry_nested(mut self) -> PushBitrateAttrs<Self> {
18188        let index = self.counter;
18189        self.counter += 1;
18190        let header_offset = push_nested_header(self.as_rec_mut(), index);
18191        PushBitrateAttrs {
18192            prev: Some(self),
18193            header_offset: Some(header_offset),
18194        }
18195    }
18196}
18197impl<Prev: Rec> Drop for PushArrayBitrateAttrs<Prev> {
18198    fn drop(&mut self) {
18199        if let Some(prev) = &mut self.prev {
18200            if let Some(header_offset) = &self.header_offset {
18201                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18202            }
18203        }
18204    }
18205}
18206pub struct PushArrayIftypeDataAttrs<Prev: Rec> {
18207    pub(crate) prev: Option<Prev>,
18208    pub(crate) header_offset: Option<usize>,
18209    pub(crate) counter: u16,
18210}
18211impl<Prev: Rec> Rec for PushArrayIftypeDataAttrs<Prev> {
18212    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18213        self.prev.as_mut().unwrap().as_rec_mut()
18214    }
18215    fn as_rec(&self) -> &Vec<u8> {
18216        self.prev.as_ref().unwrap().as_rec()
18217    }
18218}
18219impl<Prev: Rec> PushArrayIftypeDataAttrs<Prev> {
18220    pub fn new(prev: Prev) -> Self {
18221        Self {
18222            prev: Some(prev),
18223            header_offset: None,
18224            counter: 0,
18225        }
18226    }
18227    pub fn end_array(mut self) -> Prev {
18228        let mut prev = self.prev.take().unwrap();
18229        if let Some(header_offset) = &self.header_offset {
18230            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18231        }
18232        prev
18233    }
18234    pub fn entry_nested(mut self) -> PushIftypeDataAttrs<Self> {
18235        let index = self.counter;
18236        self.counter += 1;
18237        let header_offset = push_nested_header(self.as_rec_mut(), index);
18238        PushIftypeDataAttrs {
18239            prev: Some(self),
18240            header_offset: Some(header_offset),
18241        }
18242    }
18243}
18244impl<Prev: Rec> Drop for PushArrayIftypeDataAttrs<Prev> {
18245    fn drop(&mut self) {
18246        if let Some(prev) = &mut self.prev {
18247            if let Some(header_offset) = &self.header_offset {
18248                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18249            }
18250        }
18251    }
18252}
18253impl<Prev: Rec> PushBandAttrs<Prev> {
18254    pub fn new(prev: Prev) -> Self {
18255        Self {
18256            prev: Some(prev),
18257            header_offset: None,
18258        }
18259    }
18260    pub fn end_nested(mut self) -> Prev {
18261        let mut prev = self.prev.take().unwrap();
18262        if let Some(header_offset) = &self.header_offset {
18263            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18264        }
18265        prev
18266    }
18267    pub fn array_freqs(mut self) -> PushArrayFrequencyAttrs<Self> {
18268        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
18269        PushArrayFrequencyAttrs {
18270            prev: Some(self),
18271            header_offset: Some(header_offset),
18272            counter: 0,
18273        }
18274    }
18275    pub fn array_rates(mut self) -> PushArrayBitrateAttrs<Self> {
18276        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
18277        PushArrayBitrateAttrs {
18278            prev: Some(self),
18279            header_offset: Some(header_offset),
18280            counter: 0,
18281        }
18282    }
18283    pub fn push_ht_mcs_set(mut self, value: &[u8]) -> Self {
18284        push_header(self.as_rec_mut(), 3u16, value.len() as u16);
18285        self.as_rec_mut().extend(value);
18286        self
18287    }
18288    pub fn push_ht_capa(mut self, value: u16) -> Self {
18289        push_header(self.as_rec_mut(), 4u16, 2 as u16);
18290        self.as_rec_mut().extend(value.to_ne_bytes());
18291        self
18292    }
18293    pub fn push_ht_ampdu_factor(mut self, value: u8) -> Self {
18294        push_header(self.as_rec_mut(), 5u16, 1 as u16);
18295        self.as_rec_mut().extend(value.to_ne_bytes());
18296        self
18297    }
18298    pub fn push_ht_ampdu_density(mut self, value: u8) -> Self {
18299        push_header(self.as_rec_mut(), 6u16, 1 as u16);
18300        self.as_rec_mut().extend(value.to_ne_bytes());
18301        self
18302    }
18303    pub fn push_vht_mcs_set(mut self, value: &[u8]) -> Self {
18304        push_header(self.as_rec_mut(), 7u16, value.len() as u16);
18305        self.as_rec_mut().extend(value);
18306        self
18307    }
18308    pub fn push_vht_capa(mut self, value: u32) -> Self {
18309        push_header(self.as_rec_mut(), 8u16, 4 as u16);
18310        self.as_rec_mut().extend(value.to_ne_bytes());
18311        self
18312    }
18313    pub fn array_iftype_data(mut self) -> PushArrayIftypeDataAttrs<Self> {
18314        let header_offset = push_nested_header(self.as_rec_mut(), 9u16);
18315        PushArrayIftypeDataAttrs {
18316            prev: Some(self),
18317            header_offset: Some(header_offset),
18318            counter: 0,
18319        }
18320    }
18321    pub fn push_edmg_channels(mut self, value: &[u8]) -> Self {
18322        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
18323        self.as_rec_mut().extend(value);
18324        self
18325    }
18326    pub fn push_edmg_bw_config(mut self, value: &[u8]) -> Self {
18327        push_header(self.as_rec_mut(), 11u16, value.len() as u16);
18328        self.as_rec_mut().extend(value);
18329        self
18330    }
18331    pub fn push_s1g_mcs_nss_set(mut self, value: &[u8]) -> Self {
18332        push_header(self.as_rec_mut(), 12u16, value.len() as u16);
18333        self.as_rec_mut().extend(value);
18334        self
18335    }
18336    pub fn push_s1g_capa(mut self, value: &[u8]) -> Self {
18337        push_header(self.as_rec_mut(), 13u16, value.len() as u16);
18338        self.as_rec_mut().extend(value);
18339        self
18340    }
18341}
18342impl<Prev: Rec> Drop for PushBandAttrs<Prev> {
18343    fn drop(&mut self) {
18344        if let Some(prev) = &mut self.prev {
18345            if let Some(header_offset) = &self.header_offset {
18346                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18347            }
18348        }
18349    }
18350}
18351pub struct PushBitrateAttrs<Prev: Rec> {
18352    pub(crate) prev: Option<Prev>,
18353    pub(crate) header_offset: Option<usize>,
18354}
18355impl<Prev: Rec> Rec for PushBitrateAttrs<Prev> {
18356    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18357        self.prev.as_mut().unwrap().as_rec_mut()
18358    }
18359    fn as_rec(&self) -> &Vec<u8> {
18360        self.prev.as_ref().unwrap().as_rec()
18361    }
18362}
18363impl<Prev: Rec> PushBitrateAttrs<Prev> {
18364    pub fn new(prev: Prev) -> Self {
18365        Self {
18366            prev: Some(prev),
18367            header_offset: None,
18368        }
18369    }
18370    pub fn end_nested(mut self) -> Prev {
18371        let mut prev = self.prev.take().unwrap();
18372        if let Some(header_offset) = &self.header_offset {
18373            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18374        }
18375        prev
18376    }
18377    pub fn push_rate(mut self, value: u32) -> Self {
18378        push_header(self.as_rec_mut(), 1u16, 4 as u16);
18379        self.as_rec_mut().extend(value.to_ne_bytes());
18380        self
18381    }
18382    pub fn push_2ghz_shortpreamble(mut self, value: ()) -> Self {
18383        push_header(self.as_rec_mut(), 2u16, 0 as u16);
18384        self
18385    }
18386}
18387impl<Prev: Rec> Drop for PushBitrateAttrs<Prev> {
18388    fn drop(&mut self) {
18389        if let Some(prev) = &mut self.prev {
18390            if let Some(header_offset) = &self.header_offset {
18391                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18392            }
18393        }
18394    }
18395}
18396pub struct PushFrequencyAttrs<Prev: Rec> {
18397    pub(crate) prev: Option<Prev>,
18398    pub(crate) header_offset: Option<usize>,
18399}
18400impl<Prev: Rec> Rec for PushFrequencyAttrs<Prev> {
18401    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18402        self.prev.as_mut().unwrap().as_rec_mut()
18403    }
18404    fn as_rec(&self) -> &Vec<u8> {
18405        self.prev.as_ref().unwrap().as_rec()
18406    }
18407}
18408pub struct PushArrayWmmAttrs<Prev: Rec> {
18409    pub(crate) prev: Option<Prev>,
18410    pub(crate) header_offset: Option<usize>,
18411    pub(crate) counter: u16,
18412}
18413impl<Prev: Rec> Rec for PushArrayWmmAttrs<Prev> {
18414    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18415        self.prev.as_mut().unwrap().as_rec_mut()
18416    }
18417    fn as_rec(&self) -> &Vec<u8> {
18418        self.prev.as_ref().unwrap().as_rec()
18419    }
18420}
18421impl<Prev: Rec> PushArrayWmmAttrs<Prev> {
18422    pub fn new(prev: Prev) -> Self {
18423        Self {
18424            prev: Some(prev),
18425            header_offset: None,
18426            counter: 0,
18427        }
18428    }
18429    pub fn end_array(mut self) -> Prev {
18430        let mut prev = self.prev.take().unwrap();
18431        if let Some(header_offset) = &self.header_offset {
18432            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18433        }
18434        prev
18435    }
18436    pub fn entry_nested(mut self) -> PushWmmAttrs<Self> {
18437        let index = self.counter;
18438        self.counter += 1;
18439        let header_offset = push_nested_header(self.as_rec_mut(), index);
18440        PushWmmAttrs {
18441            prev: Some(self),
18442            header_offset: Some(header_offset),
18443        }
18444    }
18445}
18446impl<Prev: Rec> Drop for PushArrayWmmAttrs<Prev> {
18447    fn drop(&mut self) {
18448        if let Some(prev) = &mut self.prev {
18449            if let Some(header_offset) = &self.header_offset {
18450                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18451            }
18452        }
18453    }
18454}
18455impl<Prev: Rec> PushFrequencyAttrs<Prev> {
18456    pub fn new(prev: Prev) -> Self {
18457        Self {
18458            prev: Some(prev),
18459            header_offset: None,
18460        }
18461    }
18462    pub fn end_nested(mut self) -> Prev {
18463        let mut prev = self.prev.take().unwrap();
18464        if let Some(header_offset) = &self.header_offset {
18465            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18466        }
18467        prev
18468    }
18469    pub fn push_freq(mut self, value: u32) -> Self {
18470        push_header(self.as_rec_mut(), 1u16, 4 as u16);
18471        self.as_rec_mut().extend(value.to_ne_bytes());
18472        self
18473    }
18474    pub fn push_disabled(mut self, value: ()) -> Self {
18475        push_header(self.as_rec_mut(), 2u16, 0 as u16);
18476        self
18477    }
18478    pub fn push_no_ir(mut self, value: ()) -> Self {
18479        push_header(self.as_rec_mut(), 3u16, 0 as u16);
18480        self
18481    }
18482    pub fn push_no_ibss(mut self, value: ()) -> Self {
18483        push_header(self.as_rec_mut(), 4u16, 0 as u16);
18484        self
18485    }
18486    pub fn push_radar(mut self, value: ()) -> Self {
18487        push_header(self.as_rec_mut(), 5u16, 0 as u16);
18488        self
18489    }
18490    pub fn push_max_tx_power(mut self, value: u32) -> Self {
18491        push_header(self.as_rec_mut(), 6u16, 4 as u16);
18492        self.as_rec_mut().extend(value.to_ne_bytes());
18493        self
18494    }
18495    pub fn push_dfs_state(mut self, value: u32) -> Self {
18496        push_header(self.as_rec_mut(), 7u16, 4 as u16);
18497        self.as_rec_mut().extend(value.to_ne_bytes());
18498        self
18499    }
18500    pub fn push_dfs_time(mut self, value: &[u8]) -> Self {
18501        push_header(self.as_rec_mut(), 8u16, value.len() as u16);
18502        self.as_rec_mut().extend(value);
18503        self
18504    }
18505    pub fn push_no_ht40_minus(mut self, value: &[u8]) -> Self {
18506        push_header(self.as_rec_mut(), 9u16, value.len() as u16);
18507        self.as_rec_mut().extend(value);
18508        self
18509    }
18510    pub fn push_no_ht40_plus(mut self, value: &[u8]) -> Self {
18511        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
18512        self.as_rec_mut().extend(value);
18513        self
18514    }
18515    pub fn push_no_80mhz(mut self, value: &[u8]) -> Self {
18516        push_header(self.as_rec_mut(), 11u16, value.len() as u16);
18517        self.as_rec_mut().extend(value);
18518        self
18519    }
18520    pub fn push_no_160mhz(mut self, value: &[u8]) -> Self {
18521        push_header(self.as_rec_mut(), 12u16, value.len() as u16);
18522        self.as_rec_mut().extend(value);
18523        self
18524    }
18525    pub fn push_dfs_cac_time(mut self, value: &[u8]) -> Self {
18526        push_header(self.as_rec_mut(), 13u16, value.len() as u16);
18527        self.as_rec_mut().extend(value);
18528        self
18529    }
18530    pub fn push_indoor_only(mut self, value: &[u8]) -> Self {
18531        push_header(self.as_rec_mut(), 14u16, value.len() as u16);
18532        self.as_rec_mut().extend(value);
18533        self
18534    }
18535    pub fn push_ir_concurrent(mut self, value: &[u8]) -> Self {
18536        push_header(self.as_rec_mut(), 15u16, value.len() as u16);
18537        self.as_rec_mut().extend(value);
18538        self
18539    }
18540    pub fn push_no_20mhz(mut self, value: &[u8]) -> Self {
18541        push_header(self.as_rec_mut(), 16u16, value.len() as u16);
18542        self.as_rec_mut().extend(value);
18543        self
18544    }
18545    pub fn push_no_10mhz(mut self, value: &[u8]) -> Self {
18546        push_header(self.as_rec_mut(), 17u16, value.len() as u16);
18547        self.as_rec_mut().extend(value);
18548        self
18549    }
18550    pub fn array_wmm(mut self) -> PushArrayWmmAttrs<Self> {
18551        let header_offset = push_nested_header(self.as_rec_mut(), 18u16);
18552        PushArrayWmmAttrs {
18553            prev: Some(self),
18554            header_offset: Some(header_offset),
18555            counter: 0,
18556        }
18557    }
18558    pub fn push_no_he(mut self, value: &[u8]) -> Self {
18559        push_header(self.as_rec_mut(), 19u16, value.len() as u16);
18560        self.as_rec_mut().extend(value);
18561        self
18562    }
18563    pub fn push_offset(mut self, value: u32) -> Self {
18564        push_header(self.as_rec_mut(), 20u16, 4 as u16);
18565        self.as_rec_mut().extend(value.to_ne_bytes());
18566        self
18567    }
18568    pub fn push_1mhz(mut self, value: &[u8]) -> Self {
18569        push_header(self.as_rec_mut(), 21u16, value.len() as u16);
18570        self.as_rec_mut().extend(value);
18571        self
18572    }
18573    pub fn push_2mhz(mut self, value: &[u8]) -> Self {
18574        push_header(self.as_rec_mut(), 22u16, value.len() as u16);
18575        self.as_rec_mut().extend(value);
18576        self
18577    }
18578    pub fn push_4mhz(mut self, value: &[u8]) -> Self {
18579        push_header(self.as_rec_mut(), 23u16, value.len() as u16);
18580        self.as_rec_mut().extend(value);
18581        self
18582    }
18583    pub fn push_8mhz(mut self, value: &[u8]) -> Self {
18584        push_header(self.as_rec_mut(), 24u16, value.len() as u16);
18585        self.as_rec_mut().extend(value);
18586        self
18587    }
18588    pub fn push_16mhz(mut self, value: &[u8]) -> Self {
18589        push_header(self.as_rec_mut(), 25u16, value.len() as u16);
18590        self.as_rec_mut().extend(value);
18591        self
18592    }
18593    pub fn push_no_320mhz(mut self, value: &[u8]) -> Self {
18594        push_header(self.as_rec_mut(), 26u16, value.len() as u16);
18595        self.as_rec_mut().extend(value);
18596        self
18597    }
18598    pub fn push_no_eht(mut self, value: &[u8]) -> Self {
18599        push_header(self.as_rec_mut(), 27u16, value.len() as u16);
18600        self.as_rec_mut().extend(value);
18601        self
18602    }
18603    pub fn push_psd(mut self, value: &[u8]) -> Self {
18604        push_header(self.as_rec_mut(), 28u16, value.len() as u16);
18605        self.as_rec_mut().extend(value);
18606        self
18607    }
18608    pub fn push_dfs_concurrent(mut self, value: &[u8]) -> Self {
18609        push_header(self.as_rec_mut(), 29u16, value.len() as u16);
18610        self.as_rec_mut().extend(value);
18611        self
18612    }
18613    pub fn push_no_6ghz_vlp_client(mut self, value: &[u8]) -> Self {
18614        push_header(self.as_rec_mut(), 30u16, value.len() as u16);
18615        self.as_rec_mut().extend(value);
18616        self
18617    }
18618    pub fn push_no_6ghz_afc_client(mut self, value: &[u8]) -> Self {
18619        push_header(self.as_rec_mut(), 31u16, value.len() as u16);
18620        self.as_rec_mut().extend(value);
18621        self
18622    }
18623    pub fn push_can_monitor(mut self, value: &[u8]) -> Self {
18624        push_header(self.as_rec_mut(), 32u16, value.len() as u16);
18625        self.as_rec_mut().extend(value);
18626        self
18627    }
18628    pub fn push_allow_6ghz_vlp_ap(mut self, value: &[u8]) -> Self {
18629        push_header(self.as_rec_mut(), 33u16, value.len() as u16);
18630        self.as_rec_mut().extend(value);
18631        self
18632    }
18633}
18634impl<Prev: Rec> Drop for PushFrequencyAttrs<Prev> {
18635    fn drop(&mut self) {
18636        if let Some(prev) = &mut self.prev {
18637            if let Some(header_offset) = &self.header_offset {
18638                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18639            }
18640        }
18641    }
18642}
18643pub struct PushIfCombinationAttributes<Prev: Rec> {
18644    pub(crate) prev: Option<Prev>,
18645    pub(crate) header_offset: Option<usize>,
18646}
18647impl<Prev: Rec> Rec for PushIfCombinationAttributes<Prev> {
18648    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18649        self.prev.as_mut().unwrap().as_rec_mut()
18650    }
18651    fn as_rec(&self) -> &Vec<u8> {
18652        self.prev.as_ref().unwrap().as_rec()
18653    }
18654}
18655pub struct PushArrayIfaceLimitAttributes<Prev: Rec> {
18656    pub(crate) prev: Option<Prev>,
18657    pub(crate) header_offset: Option<usize>,
18658    pub(crate) counter: u16,
18659}
18660impl<Prev: Rec> Rec for PushArrayIfaceLimitAttributes<Prev> {
18661    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18662        self.prev.as_mut().unwrap().as_rec_mut()
18663    }
18664    fn as_rec(&self) -> &Vec<u8> {
18665        self.prev.as_ref().unwrap().as_rec()
18666    }
18667}
18668impl<Prev: Rec> PushArrayIfaceLimitAttributes<Prev> {
18669    pub fn new(prev: Prev) -> Self {
18670        Self {
18671            prev: Some(prev),
18672            header_offset: None,
18673            counter: 0,
18674        }
18675    }
18676    pub fn end_array(mut self) -> Prev {
18677        let mut prev = self.prev.take().unwrap();
18678        if let Some(header_offset) = &self.header_offset {
18679            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18680        }
18681        prev
18682    }
18683    pub fn entry_nested(mut self) -> PushIfaceLimitAttributes<Self> {
18684        let index = self.counter;
18685        self.counter += 1;
18686        let header_offset = push_nested_header(self.as_rec_mut(), index);
18687        PushIfaceLimitAttributes {
18688            prev: Some(self),
18689            header_offset: Some(header_offset),
18690        }
18691    }
18692}
18693impl<Prev: Rec> Drop for PushArrayIfaceLimitAttributes<Prev> {
18694    fn drop(&mut self) {
18695        if let Some(prev) = &mut self.prev {
18696            if let Some(header_offset) = &self.header_offset {
18697                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18698            }
18699        }
18700    }
18701}
18702impl<Prev: Rec> PushIfCombinationAttributes<Prev> {
18703    pub fn new(prev: Prev) -> Self {
18704        Self {
18705            prev: Some(prev),
18706            header_offset: None,
18707        }
18708    }
18709    pub fn end_nested(mut self) -> Prev {
18710        let mut prev = self.prev.take().unwrap();
18711        if let Some(header_offset) = &self.header_offset {
18712            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18713        }
18714        prev
18715    }
18716    pub fn array_limits(mut self) -> PushArrayIfaceLimitAttributes<Self> {
18717        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
18718        PushArrayIfaceLimitAttributes {
18719            prev: Some(self),
18720            header_offset: Some(header_offset),
18721            counter: 0,
18722        }
18723    }
18724    pub fn push_maxnum(mut self, value: u32) -> Self {
18725        push_header(self.as_rec_mut(), 2u16, 4 as u16);
18726        self.as_rec_mut().extend(value.to_ne_bytes());
18727        self
18728    }
18729    pub fn push_sta_ap_bi_match(mut self, value: ()) -> Self {
18730        push_header(self.as_rec_mut(), 3u16, 0 as u16);
18731        self
18732    }
18733    pub fn push_num_channels(mut self, value: u32) -> Self {
18734        push_header(self.as_rec_mut(), 4u16, 4 as u16);
18735        self.as_rec_mut().extend(value.to_ne_bytes());
18736        self
18737    }
18738    pub fn push_radar_detect_widths(mut self, value: u32) -> Self {
18739        push_header(self.as_rec_mut(), 5u16, 4 as u16);
18740        self.as_rec_mut().extend(value.to_ne_bytes());
18741        self
18742    }
18743    pub fn push_radar_detect_regions(mut self, value: u32) -> Self {
18744        push_header(self.as_rec_mut(), 6u16, 4 as u16);
18745        self.as_rec_mut().extend(value.to_ne_bytes());
18746        self
18747    }
18748    pub fn push_bi_min_gcd(mut self, value: u32) -> Self {
18749        push_header(self.as_rec_mut(), 7u16, 4 as u16);
18750        self.as_rec_mut().extend(value.to_ne_bytes());
18751        self
18752    }
18753}
18754impl<Prev: Rec> Drop for PushIfCombinationAttributes<Prev> {
18755    fn drop(&mut self) {
18756        if let Some(prev) = &mut self.prev {
18757            if let Some(header_offset) = &self.header_offset {
18758                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18759            }
18760        }
18761    }
18762}
18763pub struct PushIfaceLimitAttributes<Prev: Rec> {
18764    pub(crate) prev: Option<Prev>,
18765    pub(crate) header_offset: Option<usize>,
18766}
18767impl<Prev: Rec> Rec for PushIfaceLimitAttributes<Prev> {
18768    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18769        self.prev.as_mut().unwrap().as_rec_mut()
18770    }
18771    fn as_rec(&self) -> &Vec<u8> {
18772        self.prev.as_ref().unwrap().as_rec()
18773    }
18774}
18775impl<Prev: Rec> PushIfaceLimitAttributes<Prev> {
18776    pub fn new(prev: Prev) -> Self {
18777        Self {
18778            prev: Some(prev),
18779            header_offset: None,
18780        }
18781    }
18782    pub fn end_nested(mut self) -> Prev {
18783        let mut prev = self.prev.take().unwrap();
18784        if let Some(header_offset) = &self.header_offset {
18785            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18786        }
18787        prev
18788    }
18789    pub fn push_max(mut self, value: u32) -> Self {
18790        push_header(self.as_rec_mut(), 1u16, 4 as u16);
18791        self.as_rec_mut().extend(value.to_ne_bytes());
18792        self
18793    }
18794    pub fn nested_types(mut self) -> PushSupportedIftypes<Self> {
18795        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
18796        PushSupportedIftypes {
18797            prev: Some(self),
18798            header_offset: Some(header_offset),
18799        }
18800    }
18801}
18802impl<Prev: Rec> Drop for PushIfaceLimitAttributes<Prev> {
18803    fn drop(&mut self) {
18804        if let Some(prev) = &mut self.prev {
18805            if let Some(header_offset) = &self.header_offset {
18806                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18807            }
18808        }
18809    }
18810}
18811pub struct PushIftypeDataAttrs<Prev: Rec> {
18812    pub(crate) prev: Option<Prev>,
18813    pub(crate) header_offset: Option<usize>,
18814}
18815impl<Prev: Rec> Rec for PushIftypeDataAttrs<Prev> {
18816    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18817        self.prev.as_mut().unwrap().as_rec_mut()
18818    }
18819    fn as_rec(&self) -> &Vec<u8> {
18820        self.prev.as_ref().unwrap().as_rec()
18821    }
18822}
18823impl<Prev: Rec> PushIftypeDataAttrs<Prev> {
18824    pub fn new(prev: Prev) -> Self {
18825        Self {
18826            prev: Some(prev),
18827            header_offset: None,
18828        }
18829    }
18830    pub fn end_nested(mut self) -> Prev {
18831        let mut prev = self.prev.take().unwrap();
18832        if let Some(header_offset) = &self.header_offset {
18833            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18834        }
18835        prev
18836    }
18837    pub fn push_iftypes(mut self, value: &[u8]) -> Self {
18838        push_header(self.as_rec_mut(), 1u16, value.len() as u16);
18839        self.as_rec_mut().extend(value);
18840        self
18841    }
18842    pub fn push_he_cap_mac(mut self, value: &[u8]) -> Self {
18843        push_header(self.as_rec_mut(), 2u16, value.len() as u16);
18844        self.as_rec_mut().extend(value);
18845        self
18846    }
18847    pub fn push_he_cap_phy(mut self, value: &[u8]) -> Self {
18848        push_header(self.as_rec_mut(), 3u16, value.len() as u16);
18849        self.as_rec_mut().extend(value);
18850        self
18851    }
18852    pub fn push_he_cap_mcs_set(mut self, value: &[u8]) -> Self {
18853        push_header(self.as_rec_mut(), 4u16, value.len() as u16);
18854        self.as_rec_mut().extend(value);
18855        self
18856    }
18857    pub fn push_he_cap_ppe(mut self, value: &[u8]) -> Self {
18858        push_header(self.as_rec_mut(), 5u16, value.len() as u16);
18859        self.as_rec_mut().extend(value);
18860        self
18861    }
18862    pub fn push_he_6ghz_capa(mut self, value: &[u8]) -> Self {
18863        push_header(self.as_rec_mut(), 6u16, value.len() as u16);
18864        self.as_rec_mut().extend(value);
18865        self
18866    }
18867    pub fn push_vendor_elems(mut self, value: &[u8]) -> Self {
18868        push_header(self.as_rec_mut(), 7u16, value.len() as u16);
18869        self.as_rec_mut().extend(value);
18870        self
18871    }
18872    pub fn push_eht_cap_mac(mut self, value: &[u8]) -> Self {
18873        push_header(self.as_rec_mut(), 8u16, value.len() as u16);
18874        self.as_rec_mut().extend(value);
18875        self
18876    }
18877    pub fn push_eht_cap_phy(mut self, value: &[u8]) -> Self {
18878        push_header(self.as_rec_mut(), 9u16, value.len() as u16);
18879        self.as_rec_mut().extend(value);
18880        self
18881    }
18882    pub fn push_eht_cap_mcs_set(mut self, value: &[u8]) -> Self {
18883        push_header(self.as_rec_mut(), 10u16, value.len() as u16);
18884        self.as_rec_mut().extend(value);
18885        self
18886    }
18887    pub fn push_eht_cap_ppe(mut self, value: &[u8]) -> Self {
18888        push_header(self.as_rec_mut(), 11u16, value.len() as u16);
18889        self.as_rec_mut().extend(value);
18890        self
18891    }
18892}
18893impl<Prev: Rec> Drop for PushIftypeDataAttrs<Prev> {
18894    fn drop(&mut self) {
18895        if let Some(prev) = &mut self.prev {
18896            if let Some(header_offset) = &self.header_offset {
18897                finalize_nested_header(prev.as_rec_mut(), *header_offset);
18898            }
18899        }
18900    }
18901}
18902pub struct PushIftypeAttrs<Prev: Rec> {
18903    pub(crate) prev: Option<Prev>,
18904    pub(crate) header_offset: Option<usize>,
18905}
18906impl<Prev: Rec> Rec for PushIftypeAttrs<Prev> {
18907    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
18908        self.prev.as_mut().unwrap().as_rec_mut()
18909    }
18910    fn as_rec(&self) -> &Vec<u8> {
18911        self.prev.as_ref().unwrap().as_rec()
18912    }
18913}
18914impl<Prev: Rec> PushIftypeAttrs<Prev> {
18915    pub fn new(prev: Prev) -> Self {
18916        Self {
18917            prev: Some(prev),
18918            header_offset: None,
18919        }
18920    }
18921    pub fn end_nested(mut self) -> Prev {
18922        let mut prev = self.prev.take().unwrap();
18923        if let Some(header_offset) = &self.header_offset {
18924            finalize_nested_header(prev.as_rec_mut(), *header_offset);
18925        }
18926        prev
18927    }
18928    pub fn nested_unspecified(mut self) -> PushFrameTypeAttrs<Self> {
18929        let header_offset = push_nested_header(self.as_rec_mut(), 0u16);
18930        PushFrameTypeAttrs {
18931            prev: Some(self),
18932            header_offset: Some(header_offset),
18933        }
18934    }
18935    pub fn nested_adhoc(mut self) -> PushFrameTypeAttrs<Self> {
18936        let header_offset = push_nested_header(self.as_rec_mut(), 1u16);
18937        PushFrameTypeAttrs {
18938            prev: Some(self),
18939            header_offset: Some(header_offset),
18940        }
18941    }
18942    pub fn nested_station(mut self) -> PushFrameTypeAttrs<Self> {
18943        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
18944        PushFrameTypeAttrs {
18945            prev: Some(self),
18946            header_offset: Some(header_offset),
18947        }
18948    }
18949    pub fn nested_ap(mut self) -> PushFrameTypeAttrs<Self> {
18950        let header_offset = push_nested_header(self.as_rec_mut(), 3u16);
18951        PushFrameTypeAttrs {
18952            prev: Some(self),
18953            header_offset: Some(header_offset),
18954        }
18955    }
18956    pub fn nested_ap_vlan(mut self) -> PushFrameTypeAttrs<Self> {
18957        let header_offset = push_nested_header(self.as_rec_mut(), 4u16);
18958        PushFrameTypeAttrs {
18959            prev: Some(self),
18960            header_offset: Some(header_offset),
18961        }
18962    }
18963    pub fn nested_wds(mut self) -> PushFrameTypeAttrs<Self> {
18964        let header_offset = push_nested_header(self.as_rec_mut(), 5u16);
18965        PushFrameTypeAttrs {
18966            prev: Some(self),
18967            header_offset: Some(header_offset),
18968        }
18969    }
18970    pub fn nested_monitor(mut self) -> PushFrameTypeAttrs<Self> {
18971        let header_offset = push_nested_header(self.as_rec_mut(), 6u16);
18972        PushFrameTypeAttrs {
18973            prev: Some(self),
18974            header_offset: Some(header_offset),
18975        }
18976    }
18977    pub fn nested_mesh_point(mut self) -> PushFrameTypeAttrs<Self> {
18978        let header_offset = push_nested_header(self.as_rec_mut(), 7u16);
18979        PushFrameTypeAttrs {
18980            prev: Some(self),
18981            header_offset: Some(header_offset),
18982        }
18983    }
18984    pub fn nested_p2p_client(mut self) -> PushFrameTypeAttrs<Self> {
18985        let header_offset = push_nested_header(self.as_rec_mut(), 8u16);
18986        PushFrameTypeAttrs {
18987            prev: Some(self),
18988            header_offset: Some(header_offset),
18989        }
18990    }
18991    pub fn nested_p2p_go(mut self) -> PushFrameTypeAttrs<Self> {
18992        let header_offset = push_nested_header(self.as_rec_mut(), 9u16);
18993        PushFrameTypeAttrs {
18994            prev: Some(self),
18995            header_offset: Some(header_offset),
18996        }
18997    }
18998    pub fn nested_p2p_device(mut self) -> PushFrameTypeAttrs<Self> {
18999        let header_offset = push_nested_header(self.as_rec_mut(), 10u16);
19000        PushFrameTypeAttrs {
19001            prev: Some(self),
19002            header_offset: Some(header_offset),
19003        }
19004    }
19005    pub fn nested_ocb(mut self) -> PushFrameTypeAttrs<Self> {
19006        let header_offset = push_nested_header(self.as_rec_mut(), 11u16);
19007        PushFrameTypeAttrs {
19008            prev: Some(self),
19009            header_offset: Some(header_offset),
19010        }
19011    }
19012    pub fn nested_nan(mut self) -> PushFrameTypeAttrs<Self> {
19013        let header_offset = push_nested_header(self.as_rec_mut(), 12u16);
19014        PushFrameTypeAttrs {
19015            prev: Some(self),
19016            header_offset: Some(header_offset),
19017        }
19018    }
19019}
19020impl<Prev: Rec> Drop for PushIftypeAttrs<Prev> {
19021    fn drop(&mut self) {
19022        if let Some(prev) = &mut self.prev {
19023            if let Some(header_offset) = &self.header_offset {
19024                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19025            }
19026        }
19027    }
19028}
19029pub struct PushSarAttributes<Prev: Rec> {
19030    pub(crate) prev: Option<Prev>,
19031    pub(crate) header_offset: Option<usize>,
19032}
19033impl<Prev: Rec> Rec for PushSarAttributes<Prev> {
19034    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19035        self.prev.as_mut().unwrap().as_rec_mut()
19036    }
19037    fn as_rec(&self) -> &Vec<u8> {
19038        self.prev.as_ref().unwrap().as_rec()
19039    }
19040}
19041pub struct PushArraySarSpecs<Prev: Rec> {
19042    pub(crate) prev: Option<Prev>,
19043    pub(crate) header_offset: Option<usize>,
19044    pub(crate) counter: u16,
19045}
19046impl<Prev: Rec> Rec for PushArraySarSpecs<Prev> {
19047    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19048        self.prev.as_mut().unwrap().as_rec_mut()
19049    }
19050    fn as_rec(&self) -> &Vec<u8> {
19051        self.prev.as_ref().unwrap().as_rec()
19052    }
19053}
19054impl<Prev: Rec> PushArraySarSpecs<Prev> {
19055    pub fn new(prev: Prev) -> Self {
19056        Self {
19057            prev: Some(prev),
19058            header_offset: None,
19059            counter: 0,
19060        }
19061    }
19062    pub fn end_array(mut self) -> Prev {
19063        let mut prev = self.prev.take().unwrap();
19064        if let Some(header_offset) = &self.header_offset {
19065            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19066        }
19067        prev
19068    }
19069    pub fn entry_nested(mut self) -> PushSarSpecs<Self> {
19070        let index = self.counter;
19071        self.counter += 1;
19072        let header_offset = push_nested_header(self.as_rec_mut(), index);
19073        PushSarSpecs {
19074            prev: Some(self),
19075            header_offset: Some(header_offset),
19076        }
19077    }
19078}
19079impl<Prev: Rec> Drop for PushArraySarSpecs<Prev> {
19080    fn drop(&mut self) {
19081        if let Some(prev) = &mut self.prev {
19082            if let Some(header_offset) = &self.header_offset {
19083                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19084            }
19085        }
19086    }
19087}
19088impl<Prev: Rec> PushSarAttributes<Prev> {
19089    pub fn new(prev: Prev) -> Self {
19090        Self {
19091            prev: Some(prev),
19092            header_offset: None,
19093        }
19094    }
19095    pub fn end_nested(mut self) -> Prev {
19096        let mut prev = self.prev.take().unwrap();
19097        if let Some(header_offset) = &self.header_offset {
19098            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19099        }
19100        prev
19101    }
19102    pub fn push_type(mut self, value: u32) -> Self {
19103        push_header(self.as_rec_mut(), 1u16, 4 as u16);
19104        self.as_rec_mut().extend(value.to_ne_bytes());
19105        self
19106    }
19107    pub fn array_specs(mut self) -> PushArraySarSpecs<Self> {
19108        let header_offset = push_nested_header(self.as_rec_mut(), 2u16);
19109        PushArraySarSpecs {
19110            prev: Some(self),
19111            header_offset: Some(header_offset),
19112            counter: 0,
19113        }
19114    }
19115}
19116impl<Prev: Rec> Drop for PushSarAttributes<Prev> {
19117    fn drop(&mut self) {
19118        if let Some(prev) = &mut self.prev {
19119            if let Some(header_offset) = &self.header_offset {
19120                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19121            }
19122        }
19123    }
19124}
19125pub struct PushSarSpecs<Prev: Rec> {
19126    pub(crate) prev: Option<Prev>,
19127    pub(crate) header_offset: Option<usize>,
19128}
19129impl<Prev: Rec> Rec for PushSarSpecs<Prev> {
19130    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19131        self.prev.as_mut().unwrap().as_rec_mut()
19132    }
19133    fn as_rec(&self) -> &Vec<u8> {
19134        self.prev.as_ref().unwrap().as_rec()
19135    }
19136}
19137impl<Prev: Rec> PushSarSpecs<Prev> {
19138    pub fn new(prev: Prev) -> Self {
19139        Self {
19140            prev: Some(prev),
19141            header_offset: None,
19142        }
19143    }
19144    pub fn end_nested(mut self) -> Prev {
19145        let mut prev = self.prev.take().unwrap();
19146        if let Some(header_offset) = &self.header_offset {
19147            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19148        }
19149        prev
19150    }
19151    pub fn push_power(mut self, value: i32) -> Self {
19152        push_header(self.as_rec_mut(), 1u16, 4 as u16);
19153        self.as_rec_mut().extend(value.to_ne_bytes());
19154        self
19155    }
19156    pub fn push_range_index(mut self, value: u32) -> Self {
19157        push_header(self.as_rec_mut(), 2u16, 4 as u16);
19158        self.as_rec_mut().extend(value.to_ne_bytes());
19159        self
19160    }
19161    pub fn push_start_freq(mut self, value: u32) -> Self {
19162        push_header(self.as_rec_mut(), 3u16, 4 as u16);
19163        self.as_rec_mut().extend(value.to_ne_bytes());
19164        self
19165    }
19166    pub fn push_end_freq(mut self, value: u32) -> Self {
19167        push_header(self.as_rec_mut(), 4u16, 4 as u16);
19168        self.as_rec_mut().extend(value.to_ne_bytes());
19169        self
19170    }
19171}
19172impl<Prev: Rec> Drop for PushSarSpecs<Prev> {
19173    fn drop(&mut self) {
19174        if let Some(prev) = &mut self.prev {
19175            if let Some(header_offset) = &self.header_offset {
19176                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19177            }
19178        }
19179    }
19180}
19181pub struct PushSupportedIftypes<Prev: Rec> {
19182    pub(crate) prev: Option<Prev>,
19183    pub(crate) header_offset: Option<usize>,
19184}
19185impl<Prev: Rec> Rec for PushSupportedIftypes<Prev> {
19186    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19187        self.prev.as_mut().unwrap().as_rec_mut()
19188    }
19189    fn as_rec(&self) -> &Vec<u8> {
19190        self.prev.as_ref().unwrap().as_rec()
19191    }
19192}
19193impl<Prev: Rec> PushSupportedIftypes<Prev> {
19194    pub fn new(prev: Prev) -> Self {
19195        Self {
19196            prev: Some(prev),
19197            header_offset: None,
19198        }
19199    }
19200    pub fn end_nested(mut self) -> Prev {
19201        let mut prev = self.prev.take().unwrap();
19202        if let Some(header_offset) = &self.header_offset {
19203            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19204        }
19205        prev
19206    }
19207    pub fn push_adhoc(mut self, value: ()) -> Self {
19208        push_header(self.as_rec_mut(), 1u16, 0 as u16);
19209        self
19210    }
19211    pub fn push_station(mut self, value: ()) -> Self {
19212        push_header(self.as_rec_mut(), 2u16, 0 as u16);
19213        self
19214    }
19215    pub fn push_ap(mut self, value: ()) -> Self {
19216        push_header(self.as_rec_mut(), 3u16, 0 as u16);
19217        self
19218    }
19219    pub fn push_ap_vlan(mut self, value: ()) -> Self {
19220        push_header(self.as_rec_mut(), 4u16, 0 as u16);
19221        self
19222    }
19223    pub fn push_wds(mut self, value: ()) -> Self {
19224        push_header(self.as_rec_mut(), 5u16, 0 as u16);
19225        self
19226    }
19227    pub fn push_monitor(mut self, value: ()) -> Self {
19228        push_header(self.as_rec_mut(), 6u16, 0 as u16);
19229        self
19230    }
19231    pub fn push_mesh_point(mut self, value: ()) -> Self {
19232        push_header(self.as_rec_mut(), 7u16, 0 as u16);
19233        self
19234    }
19235    pub fn push_p2p_client(mut self, value: ()) -> Self {
19236        push_header(self.as_rec_mut(), 8u16, 0 as u16);
19237        self
19238    }
19239    pub fn push_p2p_go(mut self, value: ()) -> Self {
19240        push_header(self.as_rec_mut(), 9u16, 0 as u16);
19241        self
19242    }
19243    pub fn push_p2p_device(mut self, value: ()) -> Self {
19244        push_header(self.as_rec_mut(), 10u16, 0 as u16);
19245        self
19246    }
19247    pub fn push_ocb(mut self, value: ()) -> Self {
19248        push_header(self.as_rec_mut(), 11u16, 0 as u16);
19249        self
19250    }
19251    pub fn push_nan(mut self, value: ()) -> Self {
19252        push_header(self.as_rec_mut(), 12u16, 0 as u16);
19253        self
19254    }
19255}
19256impl<Prev: Rec> Drop for PushSupportedIftypes<Prev> {
19257    fn drop(&mut self) {
19258        if let Some(prev) = &mut self.prev {
19259            if let Some(header_offset) = &self.header_offset {
19260                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19261            }
19262        }
19263    }
19264}
19265pub struct PushTxqStatsAttrs<Prev: Rec> {
19266    pub(crate) prev: Option<Prev>,
19267    pub(crate) header_offset: Option<usize>,
19268}
19269impl<Prev: Rec> Rec for PushTxqStatsAttrs<Prev> {
19270    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19271        self.prev.as_mut().unwrap().as_rec_mut()
19272    }
19273    fn as_rec(&self) -> &Vec<u8> {
19274        self.prev.as_ref().unwrap().as_rec()
19275    }
19276}
19277impl<Prev: Rec> PushTxqStatsAttrs<Prev> {
19278    pub fn new(prev: Prev) -> Self {
19279        Self {
19280            prev: Some(prev),
19281            header_offset: None,
19282        }
19283    }
19284    pub fn end_nested(mut self) -> Prev {
19285        let mut prev = self.prev.take().unwrap();
19286        if let Some(header_offset) = &self.header_offset {
19287            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19288        }
19289        prev
19290    }
19291    pub fn push_backlog_bytes(mut self, value: u32) -> Self {
19292        push_header(self.as_rec_mut(), 1u16, 4 as u16);
19293        self.as_rec_mut().extend(value.to_ne_bytes());
19294        self
19295    }
19296    pub fn push_backlog_packets(mut self, value: u32) -> Self {
19297        push_header(self.as_rec_mut(), 2u16, 4 as u16);
19298        self.as_rec_mut().extend(value.to_ne_bytes());
19299        self
19300    }
19301    pub fn push_flows(mut self, value: u32) -> Self {
19302        push_header(self.as_rec_mut(), 3u16, 4 as u16);
19303        self.as_rec_mut().extend(value.to_ne_bytes());
19304        self
19305    }
19306    pub fn push_drops(mut self, value: u32) -> Self {
19307        push_header(self.as_rec_mut(), 4u16, 4 as u16);
19308        self.as_rec_mut().extend(value.to_ne_bytes());
19309        self
19310    }
19311    pub fn push_ecn_marks(mut self, value: u32) -> Self {
19312        push_header(self.as_rec_mut(), 5u16, 4 as u16);
19313        self.as_rec_mut().extend(value.to_ne_bytes());
19314        self
19315    }
19316    pub fn push_overlimit(mut self, value: u32) -> Self {
19317        push_header(self.as_rec_mut(), 6u16, 4 as u16);
19318        self.as_rec_mut().extend(value.to_ne_bytes());
19319        self
19320    }
19321    pub fn push_overmemory(mut self, value: u32) -> Self {
19322        push_header(self.as_rec_mut(), 7u16, 4 as u16);
19323        self.as_rec_mut().extend(value.to_ne_bytes());
19324        self
19325    }
19326    pub fn push_collisions(mut self, value: u32) -> Self {
19327        push_header(self.as_rec_mut(), 8u16, 4 as u16);
19328        self.as_rec_mut().extend(value.to_ne_bytes());
19329        self
19330    }
19331    pub fn push_tx_bytes(mut self, value: u32) -> Self {
19332        push_header(self.as_rec_mut(), 9u16, 4 as u16);
19333        self.as_rec_mut().extend(value.to_ne_bytes());
19334        self
19335    }
19336    pub fn push_tx_packets(mut self, value: u32) -> Self {
19337        push_header(self.as_rec_mut(), 10u16, 4 as u16);
19338        self.as_rec_mut().extend(value.to_ne_bytes());
19339        self
19340    }
19341    pub fn push_max_flows(mut self, value: u32) -> Self {
19342        push_header(self.as_rec_mut(), 11u16, 4 as u16);
19343        self.as_rec_mut().extend(value.to_ne_bytes());
19344        self
19345    }
19346}
19347impl<Prev: Rec> Drop for PushTxqStatsAttrs<Prev> {
19348    fn drop(&mut self) {
19349        if let Some(prev) = &mut self.prev {
19350            if let Some(header_offset) = &self.header_offset {
19351                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19352            }
19353        }
19354    }
19355}
19356pub struct PushWmmAttrs<Prev: Rec> {
19357    pub(crate) prev: Option<Prev>,
19358    pub(crate) header_offset: Option<usize>,
19359}
19360impl<Prev: Rec> Rec for PushWmmAttrs<Prev> {
19361    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19362        self.prev.as_mut().unwrap().as_rec_mut()
19363    }
19364    fn as_rec(&self) -> &Vec<u8> {
19365        self.prev.as_ref().unwrap().as_rec()
19366    }
19367}
19368impl<Prev: Rec> PushWmmAttrs<Prev> {
19369    pub fn new(prev: Prev) -> Self {
19370        Self {
19371            prev: Some(prev),
19372            header_offset: None,
19373        }
19374    }
19375    pub fn end_nested(mut self) -> Prev {
19376        let mut prev = self.prev.take().unwrap();
19377        if let Some(header_offset) = &self.header_offset {
19378            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19379        }
19380        prev
19381    }
19382    pub fn push_cw_min(mut self, value: u16) -> Self {
19383        push_header(self.as_rec_mut(), 1u16, 2 as u16);
19384        self.as_rec_mut().extend(value.to_ne_bytes());
19385        self
19386    }
19387    pub fn push_cw_max(mut self, value: u16) -> Self {
19388        push_header(self.as_rec_mut(), 2u16, 2 as u16);
19389        self.as_rec_mut().extend(value.to_ne_bytes());
19390        self
19391    }
19392    pub fn push_aifsn(mut self, value: u8) -> Self {
19393        push_header(self.as_rec_mut(), 3u16, 1 as u16);
19394        self.as_rec_mut().extend(value.to_ne_bytes());
19395        self
19396    }
19397    pub fn push_txop(mut self, value: u16) -> Self {
19398        push_header(self.as_rec_mut(), 4u16, 2 as u16);
19399        self.as_rec_mut().extend(value.to_ne_bytes());
19400        self
19401    }
19402}
19403impl<Prev: Rec> Drop for PushWmmAttrs<Prev> {
19404    fn drop(&mut self) {
19405        if let Some(prev) = &mut self.prev {
19406            if let Some(header_offset) = &self.header_offset {
19407                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19408            }
19409        }
19410    }
19411}
19412pub struct PushWowlanTriggersAttrs<Prev: Rec> {
19413    pub(crate) prev: Option<Prev>,
19414    pub(crate) header_offset: Option<usize>,
19415}
19416impl<Prev: Rec> Rec for PushWowlanTriggersAttrs<Prev> {
19417    fn as_rec_mut(&mut self) -> &mut Vec<u8> {
19418        self.prev.as_mut().unwrap().as_rec_mut()
19419    }
19420    fn as_rec(&self) -> &Vec<u8> {
19421        self.prev.as_ref().unwrap().as_rec()
19422    }
19423}
19424impl<Prev: Rec> PushWowlanTriggersAttrs<Prev> {
19425    pub fn new(prev: Prev) -> Self {
19426        Self {
19427            prev: Some(prev),
19428            header_offset: None,
19429        }
19430    }
19431    pub fn end_nested(mut self) -> Prev {
19432        let mut prev = self.prev.take().unwrap();
19433        if let Some(header_offset) = &self.header_offset {
19434            finalize_nested_header(prev.as_rec_mut(), *header_offset);
19435        }
19436        prev
19437    }
19438    pub fn push_any(mut self, value: ()) -> Self {
19439        push_header(self.as_rec_mut(), 1u16, 0 as u16);
19440        self
19441    }
19442    pub fn push_disconnect(mut self, value: ()) -> Self {
19443        push_header(self.as_rec_mut(), 2u16, 0 as u16);
19444        self
19445    }
19446    pub fn push_magic_pkt(mut self, value: ()) -> Self {
19447        push_header(self.as_rec_mut(), 3u16, 0 as u16);
19448        self
19449    }
19450    pub fn push_pkt_pattern(mut self, value: ()) -> Self {
19451        push_header(self.as_rec_mut(), 4u16, 0 as u16);
19452        self
19453    }
19454    pub fn push_gtk_rekey_supported(mut self, value: ()) -> Self {
19455        push_header(self.as_rec_mut(), 5u16, 0 as u16);
19456        self
19457    }
19458    pub fn push_gtk_rekey_failure(mut self, value: ()) -> Self {
19459        push_header(self.as_rec_mut(), 6u16, 0 as u16);
19460        self
19461    }
19462    pub fn push_eap_ident_request(mut self, value: ()) -> Self {
19463        push_header(self.as_rec_mut(), 7u16, 0 as u16);
19464        self
19465    }
19466    pub fn push_4way_handshake(mut self, value: ()) -> Self {
19467        push_header(self.as_rec_mut(), 8u16, 0 as u16);
19468        self
19469    }
19470    pub fn push_rfkill_release(mut self, value: ()) -> Self {
19471        push_header(self.as_rec_mut(), 9u16, 0 as u16);
19472        self
19473    }
19474    pub fn push_wakeup_pkt_80211(mut self, value: ()) -> Self {
19475        push_header(self.as_rec_mut(), 10u16, 0 as u16);
19476        self
19477    }
19478    pub fn push_wakeup_pkt_80211_len(mut self, value: ()) -> Self {
19479        push_header(self.as_rec_mut(), 11u16, 0 as u16);
19480        self
19481    }
19482    pub fn push_wakeup_pkt_8023(mut self, value: ()) -> Self {
19483        push_header(self.as_rec_mut(), 12u16, 0 as u16);
19484        self
19485    }
19486    pub fn push_wakeup_pkt_8023_len(mut self, value: ()) -> Self {
19487        push_header(self.as_rec_mut(), 13u16, 0 as u16);
19488        self
19489    }
19490    pub fn push_tcp_connection(mut self, value: ()) -> Self {
19491        push_header(self.as_rec_mut(), 14u16, 0 as u16);
19492        self
19493    }
19494    pub fn push_wakeup_tcp_match(mut self, value: ()) -> Self {
19495        push_header(self.as_rec_mut(), 15u16, 0 as u16);
19496        self
19497    }
19498    pub fn push_wakeup_tcp_connlost(mut self, value: ()) -> Self {
19499        push_header(self.as_rec_mut(), 16u16, 0 as u16);
19500        self
19501    }
19502    pub fn push_wakeup_tcp_nomoretokens(mut self, value: ()) -> Self {
19503        push_header(self.as_rec_mut(), 17u16, 0 as u16);
19504        self
19505    }
19506    pub fn push_net_detect(mut self, value: ()) -> Self {
19507        push_header(self.as_rec_mut(), 18u16, 0 as u16);
19508        self
19509    }
19510    pub fn push_net_detect_results(mut self, value: ()) -> Self {
19511        push_header(self.as_rec_mut(), 19u16, 0 as u16);
19512        self
19513    }
19514    pub fn push_unprotected_deauth_disassoc(mut self, value: ()) -> Self {
19515        push_header(self.as_rec_mut(), 20u16, 0 as u16);
19516        self
19517    }
19518}
19519impl<Prev: Rec> Drop for PushWowlanTriggersAttrs<Prev> {
19520    fn drop(&mut self) {
19521        if let Some(prev) = &mut self.prev {
19522            if let Some(header_offset) = &self.header_offset {
19523                finalize_nested_header(prev.as_rec_mut(), *header_offset);
19524            }
19525        }
19526    }
19527}
19528#[derive(Clone)]
19529pub struct PushStaFlagUpdate {
19530    pub(crate) buf: [u8; 8usize],
19531}
19532#[doc = "Create zero-initialized struct"]
19533impl Default for PushStaFlagUpdate {
19534    fn default() -> Self {
19535        Self { buf: [0u8; 8usize] }
19536    }
19537}
19538impl PushStaFlagUpdate {
19539    #[doc = "Create zero-initialized struct"]
19540    pub fn new() -> Self {
19541        Default::default()
19542    }
19543    #[doc = "Copy from contents from other slice"]
19544    pub fn new_from_slice(other: &[u8]) -> Option<Self> {
19545        if other.len() != Self::len() {
19546            return None;
19547        }
19548        let mut buf = [0u8; Self::len()];
19549        buf.clone_from_slice(other);
19550        Some(Self { buf })
19551    }
19552    #[doc = "Copy from contents from another slice, padding with zeros or truncating when needed"]
19553    pub fn new_from_zeroed(other: &[u8]) -> Self {
19554        let mut buf = [0u8; Self::len()];
19555        let len = buf.len().min(other.len());
19556        buf[..len].clone_from_slice(&other[..len]);
19557        Self { buf }
19558    }
19559    pub fn as_slice(&self) -> &[u8] {
19560        &self.buf
19561    }
19562    pub fn as_mut_slice(&mut self) -> &mut [u8] {
19563        &mut self.buf
19564    }
19565    pub const fn len() -> usize {
19566        8usize
19567    }
19568    pub fn mask(&self) -> u32 {
19569        parse_u32(&self.buf[0usize..4usize]).unwrap()
19570    }
19571    pub fn set_mask(&mut self, value: u32) {
19572        self.buf[0usize..4usize].copy_from_slice(&value.to_ne_bytes())
19573    }
19574    pub fn set(&self) -> u32 {
19575        parse_u32(&self.buf[4usize..8usize]).unwrap()
19576    }
19577    pub fn set_set(&mut self, value: u32) {
19578        self.buf[4usize..8usize].copy_from_slice(&value.to_ne_bytes())
19579    }
19580}
19581impl std::fmt::Debug for PushStaFlagUpdate {
19582    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19583        fmt.debug_struct("StaFlagUpdate")
19584            .field("mask", &self.mask())
19585            .field("set", &self.set())
19586            .finish()
19587    }
19588}
19589#[derive(Debug)]
19590pub struct RequestOpGetWiphyDumpRequest<'r> {
19591    request: Request<'r>,
19592}
19593impl<'r> RequestOpGetWiphyDumpRequest<'r> {
19594    pub fn new(mut request: Request<'r>) -> Self {
19595        Self::write_header(&mut request.buf_mut());
19596        Self {
19597            request: request.set_dump(),
19598        }
19599    }
19600    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19601        PushNl80211Attrs::new(self.request.buf_mut())
19602    }
19603    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19604        PushNl80211Attrs::new(self.request.buf)
19605    }
19606    fn write_header<Prev: Rec>(prev: &mut Prev) {
19607        let mut header = PushBuiltinNfgenmsg::new();
19608        header.set_cmd(1u8);
19609        header.set_version(1u8);
19610        prev.as_rec_mut().extend(header.as_slice());
19611    }
19612    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19613        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19614        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19615    }
19616    fn decode<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19617        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19618        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19619    }
19620}
19621impl NetlinkRequest for RequestOpGetWiphyDumpRequest<'_> {
19622    fn protocol(&self) -> Protocol {
19623        Protocol::Generic("nl80211".as_bytes())
19624    }
19625    fn flags(&self) -> u16 {
19626        self.request.flags
19627    }
19628    fn payload(&self) -> &[u8] {
19629        self.request.buf()
19630    }
19631    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19632    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19633        Self::decode(buf)
19634    }
19635    fn lookup(
19636        buf: &[u8],
19637        offset: usize,
19638        missing_type: Option<u16>,
19639    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19640        Self::decode(buf).lookup_attr(offset, missing_type)
19641    }
19642}
19643#[derive(Debug)]
19644pub struct RequestOpGetWiphyDoRequest<'r> {
19645    request: Request<'r>,
19646}
19647impl<'r> RequestOpGetWiphyDoRequest<'r> {
19648    pub fn new(mut request: Request<'r>) -> Self {
19649        Self::write_header(&mut request.buf_mut());
19650        Self { request: request }
19651    }
19652    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19653        PushNl80211Attrs::new(self.request.buf_mut())
19654    }
19655    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19656        PushNl80211Attrs::new(self.request.buf)
19657    }
19658    fn write_header<Prev: Rec>(prev: &mut Prev) {
19659        let mut header = PushBuiltinNfgenmsg::new();
19660        header.set_cmd(1u8);
19661        header.set_version(1u8);
19662        prev.as_rec_mut().extend(header.as_slice());
19663    }
19664    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19665        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19666        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19667    }
19668    fn decode<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19669        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19670        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19671    }
19672}
19673impl NetlinkRequest for RequestOpGetWiphyDoRequest<'_> {
19674    fn protocol(&self) -> Protocol {
19675        Protocol::Generic("nl80211".as_bytes())
19676    }
19677    fn flags(&self) -> u16 {
19678        self.request.flags
19679    }
19680    fn payload(&self) -> &[u8] {
19681        self.request.buf()
19682    }
19683    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19684    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19685        Self::decode(buf)
19686    }
19687    fn lookup(
19688        buf: &[u8],
19689        offset: usize,
19690        missing_type: Option<u16>,
19691    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19692        Self::decode(buf).lookup_attr(offset, missing_type)
19693    }
19694}
19695#[derive(Debug)]
19696pub struct RequestOpGetInterfaceDumpRequest<'r> {
19697    request: Request<'r>,
19698}
19699impl<'r> RequestOpGetInterfaceDumpRequest<'r> {
19700    pub fn new(mut request: Request<'r>) -> Self {
19701        Self::write_header(&mut request.buf_mut());
19702        Self {
19703            request: request.set_dump(),
19704        }
19705    }
19706    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19707        PushNl80211Attrs::new(self.request.buf_mut())
19708    }
19709    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19710        PushNl80211Attrs::new(self.request.buf)
19711    }
19712    fn write_header<Prev: Rec>(prev: &mut Prev) {
19713        let mut header = PushBuiltinNfgenmsg::new();
19714        header.set_cmd(5u8);
19715        header.set_version(1u8);
19716        prev.as_rec_mut().extend(header.as_slice());
19717    }
19718    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19719        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19720        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19721    }
19722    fn decode<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19723        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19724        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19725    }
19726}
19727impl NetlinkRequest for RequestOpGetInterfaceDumpRequest<'_> {
19728    fn protocol(&self) -> Protocol {
19729        Protocol::Generic("nl80211".as_bytes())
19730    }
19731    fn flags(&self) -> u16 {
19732        self.request.flags
19733    }
19734    fn payload(&self) -> &[u8] {
19735        self.request.buf()
19736    }
19737    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19738    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19739        Self::decode(buf)
19740    }
19741    fn lookup(
19742        buf: &[u8],
19743        offset: usize,
19744        missing_type: Option<u16>,
19745    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19746        Self::decode(buf).lookup_attr(offset, missing_type)
19747    }
19748}
19749#[derive(Debug)]
19750pub struct RequestOpGetInterfaceDoRequest<'r> {
19751    request: Request<'r>,
19752}
19753impl<'r> RequestOpGetInterfaceDoRequest<'r> {
19754    pub fn new(mut request: Request<'r>) -> Self {
19755        Self::write_header(&mut request.buf_mut());
19756        Self { request: request }
19757    }
19758    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19759        PushNl80211Attrs::new(self.request.buf_mut())
19760    }
19761    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19762        PushNl80211Attrs::new(self.request.buf)
19763    }
19764    fn write_header<Prev: Rec>(prev: &mut Prev) {
19765        let mut header = PushBuiltinNfgenmsg::new();
19766        header.set_cmd(5u8);
19767        header.set_version(1u8);
19768        prev.as_rec_mut().extend(header.as_slice());
19769    }
19770    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19771        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19772        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19773    }
19774    fn decode<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19775        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19776        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19777    }
19778}
19779impl NetlinkRequest for RequestOpGetInterfaceDoRequest<'_> {
19780    fn protocol(&self) -> Protocol {
19781        Protocol::Generic("nl80211".as_bytes())
19782    }
19783    fn flags(&self) -> u16 {
19784        self.request.flags
19785    }
19786    fn payload(&self) -> &[u8] {
19787        self.request.buf()
19788    }
19789    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19790    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19791        Self::decode(buf)
19792    }
19793    fn lookup(
19794        buf: &[u8],
19795        offset: usize,
19796        missing_type: Option<u16>,
19797    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19798        Self::decode(buf).lookup_attr(offset, missing_type)
19799    }
19800}
19801#[derive(Debug)]
19802pub struct RequestOpGetProtocolFeaturesDoRequest<'r> {
19803    request: Request<'r>,
19804}
19805impl<'r> RequestOpGetProtocolFeaturesDoRequest<'r> {
19806    pub fn new(mut request: Request<'r>) -> Self {
19807        Self::write_header(&mut request.buf_mut());
19808        Self { request: request }
19809    }
19810    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19811        PushNl80211Attrs::new(self.request.buf_mut())
19812    }
19813    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19814        PushNl80211Attrs::new(self.request.buf)
19815    }
19816    fn write_header<Prev: Rec>(prev: &mut Prev) {
19817        let mut header = PushBuiltinNfgenmsg::new();
19818        header.set_cmd(95u8);
19819        header.set_version(1u8);
19820        prev.as_rec_mut().extend(header.as_slice());
19821    }
19822    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19823        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19824        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19825    }
19826    fn decode<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19827        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19828        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19829    }
19830}
19831impl NetlinkRequest for RequestOpGetProtocolFeaturesDoRequest<'_> {
19832    fn protocol(&self) -> Protocol {
19833        Protocol::Generic("nl80211".as_bytes())
19834    }
19835    fn flags(&self) -> u16 {
19836        self.request.flags
19837    }
19838    fn payload(&self) -> &[u8] {
19839        self.request.buf()
19840    }
19841    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19842    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19843        Self::decode(buf)
19844    }
19845    fn lookup(
19846        buf: &[u8],
19847        offset: usize,
19848        missing_type: Option<u16>,
19849    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19850        Self::decode(buf).lookup_attr(offset, missing_type)
19851    }
19852}
19853#[derive(Debug)]
19854pub struct RequestOpDumpRequest<'r> {
19855    request: Request<'r>,
19856}
19857impl<'r> RequestOpDumpRequest<'r> {
19858    pub fn new(mut request: Request<'r>, request_type: u8) -> Self {
19859        Self::write_header(&mut request.buf_mut(), request_type);
19860        Self {
19861            request: request.set_dump(),
19862        }
19863    }
19864    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19865        PushNl80211Attrs::new(self.request.buf_mut())
19866    }
19867    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19868        PushNl80211Attrs::new(self.request.buf)
19869    }
19870    fn write_header<Prev: Rec>(prev: &mut Prev, request_type: u8) {
19871        let mut header = PushBuiltinNfgenmsg::new();
19872        header.set_cmd(request_type);
19873        header.set_version(1u8);
19874        prev.as_rec_mut().extend(header.as_slice());
19875    }
19876    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19877        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19878        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19879    }
19880    fn decode<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19881        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19882        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19883    }
19884}
19885impl NetlinkRequest for RequestOpDumpRequest<'_> {
19886    fn protocol(&self) -> Protocol {
19887        Protocol::Generic("nl80211".as_bytes())
19888    }
19889    fn flags(&self) -> u16 {
19890        self.request.flags
19891    }
19892    fn payload(&self) -> &[u8] {
19893        self.request.buf()
19894    }
19895    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19896    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19897        Self::decode(buf)
19898    }
19899    fn lookup(
19900        buf: &[u8],
19901        offset: usize,
19902        missing_type: Option<u16>,
19903    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19904        Self::decode(buf).lookup_attr(offset, missing_type)
19905    }
19906}
19907#[derive(Debug)]
19908pub struct RequestOpDoRequest<'r> {
19909    request: Request<'r>,
19910}
19911impl<'r> RequestOpDoRequest<'r> {
19912    pub fn new(mut request: Request<'r>, request_type: u8) -> Self {
19913        Self::write_header(&mut request.buf_mut(), request_type);
19914        Self { request: request }
19915    }
19916    pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19917        PushNl80211Attrs::new(self.request.buf_mut())
19918    }
19919    pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19920        PushNl80211Attrs::new(self.request.buf)
19921    }
19922    fn write_header<Prev: Rec>(prev: &mut Prev, request_type: u8) {
19923        let mut header = PushBuiltinNfgenmsg::new();
19924        header.set_cmd(request_type);
19925        header.set_version(1u8);
19926        prev.as_rec_mut().extend(header.as_slice());
19927    }
19928    pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19929        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19930        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19931    }
19932    fn decode<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19933        let (_header, attrs) = buf.split_at(buf.len().min(PushBuiltinNfgenmsg::len()));
19934        IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19935    }
19936}
19937impl NetlinkRequest for RequestOpDoRequest<'_> {
19938    fn protocol(&self) -> Protocol {
19939        Protocol::Generic("nl80211".as_bytes())
19940    }
19941    fn flags(&self) -> u16 {
19942        self.request.flags
19943    }
19944    fn payload(&self) -> &[u8] {
19945        self.request.buf()
19946    }
19947    type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19948    fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19949        Self::decode(buf)
19950    }
19951    fn lookup(
19952        buf: &[u8],
19953        offset: usize,
19954        missing_type: Option<u16>,
19955    ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19956        Self::decode(buf).lookup_attr(offset, missing_type)
19957    }
19958}
19959use crate::traits::LookupFn;
19960use crate::utils::RequestBuf;
19961#[derive(Debug)]
19962pub struct Request<'buf> {
19963    buf: RequestBuf<'buf>,
19964    flags: u16,
19965    writeback: Option<&'buf mut Option<RequestInfo>>,
19966}
19967#[allow(unused)]
19968#[derive(Debug, Clone)]
19969pub struct RequestInfo {
19970    protocol: Protocol,
19971    flags: u16,
19972    name: &'static str,
19973    lookup: LookupFn,
19974}
19975impl Request<'static> {
19976    pub fn new() -> Self {
19977        Self::new_from_buf(Vec::new())
19978    }
19979    pub fn new_from_buf(buf: Vec<u8>) -> Self {
19980        Self {
19981            flags: 0,
19982            buf: RequestBuf::Own(buf),
19983            writeback: None,
19984        }
19985    }
19986    pub fn into_buf(self) -> Vec<u8> {
19987        match self.buf {
19988            RequestBuf::Own(buf) => buf,
19989            _ => unreachable!(),
19990        }
19991    }
19992}
19993impl<'buf> Request<'buf> {
19994    pub fn new_with_buf(buf: &'buf mut Vec<u8>) -> Self {
19995        buf.clear();
19996        Self::new_extend(buf)
19997    }
19998    pub fn new_extend(buf: &'buf mut Vec<u8>) -> Self {
19999        Self {
20000            flags: 0,
20001            buf: RequestBuf::Ref(buf),
20002            writeback: None,
20003        }
20004    }
20005    fn do_writeback(&mut self, protocol: Protocol, name: &'static str, lookup: LookupFn) {
20006        let Some(writeback) = &mut self.writeback else {
20007            return;
20008        };
20009        **writeback = Some(RequestInfo {
20010            protocol,
20011            flags: self.flags,
20012            name,
20013            lookup,
20014        })
20015    }
20016    pub fn buf(&self) -> &Vec<u8> {
20017        self.buf.buf()
20018    }
20019    pub fn buf_mut(&mut self) -> &mut Vec<u8> {
20020        self.buf.buf_mut()
20021    }
20022    #[doc = "Set `NLM_F_CREATE` flag"]
20023    pub fn set_create(mut self) -> Self {
20024        self.flags |= consts::NLM_F_CREATE as u16;
20025        self
20026    }
20027    #[doc = "Set `NLM_F_EXCL` flag"]
20028    pub fn set_excl(mut self) -> Self {
20029        self.flags |= consts::NLM_F_EXCL as u16;
20030        self
20031    }
20032    #[doc = "Set `NLM_F_REPLACE` flag"]
20033    pub fn set_replace(mut self) -> Self {
20034        self.flags |= consts::NLM_F_REPLACE as u16;
20035        self
20036    }
20037    #[doc = "Set `NLM_F_CREATE` and `NLM_F_REPLACE` flag"]
20038    pub fn set_change(self) -> Self {
20039        self.set_create().set_replace()
20040    }
20041    #[doc = "Set `NLM_F_APPEND` flag"]
20042    pub fn set_append(mut self) -> Self {
20043        self.flags |= consts::NLM_F_APPEND as u16;
20044        self
20045    }
20046    #[doc = "Set `NLM_F_DUMP` flag"]
20047    fn set_dump(mut self) -> Self {
20048        self.flags |= consts::NLM_F_DUMP as u16;
20049        self
20050    }
20051    pub fn op_get_wiphy_dump_request(self) -> RequestOpGetWiphyDumpRequest<'buf> {
20052        let mut res = RequestOpGetWiphyDumpRequest::new(self);
20053        res.request.do_writeback(
20054            res.protocol(),
20055            "op-get-wiphy-dump-request",
20056            RequestOpGetWiphyDumpRequest::lookup,
20057        );
20058        res
20059    }
20060    pub fn op_get_wiphy_do_request(self) -> RequestOpGetWiphyDoRequest<'buf> {
20061        let mut res = RequestOpGetWiphyDoRequest::new(self);
20062        res.request.do_writeback(
20063            res.protocol(),
20064            "op-get-wiphy-do-request",
20065            RequestOpGetWiphyDoRequest::lookup,
20066        );
20067        res
20068    }
20069    pub fn op_get_interface_dump_request(self) -> RequestOpGetInterfaceDumpRequest<'buf> {
20070        let mut res = RequestOpGetInterfaceDumpRequest::new(self);
20071        res.request.do_writeback(
20072            res.protocol(),
20073            "op-get-interface-dump-request",
20074            RequestOpGetInterfaceDumpRequest::lookup,
20075        );
20076        res
20077    }
20078    pub fn op_get_interface_do_request(self) -> RequestOpGetInterfaceDoRequest<'buf> {
20079        let mut res = RequestOpGetInterfaceDoRequest::new(self);
20080        res.request.do_writeback(
20081            res.protocol(),
20082            "op-get-interface-do-request",
20083            RequestOpGetInterfaceDoRequest::lookup,
20084        );
20085        res
20086    }
20087    pub fn op_get_protocol_features_do_request(
20088        self,
20089    ) -> RequestOpGetProtocolFeaturesDoRequest<'buf> {
20090        let mut res = RequestOpGetProtocolFeaturesDoRequest::new(self);
20091        res.request.do_writeback(
20092            res.protocol(),
20093            "op-get-protocol-features-do-request",
20094            RequestOpGetProtocolFeaturesDoRequest::lookup,
20095        );
20096        res
20097    }
20098    pub fn op_dump_request(self, request_type: u8) -> RequestOpDumpRequest<'buf> {
20099        let mut res = RequestOpDumpRequest::new(self, request_type);
20100        res.request.do_writeback(
20101            res.protocol(),
20102            "op-dump-request",
20103            RequestOpDumpRequest::lookup,
20104        );
20105        res
20106    }
20107    pub fn op_do_request(self, request_type: u8) -> RequestOpDoRequest<'buf> {
20108        let mut res = RequestOpDoRequest::new(self, request_type);
20109        res.request
20110            .do_writeback(res.protocol(), "op-do-request", RequestOpDoRequest::lookup);
20111        res
20112    }
20113}