1#![doc = "Netlink API for 802.11 wireless devices\n"]
2#![allow(clippy::all)]
3#![allow(unused_imports)]
4#![allow(unused_assignments)]
5#![allow(non_snake_case)]
6#![allow(unused_variables)]
7#![allow(irrefutable_let_patterns)]
8#![allow(unreachable_code)]
9#![allow(unreachable_patterns)]
10use crate::builtin::{BuiltinBitfield32, BuiltinNfgenmsg, Nlmsghdr, PushDummy};
11use crate::{
12 consts,
13 traits::{NetlinkRequest, Protocol},
14 utils::*,
15};
16pub const PROTONAME: &str = "nl80211";
17pub const PROTONAME_CSTR: &CStr = c"nl80211";
18#[doc = "Enum - defines an integer enumeration, with values for each entry incrementing by 1, (e.g. 0, 1, 2, 3)"]
19#[derive(Debug, Clone, Copy)]
20pub enum Commands {
21 Unspec = 0,
22 GetWiphy = 1,
23 SetWiphy = 2,
24 NewWiphy = 3,
25 DelWiphy = 4,
26 GetInterface = 5,
27 SetInterface = 6,
28 NewInterface = 7,
29 DelInterface = 8,
30 GetKey = 9,
31 SetKey = 10,
32 NewKey = 11,
33 DelKey = 12,
34 GetBeacon = 13,
35 SetBeacon = 14,
36 NewBeacon = 15,
37 DelBeacon = 16,
38 GetStation = 17,
39 SetStation = 18,
40 NewStation = 19,
41 DelStation = 20,
42 GetMpath = 21,
43 SetMpath = 22,
44 NewMpath = 23,
45 DelMpath = 24,
46 SetBss = 25,
47 SetReg = 26,
48 ReqSetReg = 27,
49 GetMeshConfig = 28,
50 SetMeshConfig = 29,
51 SetMgmtExtraIe = 30,
52 GetReg = 31,
53 GetScan = 32,
54 TriggerScan = 33,
55 NewScanResults = 34,
56 ScanAborted = 35,
57 RegChange = 36,
58 Authenticate = 37,
59 Associate = 38,
60 Deauthenticate = 39,
61 Disassociate = 40,
62 MichaelMicFailure = 41,
63 RegBeaconHint = 42,
64 JoinIbss = 43,
65 LeaveIbss = 44,
66 Testmode = 45,
67 Connect = 46,
68 Roam = 47,
69 Disconnect = 48,
70 SetWiphyNetns = 49,
71 GetSurvey = 50,
72 NewSurveyResults = 51,
73 SetPmksa = 52,
74 DelPmksa = 53,
75 FlushPmksa = 54,
76 RemainOnChannel = 55,
77 CancelRemainOnChannel = 56,
78 SetTxBitrateMask = 57,
79 RegisterAction = 58,
80 Action = 59,
81 ActionTxStatus = 60,
82 SetPowerSave = 61,
83 GetPowerSave = 62,
84 SetCqm = 63,
85 NotifyCqm = 64,
86 SetChannel = 65,
87 SetWdsPeer = 66,
88 FrameWaitCancel = 67,
89 JoinMesh = 68,
90 LeaveMesh = 69,
91 UnprotDeauthenticate = 70,
92 UnprotDisassociate = 71,
93 NewPeerCandidate = 72,
94 GetWowlan = 73,
95 SetWowlan = 74,
96 StartSchedScan = 75,
97 StopSchedScan = 76,
98 SchedScanResults = 77,
99 SchedScanStopped = 78,
100 SetRekeyOffload = 79,
101 PmksaCandidate = 80,
102 TdlsOper = 81,
103 TdlsMgmt = 82,
104 UnexpectedFrame = 83,
105 ProbeClient = 84,
106 RegisterBeacons = 85,
107 Unexpected4AddrFrame = 86,
108 SetNoackMap = 87,
109 ChSwitchNotify = 88,
110 StartP2pDevice = 89,
111 StopP2pDevice = 90,
112 ConnFailed = 91,
113 SetMcastRate = 92,
114 SetMacAcl = 93,
115 RadarDetect = 94,
116 GetProtocolFeatures = 95,
117 UpdateFtIes = 96,
118 FtEvent = 97,
119 CritProtocolStart = 98,
120 CritProtocolStop = 99,
121 GetCoalesce = 100,
122 SetCoalesce = 101,
123 ChannelSwitch = 102,
124 Vendor = 103,
125 SetQosMap = 104,
126 AddTxTs = 105,
127 DelTxTs = 106,
128 GetMpp = 107,
129 JoinOcb = 108,
130 LeaveOcb = 109,
131 ChSwitchStartedNotify = 110,
132 TdlsChannelSwitch = 111,
133 TdlsCancelChannelSwitch = 112,
134 WiphyRegChange = 113,
135 AbortScan = 114,
136 StartNan = 115,
137 StopNan = 116,
138 AddNanFunction = 117,
139 DelNanFunction = 118,
140 ChangeNanConfig = 119,
141 NanMatch = 120,
142 SetMulticastToUnicast = 121,
143 UpdateConnectParams = 122,
144 SetPmk = 123,
145 DelPmk = 124,
146 PortAuthorized = 125,
147 ReloadRegdb = 126,
148 ExternalAuth = 127,
149 StaOpmodeChanged = 128,
150 ControlPortFrame = 129,
151 GetFtmResponderStats = 130,
152 PeerMeasurementStart = 131,
153 PeerMeasurementResult = 132,
154 PeerMeasurementComplete = 133,
155 NotifyRadar = 134,
156 UpdateOweInfo = 135,
157 ProbeMeshLink = 136,
158 SetTidConfig = 137,
159 UnprotBeacon = 138,
160 ControlPortFrameTxStatus = 139,
161 SetSarSpecs = 140,
162 ObssColorCollision = 141,
163 ColorChangeRequest = 142,
164 ColorChangeStarted = 143,
165 ColorChangeAborted = 144,
166 ColorChangeCompleted = 145,
167 SetFilsAad = 146,
168 AssocComeback = 147,
169 AddLink = 148,
170 RemoveLink = 149,
171 AddLinkSta = 150,
172 ModifyLinkSta = 151,
173 RemoveLinkSta = 152,
174 SetHwTimestamp = 153,
175 LinksRemoved = 154,
176 SetTidToLinkMapping = 155,
177}
178impl Commands {
179 pub fn from_value(value: u64) -> Option<Self> {
180 Some(match value {
181 0 => Self::Unspec,
182 1 => Self::GetWiphy,
183 2 => Self::SetWiphy,
184 3 => Self::NewWiphy,
185 4 => Self::DelWiphy,
186 5 => Self::GetInterface,
187 6 => Self::SetInterface,
188 7 => Self::NewInterface,
189 8 => Self::DelInterface,
190 9 => Self::GetKey,
191 10 => Self::SetKey,
192 11 => Self::NewKey,
193 12 => Self::DelKey,
194 13 => Self::GetBeacon,
195 14 => Self::SetBeacon,
196 15 => Self::NewBeacon,
197 16 => Self::DelBeacon,
198 17 => Self::GetStation,
199 18 => Self::SetStation,
200 19 => Self::NewStation,
201 20 => Self::DelStation,
202 21 => Self::GetMpath,
203 22 => Self::SetMpath,
204 23 => Self::NewMpath,
205 24 => Self::DelMpath,
206 25 => Self::SetBss,
207 26 => Self::SetReg,
208 27 => Self::ReqSetReg,
209 28 => Self::GetMeshConfig,
210 29 => Self::SetMeshConfig,
211 30 => Self::SetMgmtExtraIe,
212 31 => Self::GetReg,
213 32 => Self::GetScan,
214 33 => Self::TriggerScan,
215 34 => Self::NewScanResults,
216 35 => Self::ScanAborted,
217 36 => Self::RegChange,
218 37 => Self::Authenticate,
219 38 => Self::Associate,
220 39 => Self::Deauthenticate,
221 40 => Self::Disassociate,
222 41 => Self::MichaelMicFailure,
223 42 => Self::RegBeaconHint,
224 43 => Self::JoinIbss,
225 44 => Self::LeaveIbss,
226 45 => Self::Testmode,
227 46 => Self::Connect,
228 47 => Self::Roam,
229 48 => Self::Disconnect,
230 49 => Self::SetWiphyNetns,
231 50 => Self::GetSurvey,
232 51 => Self::NewSurveyResults,
233 52 => Self::SetPmksa,
234 53 => Self::DelPmksa,
235 54 => Self::FlushPmksa,
236 55 => Self::RemainOnChannel,
237 56 => Self::CancelRemainOnChannel,
238 57 => Self::SetTxBitrateMask,
239 58 => Self::RegisterAction,
240 59 => Self::Action,
241 60 => Self::ActionTxStatus,
242 61 => Self::SetPowerSave,
243 62 => Self::GetPowerSave,
244 63 => Self::SetCqm,
245 64 => Self::NotifyCqm,
246 65 => Self::SetChannel,
247 66 => Self::SetWdsPeer,
248 67 => Self::FrameWaitCancel,
249 68 => Self::JoinMesh,
250 69 => Self::LeaveMesh,
251 70 => Self::UnprotDeauthenticate,
252 71 => Self::UnprotDisassociate,
253 72 => Self::NewPeerCandidate,
254 73 => Self::GetWowlan,
255 74 => Self::SetWowlan,
256 75 => Self::StartSchedScan,
257 76 => Self::StopSchedScan,
258 77 => Self::SchedScanResults,
259 78 => Self::SchedScanStopped,
260 79 => Self::SetRekeyOffload,
261 80 => Self::PmksaCandidate,
262 81 => Self::TdlsOper,
263 82 => Self::TdlsMgmt,
264 83 => Self::UnexpectedFrame,
265 84 => Self::ProbeClient,
266 85 => Self::RegisterBeacons,
267 86 => Self::Unexpected4AddrFrame,
268 87 => Self::SetNoackMap,
269 88 => Self::ChSwitchNotify,
270 89 => Self::StartP2pDevice,
271 90 => Self::StopP2pDevice,
272 91 => Self::ConnFailed,
273 92 => Self::SetMcastRate,
274 93 => Self::SetMacAcl,
275 94 => Self::RadarDetect,
276 95 => Self::GetProtocolFeatures,
277 96 => Self::UpdateFtIes,
278 97 => Self::FtEvent,
279 98 => Self::CritProtocolStart,
280 99 => Self::CritProtocolStop,
281 100 => Self::GetCoalesce,
282 101 => Self::SetCoalesce,
283 102 => Self::ChannelSwitch,
284 103 => Self::Vendor,
285 104 => Self::SetQosMap,
286 105 => Self::AddTxTs,
287 106 => Self::DelTxTs,
288 107 => Self::GetMpp,
289 108 => Self::JoinOcb,
290 109 => Self::LeaveOcb,
291 110 => Self::ChSwitchStartedNotify,
292 111 => Self::TdlsChannelSwitch,
293 112 => Self::TdlsCancelChannelSwitch,
294 113 => Self::WiphyRegChange,
295 114 => Self::AbortScan,
296 115 => Self::StartNan,
297 116 => Self::StopNan,
298 117 => Self::AddNanFunction,
299 118 => Self::DelNanFunction,
300 119 => Self::ChangeNanConfig,
301 120 => Self::NanMatch,
302 121 => Self::SetMulticastToUnicast,
303 122 => Self::UpdateConnectParams,
304 123 => Self::SetPmk,
305 124 => Self::DelPmk,
306 125 => Self::PortAuthorized,
307 126 => Self::ReloadRegdb,
308 127 => Self::ExternalAuth,
309 128 => Self::StaOpmodeChanged,
310 129 => Self::ControlPortFrame,
311 130 => Self::GetFtmResponderStats,
312 131 => Self::PeerMeasurementStart,
313 132 => Self::PeerMeasurementResult,
314 133 => Self::PeerMeasurementComplete,
315 134 => Self::NotifyRadar,
316 135 => Self::UpdateOweInfo,
317 136 => Self::ProbeMeshLink,
318 137 => Self::SetTidConfig,
319 138 => Self::UnprotBeacon,
320 139 => Self::ControlPortFrameTxStatus,
321 140 => Self::SetSarSpecs,
322 141 => Self::ObssColorCollision,
323 142 => Self::ColorChangeRequest,
324 143 => Self::ColorChangeStarted,
325 144 => Self::ColorChangeAborted,
326 145 => Self::ColorChangeCompleted,
327 146 => Self::SetFilsAad,
328 147 => Self::AssocComeback,
329 148 => Self::AddLink,
330 149 => Self::RemoveLink,
331 150 => Self::AddLinkSta,
332 151 => Self::ModifyLinkSta,
333 152 => Self::RemoveLinkSta,
334 153 => Self::SetHwTimestamp,
335 154 => Self::LinksRemoved,
336 155 => Self::SetTidToLinkMapping,
337 _ => return None,
338 })
339 }
340}
341#[doc = "Flags - defines an integer enumeration, with values for each entry occupying a bit, starting from bit 0, (e.g. 1, 2, 4, 8)"]
342#[derive(Debug, Clone, Copy)]
343pub enum FeatureFlags {
344 SkTxStatus = 1 << 0,
345 HtIbss = 1 << 1,
346 InactivityTimer = 1 << 2,
347 CellBaseRegHints = 1 << 3,
348 P2pDeviceNeedsChannel = 1 << 4,
349 Sae = 1 << 5,
350 LowPriorityScan = 1 << 6,
351 ScanFlush = 1 << 7,
352 ApScan = 1 << 8,
353 VifTxpower = 1 << 9,
354 NeedObssScan = 1 << 10,
355 P2pGoCtwin = 1 << 11,
356 P2pGoOppps = 1 << 12,
357 Reserved = 1 << 13,
358 AdvertiseChanLimits = 1 << 14,
359 FullApClientState = 1 << 15,
360 UserspaceMpm = 1 << 16,
361 ActiveMonitor = 1 << 17,
362 ApModeChanWidthChange = 1 << 18,
363 DsParamSetIeInProbes = 1 << 19,
364 WfaTpcIeInProbes = 1 << 20,
365 Quiet = 1 << 21,
366 TxPowerInsertion = 1 << 22,
367 AcktoEstimation = 1 << 23,
368 StaticSmps = 1 << 24,
369 DynamicSmps = 1 << 25,
370 SupportsWmmAdmission = 1 << 26,
371 MacOnCreate = 1 << 27,
372 TdlsChannelSwitch = 1 << 28,
373 ScanRandomMacAddr = 1 << 29,
374 SchedScanRandomMacAddr = 1 << 30,
375 NoRandomMacAddr = 1 << 31,
376}
377impl FeatureFlags {
378 pub fn from_value(value: u64) -> Option<Self> {
379 Some(match value {
380 n if n == 1 << 0 => Self::SkTxStatus,
381 n if n == 1 << 1 => Self::HtIbss,
382 n if n == 1 << 2 => Self::InactivityTimer,
383 n if n == 1 << 3 => Self::CellBaseRegHints,
384 n if n == 1 << 4 => Self::P2pDeviceNeedsChannel,
385 n if n == 1 << 5 => Self::Sae,
386 n if n == 1 << 6 => Self::LowPriorityScan,
387 n if n == 1 << 7 => Self::ScanFlush,
388 n if n == 1 << 8 => Self::ApScan,
389 n if n == 1 << 9 => Self::VifTxpower,
390 n if n == 1 << 10 => Self::NeedObssScan,
391 n if n == 1 << 11 => Self::P2pGoCtwin,
392 n if n == 1 << 12 => Self::P2pGoOppps,
393 n if n == 1 << 13 => Self::Reserved,
394 n if n == 1 << 14 => Self::AdvertiseChanLimits,
395 n if n == 1 << 15 => Self::FullApClientState,
396 n if n == 1 << 16 => Self::UserspaceMpm,
397 n if n == 1 << 17 => Self::ActiveMonitor,
398 n if n == 1 << 18 => Self::ApModeChanWidthChange,
399 n if n == 1 << 19 => Self::DsParamSetIeInProbes,
400 n if n == 1 << 20 => Self::WfaTpcIeInProbes,
401 n if n == 1 << 21 => Self::Quiet,
402 n if n == 1 << 22 => Self::TxPowerInsertion,
403 n if n == 1 << 23 => Self::AcktoEstimation,
404 n if n == 1 << 24 => Self::StaticSmps,
405 n if n == 1 << 25 => Self::DynamicSmps,
406 n if n == 1 << 26 => Self::SupportsWmmAdmission,
407 n if n == 1 << 27 => Self::MacOnCreate,
408 n if n == 1 << 28 => Self::TdlsChannelSwitch,
409 n if n == 1 << 29 => Self::ScanRandomMacAddr,
410 n if n == 1 << 30 => Self::SchedScanRandomMacAddr,
411 n if n == 1 << 31 => Self::NoRandomMacAddr,
412 _ => return None,
413 })
414 }
415}
416#[doc = "Enum - defines an integer enumeration, with values for each entry incrementing by 1, (e.g. 0, 1, 2, 3)"]
417#[derive(Debug, Clone, Copy)]
418pub enum ChannelType {
419 NoHt = 0,
420 Ht20 = 1,
421 Ht40minus = 2,
422 Ht40plus = 3,
423}
424impl ChannelType {
425 pub fn from_value(value: u64) -> Option<Self> {
426 Some(match value {
427 0 => Self::NoHt,
428 1 => Self::Ht20,
429 2 => Self::Ht40minus,
430 3 => Self::Ht40plus,
431 _ => return None,
432 })
433 }
434}
435#[doc = "Flags - defines an integer enumeration, with values for each entry occupying a bit, starting from bit 0, (e.g. 1, 2, 4, 8)"]
436#[derive(Debug, Clone, Copy)]
437pub enum ProtocolFeatures {
438 SplitWiphyDump = 1 << 0,
439}
440impl ProtocolFeatures {
441 pub fn from_value(value: u64) -> Option<Self> {
442 Some(match value {
443 n if n == 1 << 0 => Self::SplitWiphyDump,
444 _ => return None,
445 })
446 }
447}
448#[derive(Debug)]
449#[repr(C, packed(4))]
450pub struct StaFlagUpdate {
451 pub mask: u32,
452 pub set: u32,
453}
454impl Clone for StaFlagUpdate {
455 fn clone(&self) -> Self {
456 Self::new_from_array(*self.as_array())
457 }
458}
459#[doc = "Create zero-initialized struct"]
460impl Default for StaFlagUpdate {
461 fn default() -> Self {
462 Self::new()
463 }
464}
465impl StaFlagUpdate {
466 #[doc = "Create zero-initialized struct"]
467 pub fn new() -> Self {
468 Self::new_from_array([0u8; Self::len()])
469 }
470 #[doc = "Copy from contents from slice"]
471 pub fn new_from_slice(other: &[u8]) -> Option<Self> {
472 if other.len() != Self::len() {
473 return None;
474 }
475 let mut buf = [0u8; Self::len()];
476 buf.clone_from_slice(other);
477 Some(Self::new_from_array(buf))
478 }
479 #[doc = "Copy from contents from another slice, padding with zeros or truncating when needed"]
480 pub fn new_from_zeroed(other: &[u8]) -> Self {
481 let mut buf = [0u8; Self::len()];
482 let len = buf.len().min(other.len());
483 buf[..len].clone_from_slice(&other[..len]);
484 Self::new_from_array(buf)
485 }
486 pub fn new_from_array(buf: [u8; 8usize]) -> Self {
487 unsafe { std::mem::transmute(buf) }
488 }
489 pub fn as_slice(&self) -> &[u8] {
490 unsafe {
491 let ptr: *const u8 = std::mem::transmute(self as *const Self);
492 std::slice::from_raw_parts(ptr, Self::len())
493 }
494 }
495 pub fn from_slice(buf: &[u8]) -> &Self {
496 assert!(buf.len() >= Self::len());
497 assert!(buf.as_ptr() as usize % std::mem::align_of::<Self>() == 0);
498 unsafe { std::mem::transmute(buf.as_ptr()) }
499 }
500 pub fn as_array(&self) -> &[u8; 8usize] {
501 unsafe { std::mem::transmute(self) }
502 }
503 pub fn from_array(buf: &[u8; 8usize]) -> &Self {
504 assert!(buf.as_ptr() as usize % std::mem::align_of::<Self>() == 0);
505 unsafe { std::mem::transmute(buf) }
506 }
507 pub fn into_array(self) -> [u8; 8usize] {
508 unsafe { std::mem::transmute(self) }
509 }
510 pub const fn len() -> usize {
511 const _: () = assert!(std::mem::size_of::<StaFlagUpdate>() == 8usize);
512 8usize
513 }
514}
515#[derive(Clone)]
516pub enum Nl80211Attrs<'a> {
517 Wiphy(u32),
518 WiphyName(&'a CStr),
519 Ifindex(u32),
520 Ifname(&'a CStr),
521 Iftype(u32),
522 Mac(&'a [u8]),
523 KeyData(&'a [u8]),
524 KeyIdx(u8),
525 KeyCipher(u32),
526 KeySeq(&'a [u8]),
527 KeyDefault(()),
528 BeaconInterval(u32),
529 DtimPeriod(u32),
530 BeaconHead(&'a [u8]),
531 BeaconTail(&'a [u8]),
532 StaAid(u16),
533 StaFlags(&'a [u8]),
534 StaListenInterval(u16),
535 StaSupportedRates(&'a [u8]),
536 StaVlan(u32),
537 StaInfo(&'a [u8]),
538 WiphyBands(IterableWiphyBands<'a>),
539 MntrFlags(&'a [u8]),
540 MeshId(&'a [u8]),
541 StaPlinkAction(u8),
542 MpathNextHop(&'a [u8]),
543 MpathInfo(&'a [u8]),
544 BssCtsProt(u8),
545 BssShortPreamble(u8),
546 BssShortSlotTime(u8),
547 HtCapability(&'a [u8]),
548 SupportedIftypes(IterableSupportedIftypes<'a>),
549 RegAlpha2(&'a [u8]),
550 RegRules(&'a [u8]),
551 MeshConfig(&'a [u8]),
552 BssBasicRates(&'a [u8]),
553 WiphyTxqParams(&'a [u8]),
554 WiphyFreq(u32),
555 #[doc = "Associated type: [`ChannelType`] (enum)"]
556 WiphyChannelType(u32),
557 KeyDefaultMgmt(()),
558 MgmtSubtype(u8),
559 Ie(&'a [u8]),
560 MaxNumScanSsids(u8),
561 ScanFrequencies(&'a [u8]),
562 ScanSsids(&'a [u8]),
563 Generation(u32),
564 Bss(&'a [u8]),
565 RegInitiator(u8),
566 RegType(u8),
567 #[doc = "Associated type: [`Commands`] (enum)"]
568 SupportedCommands(IterableArrayU32<'a>),
569 Frame(&'a [u8]),
570 Ssid(&'a [u8]),
571 AuthType(u32),
572 ReasonCode(u16),
573 KeyType(u32),
574 MaxScanIeLen(u16),
575 CipherSuites(&'a [u8]),
576 FreqBefore(&'a [u8]),
577 FreqAfter(&'a [u8]),
578 FreqFixed(()),
579 WiphyRetryShort(u8),
580 WiphyRetryLong(u8),
581 WiphyFragThreshold(u32),
582 WiphyRtsThreshold(u32),
583 TimedOut(()),
584 UseMfp(u32),
585 StaFlags2(StaFlagUpdate),
586 ControlPort(()),
587 Testdata(&'a [u8]),
588 Privacy(()),
589 DisconnectedByAp(()),
590 StatusCode(u16),
591 CipherSuitesPairwise(&'a [u8]),
592 CipherSuiteGroup(u32),
593 WpaVersions(u32),
594 AkmSuites(&'a [u8]),
595 ReqIe(&'a [u8]),
596 RespIe(&'a [u8]),
597 PrevBssid(&'a [u8]),
598 Key(&'a [u8]),
599 Keys(&'a [u8]),
600 Pid(u32),
601 _4addr(u8),
602 SurveyInfo(&'a [u8]),
603 Pmkid(&'a [u8]),
604 MaxNumPmkids(u8),
605 Duration(u32),
606 Cookie(u64),
607 WiphyCoverageClass(u8),
608 TxRates(&'a [u8]),
609 FrameMatch(&'a [u8]),
610 Ack(()),
611 PsState(u32),
612 Cqm(&'a [u8]),
613 LocalStateChange(()),
614 ApIsolate(u8),
615 WiphyTxPowerSetting(u32),
616 WiphyTxPowerLevel(u32),
617 TxFrameTypes(IterableIftypeAttrs<'a>),
618 RxFrameTypes(IterableIftypeAttrs<'a>),
619 FrameType(u16),
620 ControlPortEthertype(()),
621 ControlPortNoEncrypt(()),
622 SupportIbssRsn(()),
623 WiphyAntennaTx(u32),
624 WiphyAntennaRx(u32),
625 McastRate(u32),
626 OffchannelTxOk(()),
627 BssHtOpmode(u16),
628 KeyDefaultTypes(&'a [u8]),
629 MaxRemainOnChannelDuration(u32),
630 MeshSetup(&'a [u8]),
631 WiphyAntennaAvailTx(u32),
632 WiphyAntennaAvailRx(u32),
633 SupportMeshAuth(()),
634 StaPlinkState(u8),
635 WowlanTriggers(&'a [u8]),
636 WowlanTriggersSupported(IterableWowlanTriggersAttrs<'a>),
637 SchedScanInterval(u32),
638 InterfaceCombinations(IterableArrayIfCombinationAttributes<'a>),
639 SoftwareIftypes(IterableSupportedIftypes<'a>),
640 RekeyData(&'a [u8]),
641 MaxNumSchedScanSsids(u8),
642 MaxSchedScanIeLen(u16),
643 ScanSuppRates(&'a [u8]),
644 HiddenSsid(u32),
645 IeProbeResp(&'a [u8]),
646 IeAssocResp(&'a [u8]),
647 StaWme(&'a [u8]),
648 SupportApUapsd(()),
649 RoamSupport(()),
650 SchedScanMatch(&'a [u8]),
651 MaxMatchSets(u8),
652 PmksaCandidate(&'a [u8]),
653 TxNoCckRate(()),
654 TdlsAction(u8),
655 TdlsDialogToken(u8),
656 TdlsOperation(u8),
657 TdlsSupport(()),
658 TdlsExternalSetup(()),
659 DeviceApSme(u32),
660 DontWaitForAck(()),
661 #[doc = "Associated type: [`FeatureFlags`] (1 bit per enumeration)"]
662 FeatureFlags(u32),
663 ProbeRespOffload(u32),
664 ProbeResp(&'a [u8]),
665 DfsRegion(u8),
666 DisableHt(()),
667 HtCapabilityMask(&'a [u8]),
668 NoackMap(u16),
669 InactivityTimeout(u16),
670 RxSignalDbm(u32),
671 BgScanPeriod(u16),
672 Wdev(u64),
673 UserRegHintType(u32),
674 ConnFailedReason(u32),
675 AuthData(&'a [u8]),
676 VhtCapability(&'a [u8]),
677 ScanFlags(u32),
678 ChannelWidth(u32),
679 CenterFreq1(u32),
680 CenterFreq2(u32),
681 P2pCtwindow(u8),
682 P2pOppps(u8),
683 LocalMeshPowerMode(u32),
684 AclPolicy(u32),
685 MacAddrs(&'a [u8]),
686 MacAclMax(u32),
687 RadarEvent(u32),
688 ExtCapa(&'a [u8]),
689 ExtCapaMask(&'a [u8]),
690 StaCapability(u16),
691 StaExtCapability(&'a [u8]),
692 #[doc = "Associated type: [`ProtocolFeatures`] (enum)"]
693 ProtocolFeatures(u32),
694 SplitWiphyDump(()),
695 DisableVht(()),
696 VhtCapabilityMask(&'a [u8]),
697 Mdid(u16),
698 IeRic(&'a [u8]),
699 CritProtId(u16),
700 MaxCritProtDuration(u16),
701 PeerAid(u16),
702 CoalesceRule(&'a [u8]),
703 ChSwitchCount(u32),
704 ChSwitchBlockTx(()),
705 CsaIes(&'a [u8]),
706 CntdwnOffsBeacon(&'a [u8]),
707 CntdwnOffsPresp(&'a [u8]),
708 RxmgmtFlags(&'a [u8]),
709 StaSupportedChannels(&'a [u8]),
710 StaSupportedOperClasses(&'a [u8]),
711 HandleDfs(()),
712 Support5Mhz(()),
713 Support10Mhz(()),
714 OpmodeNotif(u8),
715 VendorId(u32),
716 VendorSubcmd(u32),
717 VendorData(&'a [u8]),
718 VendorEvents(&'a [u8]),
719 QosMap(&'a [u8]),
720 MacHint(&'a [u8]),
721 WiphyFreqHint(u32),
722 MaxApAssocSta(u32),
723 TdlsPeerCapability(u32),
724 SocketOwner(()),
725 CsaCOffsetsTx(&'a [u8]),
726 MaxCsaCounters(u8),
727 TdlsInitiator(()),
728 UseRrm(()),
729 WiphyDynAck(()),
730 Tsid(u8),
731 UserPrio(u8),
732 AdmittedTime(u16),
733 SmpsMode(u8),
734 OperClass(u8),
735 MacMask(&'a [u8]),
736 WiphySelfManagedReg(()),
737 ExtFeatures(&'a [u8]),
738 SurveyRadioStats(&'a [u8]),
739 NetnsFd(u32),
740 SchedScanDelay(u32),
741 RegIndoor(()),
742 MaxNumSchedScanPlans(u32),
743 MaxScanPlanInterval(u32),
744 MaxScanPlanIterations(u32),
745 SchedScanPlans(&'a [u8]),
746 Pbss(()),
747 BssSelect(&'a [u8]),
748 StaSupportP2pPs(u8),
749 Pad(&'a [u8]),
750 IftypeExtCapa(&'a [u8]),
751 MuMimoGroupData(&'a [u8]),
752 MuMimoFollowMacAddr(&'a [u8]),
753 ScanStartTimeTsf(u64),
754 ScanStartTimeTsfBssid(&'a [u8]),
755 MeasurementDuration(u16),
756 MeasurementDurationMandatory(()),
757 MeshPeerAid(u16),
758 NanMasterPref(u8),
759 Bands(u32),
760 NanFunc(&'a [u8]),
761 NanMatch(&'a [u8]),
762 FilsKek(&'a [u8]),
763 FilsNonces(&'a [u8]),
764 MulticastToUnicastEnabled(()),
765 Bssid(&'a [u8]),
766 SchedScanRelativeRssi(i8),
767 SchedScanRssiAdjust(&'a [u8]),
768 TimeoutReason(u32),
769 FilsErpUsername(&'a [u8]),
770 FilsErpRealm(&'a [u8]),
771 FilsErpNextSeqNum(u16),
772 FilsErpRrk(&'a [u8]),
773 FilsCacheId(&'a [u8]),
774 Pmk(&'a [u8]),
775 SchedScanMulti(()),
776 SchedScanMaxReqs(u32),
777 Want1x4wayHs(()),
778 Pmkr0Name(&'a [u8]),
779 PortAuthorized(&'a [u8]),
780 ExternalAuthAction(u32),
781 ExternalAuthSupport(()),
782 Nss(u8),
783 AckSignal(i32),
784 ControlPortOverNl80211(()),
785 TxqStats(IterableTxqStatsAttrs<'a>),
786 TxqLimit(u32),
787 TxqMemoryLimit(u32),
788 TxqQuantum(u32),
789 HeCapability(&'a [u8]),
790 FtmResponder(&'a [u8]),
791 FtmResponderStats(&'a [u8]),
792 Timeout(u32),
793 PeerMeasurements(&'a [u8]),
794 AirtimeWeight(u16),
795 StaTxPowerSetting(u8),
796 StaTxPower(i16),
797 SaePassword(&'a [u8]),
798 TwtResponder(()),
799 HeObssPd(&'a [u8]),
800 WiphyEdmgChannels(u8),
801 WiphyEdmgBwConfig(u8),
802 VlanId(u16),
803 HeBssColor(&'a [u8]),
804 IftypeAkmSuites(&'a [u8]),
805 TidConfig(&'a [u8]),
806 ControlPortNoPreauth(()),
807 PmkLifetime(u32),
808 PmkReauthThreshold(u8),
809 ReceiveMulticast(()),
810 WiphyFreqOffset(u32),
811 CenterFreq1Offset(u32),
812 ScanFreqKhz(&'a [u8]),
813 He6ghzCapability(&'a [u8]),
814 FilsDiscovery(&'a [u8]),
815 UnsolBcastProbeResp(&'a [u8]),
816 S1gCapability(&'a [u8]),
817 S1gCapabilityMask(&'a [u8]),
818 SaePwe(u8),
819 ReconnectRequested(&'a [u8]),
820 SarSpec(IterableSarAttributes<'a>),
821 DisableHe(()),
822 ObssColorBitmap(u64),
823 ColorChangeCount(u8),
824 ColorChangeColor(u8),
825 ColorChangeElems(&'a [u8]),
826 MbssidConfig(&'a [u8]),
827 MbssidElems(&'a [u8]),
828 RadarBackground(()),
829 ApSettingsFlags(u32),
830 EhtCapability(&'a [u8]),
831 DisableEht(()),
832 MloLinks(&'a [u8]),
833 MloLinkId(u8),
834 MldAddr(&'a [u8]),
835 MloSupport(()),
836 MaxNumAkmSuites(&'a [u8]),
837 EmlCapability(u16),
838 MldCapaAndOps(u16),
839 TxHwTimestamp(u64),
840 RxHwTimestamp(u64),
841 TdBitmap(&'a [u8]),
842 PunctBitmap(u32),
843 MaxHwTimestampPeers(u16),
844 HwTimestampEnabled(()),
845 EmaRnrElems(&'a [u8]),
846 MloLinkDisabled(()),
847 BssDumpIncludeUseData(()),
848 MloTtlmDlink(u16),
849 MloTtlmUlink(u16),
850 AssocSppAmsdu(()),
851 WiphyRadios(&'a [u8]),
852 WiphyInterfaceCombinations(&'a [u8]),
853 VifRadioMask(u32),
854}
855impl<'a> IterableNl80211Attrs<'a> {
856 pub fn get_wiphy(&self) -> Result<u32, ErrorContext> {
857 let mut iter = self.clone();
858 iter.pos = 0;
859 for attr in iter {
860 if let Ok(Nl80211Attrs::Wiphy(val)) = attr {
861 return Ok(val);
862 }
863 }
864 Err(ErrorContext::new_missing(
865 "Nl80211Attrs",
866 "Wiphy",
867 self.orig_loc,
868 self.buf.as_ptr() as usize,
869 ))
870 }
871 pub fn get_wiphy_name(&self) -> Result<&'a CStr, ErrorContext> {
872 let mut iter = self.clone();
873 iter.pos = 0;
874 for attr in iter {
875 if let Ok(Nl80211Attrs::WiphyName(val)) = attr {
876 return Ok(val);
877 }
878 }
879 Err(ErrorContext::new_missing(
880 "Nl80211Attrs",
881 "WiphyName",
882 self.orig_loc,
883 self.buf.as_ptr() as usize,
884 ))
885 }
886 pub fn get_ifindex(&self) -> Result<u32, ErrorContext> {
887 let mut iter = self.clone();
888 iter.pos = 0;
889 for attr in iter {
890 if let Ok(Nl80211Attrs::Ifindex(val)) = attr {
891 return Ok(val);
892 }
893 }
894 Err(ErrorContext::new_missing(
895 "Nl80211Attrs",
896 "Ifindex",
897 self.orig_loc,
898 self.buf.as_ptr() as usize,
899 ))
900 }
901 pub fn get_ifname(&self) -> Result<&'a CStr, ErrorContext> {
902 let mut iter = self.clone();
903 iter.pos = 0;
904 for attr in iter {
905 if let Ok(Nl80211Attrs::Ifname(val)) = attr {
906 return Ok(val);
907 }
908 }
909 Err(ErrorContext::new_missing(
910 "Nl80211Attrs",
911 "Ifname",
912 self.orig_loc,
913 self.buf.as_ptr() as usize,
914 ))
915 }
916 pub fn get_iftype(&self) -> Result<u32, ErrorContext> {
917 let mut iter = self.clone();
918 iter.pos = 0;
919 for attr in iter {
920 if let Ok(Nl80211Attrs::Iftype(val)) = attr {
921 return Ok(val);
922 }
923 }
924 Err(ErrorContext::new_missing(
925 "Nl80211Attrs",
926 "Iftype",
927 self.orig_loc,
928 self.buf.as_ptr() as usize,
929 ))
930 }
931 pub fn get_mac(&self) -> Result<&'a [u8], ErrorContext> {
932 let mut iter = self.clone();
933 iter.pos = 0;
934 for attr in iter {
935 if let Ok(Nl80211Attrs::Mac(val)) = attr {
936 return Ok(val);
937 }
938 }
939 Err(ErrorContext::new_missing(
940 "Nl80211Attrs",
941 "Mac",
942 self.orig_loc,
943 self.buf.as_ptr() as usize,
944 ))
945 }
946 pub fn get_key_data(&self) -> Result<&'a [u8], ErrorContext> {
947 let mut iter = self.clone();
948 iter.pos = 0;
949 for attr in iter {
950 if let Ok(Nl80211Attrs::KeyData(val)) = attr {
951 return Ok(val);
952 }
953 }
954 Err(ErrorContext::new_missing(
955 "Nl80211Attrs",
956 "KeyData",
957 self.orig_loc,
958 self.buf.as_ptr() as usize,
959 ))
960 }
961 pub fn get_key_idx(&self) -> Result<u8, ErrorContext> {
962 let mut iter = self.clone();
963 iter.pos = 0;
964 for attr in iter {
965 if let Ok(Nl80211Attrs::KeyIdx(val)) = attr {
966 return Ok(val);
967 }
968 }
969 Err(ErrorContext::new_missing(
970 "Nl80211Attrs",
971 "KeyIdx",
972 self.orig_loc,
973 self.buf.as_ptr() as usize,
974 ))
975 }
976 pub fn get_key_cipher(&self) -> Result<u32, ErrorContext> {
977 let mut iter = self.clone();
978 iter.pos = 0;
979 for attr in iter {
980 if let Ok(Nl80211Attrs::KeyCipher(val)) = attr {
981 return Ok(val);
982 }
983 }
984 Err(ErrorContext::new_missing(
985 "Nl80211Attrs",
986 "KeyCipher",
987 self.orig_loc,
988 self.buf.as_ptr() as usize,
989 ))
990 }
991 pub fn get_key_seq(&self) -> Result<&'a [u8], ErrorContext> {
992 let mut iter = self.clone();
993 iter.pos = 0;
994 for attr in iter {
995 if let Ok(Nl80211Attrs::KeySeq(val)) = attr {
996 return Ok(val);
997 }
998 }
999 Err(ErrorContext::new_missing(
1000 "Nl80211Attrs",
1001 "KeySeq",
1002 self.orig_loc,
1003 self.buf.as_ptr() as usize,
1004 ))
1005 }
1006 pub fn get_key_default(&self) -> Result<(), ErrorContext> {
1007 let mut iter = self.clone();
1008 iter.pos = 0;
1009 for attr in iter {
1010 if let Ok(Nl80211Attrs::KeyDefault(val)) = attr {
1011 return Ok(val);
1012 }
1013 }
1014 Err(ErrorContext::new_missing(
1015 "Nl80211Attrs",
1016 "KeyDefault",
1017 self.orig_loc,
1018 self.buf.as_ptr() as usize,
1019 ))
1020 }
1021 pub fn get_beacon_interval(&self) -> Result<u32, ErrorContext> {
1022 let mut iter = self.clone();
1023 iter.pos = 0;
1024 for attr in iter {
1025 if let Ok(Nl80211Attrs::BeaconInterval(val)) = attr {
1026 return Ok(val);
1027 }
1028 }
1029 Err(ErrorContext::new_missing(
1030 "Nl80211Attrs",
1031 "BeaconInterval",
1032 self.orig_loc,
1033 self.buf.as_ptr() as usize,
1034 ))
1035 }
1036 pub fn get_dtim_period(&self) -> Result<u32, ErrorContext> {
1037 let mut iter = self.clone();
1038 iter.pos = 0;
1039 for attr in iter {
1040 if let Ok(Nl80211Attrs::DtimPeriod(val)) = attr {
1041 return Ok(val);
1042 }
1043 }
1044 Err(ErrorContext::new_missing(
1045 "Nl80211Attrs",
1046 "DtimPeriod",
1047 self.orig_loc,
1048 self.buf.as_ptr() as usize,
1049 ))
1050 }
1051 pub fn get_beacon_head(&self) -> Result<&'a [u8], ErrorContext> {
1052 let mut iter = self.clone();
1053 iter.pos = 0;
1054 for attr in iter {
1055 if let Ok(Nl80211Attrs::BeaconHead(val)) = attr {
1056 return Ok(val);
1057 }
1058 }
1059 Err(ErrorContext::new_missing(
1060 "Nl80211Attrs",
1061 "BeaconHead",
1062 self.orig_loc,
1063 self.buf.as_ptr() as usize,
1064 ))
1065 }
1066 pub fn get_beacon_tail(&self) -> Result<&'a [u8], ErrorContext> {
1067 let mut iter = self.clone();
1068 iter.pos = 0;
1069 for attr in iter {
1070 if let Ok(Nl80211Attrs::BeaconTail(val)) = attr {
1071 return Ok(val);
1072 }
1073 }
1074 Err(ErrorContext::new_missing(
1075 "Nl80211Attrs",
1076 "BeaconTail",
1077 self.orig_loc,
1078 self.buf.as_ptr() as usize,
1079 ))
1080 }
1081 pub fn get_sta_aid(&self) -> Result<u16, ErrorContext> {
1082 let mut iter = self.clone();
1083 iter.pos = 0;
1084 for attr in iter {
1085 if let Ok(Nl80211Attrs::StaAid(val)) = attr {
1086 return Ok(val);
1087 }
1088 }
1089 Err(ErrorContext::new_missing(
1090 "Nl80211Attrs",
1091 "StaAid",
1092 self.orig_loc,
1093 self.buf.as_ptr() as usize,
1094 ))
1095 }
1096 pub fn get_sta_flags(&self) -> Result<&'a [u8], ErrorContext> {
1097 let mut iter = self.clone();
1098 iter.pos = 0;
1099 for attr in iter {
1100 if let Ok(Nl80211Attrs::StaFlags(val)) = attr {
1101 return Ok(val);
1102 }
1103 }
1104 Err(ErrorContext::new_missing(
1105 "Nl80211Attrs",
1106 "StaFlags",
1107 self.orig_loc,
1108 self.buf.as_ptr() as usize,
1109 ))
1110 }
1111 pub fn get_sta_listen_interval(&self) -> Result<u16, ErrorContext> {
1112 let mut iter = self.clone();
1113 iter.pos = 0;
1114 for attr in iter {
1115 if let Ok(Nl80211Attrs::StaListenInterval(val)) = attr {
1116 return Ok(val);
1117 }
1118 }
1119 Err(ErrorContext::new_missing(
1120 "Nl80211Attrs",
1121 "StaListenInterval",
1122 self.orig_loc,
1123 self.buf.as_ptr() as usize,
1124 ))
1125 }
1126 pub fn get_sta_supported_rates(&self) -> Result<&'a [u8], ErrorContext> {
1127 let mut iter = self.clone();
1128 iter.pos = 0;
1129 for attr in iter {
1130 if let Ok(Nl80211Attrs::StaSupportedRates(val)) = attr {
1131 return Ok(val);
1132 }
1133 }
1134 Err(ErrorContext::new_missing(
1135 "Nl80211Attrs",
1136 "StaSupportedRates",
1137 self.orig_loc,
1138 self.buf.as_ptr() as usize,
1139 ))
1140 }
1141 pub fn get_sta_vlan(&self) -> Result<u32, ErrorContext> {
1142 let mut iter = self.clone();
1143 iter.pos = 0;
1144 for attr in iter {
1145 if let Ok(Nl80211Attrs::StaVlan(val)) = attr {
1146 return Ok(val);
1147 }
1148 }
1149 Err(ErrorContext::new_missing(
1150 "Nl80211Attrs",
1151 "StaVlan",
1152 self.orig_loc,
1153 self.buf.as_ptr() as usize,
1154 ))
1155 }
1156 pub fn get_sta_info(&self) -> Result<&'a [u8], ErrorContext> {
1157 let mut iter = self.clone();
1158 iter.pos = 0;
1159 for attr in iter {
1160 if let Ok(Nl80211Attrs::StaInfo(val)) = attr {
1161 return Ok(val);
1162 }
1163 }
1164 Err(ErrorContext::new_missing(
1165 "Nl80211Attrs",
1166 "StaInfo",
1167 self.orig_loc,
1168 self.buf.as_ptr() as usize,
1169 ))
1170 }
1171 pub fn get_wiphy_bands(&self) -> Result<IterableWiphyBands<'a>, ErrorContext> {
1172 let mut iter = self.clone();
1173 iter.pos = 0;
1174 for attr in iter {
1175 if let Ok(Nl80211Attrs::WiphyBands(val)) = attr {
1176 return Ok(val);
1177 }
1178 }
1179 Err(ErrorContext::new_missing(
1180 "Nl80211Attrs",
1181 "WiphyBands",
1182 self.orig_loc,
1183 self.buf.as_ptr() as usize,
1184 ))
1185 }
1186 pub fn get_mntr_flags(&self) -> Result<&'a [u8], ErrorContext> {
1187 let mut iter = self.clone();
1188 iter.pos = 0;
1189 for attr in iter {
1190 if let Ok(Nl80211Attrs::MntrFlags(val)) = attr {
1191 return Ok(val);
1192 }
1193 }
1194 Err(ErrorContext::new_missing(
1195 "Nl80211Attrs",
1196 "MntrFlags",
1197 self.orig_loc,
1198 self.buf.as_ptr() as usize,
1199 ))
1200 }
1201 pub fn get_mesh_id(&self) -> Result<&'a [u8], ErrorContext> {
1202 let mut iter = self.clone();
1203 iter.pos = 0;
1204 for attr in iter {
1205 if let Ok(Nl80211Attrs::MeshId(val)) = attr {
1206 return Ok(val);
1207 }
1208 }
1209 Err(ErrorContext::new_missing(
1210 "Nl80211Attrs",
1211 "MeshId",
1212 self.orig_loc,
1213 self.buf.as_ptr() as usize,
1214 ))
1215 }
1216 pub fn get_sta_plink_action(&self) -> Result<u8, ErrorContext> {
1217 let mut iter = self.clone();
1218 iter.pos = 0;
1219 for attr in iter {
1220 if let Ok(Nl80211Attrs::StaPlinkAction(val)) = attr {
1221 return Ok(val);
1222 }
1223 }
1224 Err(ErrorContext::new_missing(
1225 "Nl80211Attrs",
1226 "StaPlinkAction",
1227 self.orig_loc,
1228 self.buf.as_ptr() as usize,
1229 ))
1230 }
1231 pub fn get_mpath_next_hop(&self) -> Result<&'a [u8], ErrorContext> {
1232 let mut iter = self.clone();
1233 iter.pos = 0;
1234 for attr in iter {
1235 if let Ok(Nl80211Attrs::MpathNextHop(val)) = attr {
1236 return Ok(val);
1237 }
1238 }
1239 Err(ErrorContext::new_missing(
1240 "Nl80211Attrs",
1241 "MpathNextHop",
1242 self.orig_loc,
1243 self.buf.as_ptr() as usize,
1244 ))
1245 }
1246 pub fn get_mpath_info(&self) -> Result<&'a [u8], ErrorContext> {
1247 let mut iter = self.clone();
1248 iter.pos = 0;
1249 for attr in iter {
1250 if let Ok(Nl80211Attrs::MpathInfo(val)) = attr {
1251 return Ok(val);
1252 }
1253 }
1254 Err(ErrorContext::new_missing(
1255 "Nl80211Attrs",
1256 "MpathInfo",
1257 self.orig_loc,
1258 self.buf.as_ptr() as usize,
1259 ))
1260 }
1261 pub fn get_bss_cts_prot(&self) -> Result<u8, ErrorContext> {
1262 let mut iter = self.clone();
1263 iter.pos = 0;
1264 for attr in iter {
1265 if let Ok(Nl80211Attrs::BssCtsProt(val)) = attr {
1266 return Ok(val);
1267 }
1268 }
1269 Err(ErrorContext::new_missing(
1270 "Nl80211Attrs",
1271 "BssCtsProt",
1272 self.orig_loc,
1273 self.buf.as_ptr() as usize,
1274 ))
1275 }
1276 pub fn get_bss_short_preamble(&self) -> Result<u8, ErrorContext> {
1277 let mut iter = self.clone();
1278 iter.pos = 0;
1279 for attr in iter {
1280 if let Ok(Nl80211Attrs::BssShortPreamble(val)) = attr {
1281 return Ok(val);
1282 }
1283 }
1284 Err(ErrorContext::new_missing(
1285 "Nl80211Attrs",
1286 "BssShortPreamble",
1287 self.orig_loc,
1288 self.buf.as_ptr() as usize,
1289 ))
1290 }
1291 pub fn get_bss_short_slot_time(&self) -> Result<u8, ErrorContext> {
1292 let mut iter = self.clone();
1293 iter.pos = 0;
1294 for attr in iter {
1295 if let Ok(Nl80211Attrs::BssShortSlotTime(val)) = attr {
1296 return Ok(val);
1297 }
1298 }
1299 Err(ErrorContext::new_missing(
1300 "Nl80211Attrs",
1301 "BssShortSlotTime",
1302 self.orig_loc,
1303 self.buf.as_ptr() as usize,
1304 ))
1305 }
1306 pub fn get_ht_capability(&self) -> Result<&'a [u8], ErrorContext> {
1307 let mut iter = self.clone();
1308 iter.pos = 0;
1309 for attr in iter {
1310 if let Ok(Nl80211Attrs::HtCapability(val)) = attr {
1311 return Ok(val);
1312 }
1313 }
1314 Err(ErrorContext::new_missing(
1315 "Nl80211Attrs",
1316 "HtCapability",
1317 self.orig_loc,
1318 self.buf.as_ptr() as usize,
1319 ))
1320 }
1321 pub fn get_supported_iftypes(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
1322 let mut iter = self.clone();
1323 iter.pos = 0;
1324 for attr in iter {
1325 if let Ok(Nl80211Attrs::SupportedIftypes(val)) = attr {
1326 return Ok(val);
1327 }
1328 }
1329 Err(ErrorContext::new_missing(
1330 "Nl80211Attrs",
1331 "SupportedIftypes",
1332 self.orig_loc,
1333 self.buf.as_ptr() as usize,
1334 ))
1335 }
1336 pub fn get_reg_alpha2(&self) -> Result<&'a [u8], ErrorContext> {
1337 let mut iter = self.clone();
1338 iter.pos = 0;
1339 for attr in iter {
1340 if let Ok(Nl80211Attrs::RegAlpha2(val)) = attr {
1341 return Ok(val);
1342 }
1343 }
1344 Err(ErrorContext::new_missing(
1345 "Nl80211Attrs",
1346 "RegAlpha2",
1347 self.orig_loc,
1348 self.buf.as_ptr() as usize,
1349 ))
1350 }
1351 pub fn get_reg_rules(&self) -> Result<&'a [u8], ErrorContext> {
1352 let mut iter = self.clone();
1353 iter.pos = 0;
1354 for attr in iter {
1355 if let Ok(Nl80211Attrs::RegRules(val)) = attr {
1356 return Ok(val);
1357 }
1358 }
1359 Err(ErrorContext::new_missing(
1360 "Nl80211Attrs",
1361 "RegRules",
1362 self.orig_loc,
1363 self.buf.as_ptr() as usize,
1364 ))
1365 }
1366 pub fn get_mesh_config(&self) -> Result<&'a [u8], ErrorContext> {
1367 let mut iter = self.clone();
1368 iter.pos = 0;
1369 for attr in iter {
1370 if let Ok(Nl80211Attrs::MeshConfig(val)) = attr {
1371 return Ok(val);
1372 }
1373 }
1374 Err(ErrorContext::new_missing(
1375 "Nl80211Attrs",
1376 "MeshConfig",
1377 self.orig_loc,
1378 self.buf.as_ptr() as usize,
1379 ))
1380 }
1381 pub fn get_bss_basic_rates(&self) -> Result<&'a [u8], ErrorContext> {
1382 let mut iter = self.clone();
1383 iter.pos = 0;
1384 for attr in iter {
1385 if let Ok(Nl80211Attrs::BssBasicRates(val)) = attr {
1386 return Ok(val);
1387 }
1388 }
1389 Err(ErrorContext::new_missing(
1390 "Nl80211Attrs",
1391 "BssBasicRates",
1392 self.orig_loc,
1393 self.buf.as_ptr() as usize,
1394 ))
1395 }
1396 pub fn get_wiphy_txq_params(&self) -> Result<&'a [u8], ErrorContext> {
1397 let mut iter = self.clone();
1398 iter.pos = 0;
1399 for attr in iter {
1400 if let Ok(Nl80211Attrs::WiphyTxqParams(val)) = attr {
1401 return Ok(val);
1402 }
1403 }
1404 Err(ErrorContext::new_missing(
1405 "Nl80211Attrs",
1406 "WiphyTxqParams",
1407 self.orig_loc,
1408 self.buf.as_ptr() as usize,
1409 ))
1410 }
1411 pub fn get_wiphy_freq(&self) -> Result<u32, ErrorContext> {
1412 let mut iter = self.clone();
1413 iter.pos = 0;
1414 for attr in iter {
1415 if let Ok(Nl80211Attrs::WiphyFreq(val)) = attr {
1416 return Ok(val);
1417 }
1418 }
1419 Err(ErrorContext::new_missing(
1420 "Nl80211Attrs",
1421 "WiphyFreq",
1422 self.orig_loc,
1423 self.buf.as_ptr() as usize,
1424 ))
1425 }
1426 #[doc = "Associated type: [`ChannelType`] (enum)"]
1427 pub fn get_wiphy_channel_type(&self) -> Result<u32, ErrorContext> {
1428 let mut iter = self.clone();
1429 iter.pos = 0;
1430 for attr in iter {
1431 if let Ok(Nl80211Attrs::WiphyChannelType(val)) = attr {
1432 return Ok(val);
1433 }
1434 }
1435 Err(ErrorContext::new_missing(
1436 "Nl80211Attrs",
1437 "WiphyChannelType",
1438 self.orig_loc,
1439 self.buf.as_ptr() as usize,
1440 ))
1441 }
1442 pub fn get_key_default_mgmt(&self) -> Result<(), ErrorContext> {
1443 let mut iter = self.clone();
1444 iter.pos = 0;
1445 for attr in iter {
1446 if let Ok(Nl80211Attrs::KeyDefaultMgmt(val)) = attr {
1447 return Ok(val);
1448 }
1449 }
1450 Err(ErrorContext::new_missing(
1451 "Nl80211Attrs",
1452 "KeyDefaultMgmt",
1453 self.orig_loc,
1454 self.buf.as_ptr() as usize,
1455 ))
1456 }
1457 pub fn get_mgmt_subtype(&self) -> Result<u8, ErrorContext> {
1458 let mut iter = self.clone();
1459 iter.pos = 0;
1460 for attr in iter {
1461 if let Ok(Nl80211Attrs::MgmtSubtype(val)) = attr {
1462 return Ok(val);
1463 }
1464 }
1465 Err(ErrorContext::new_missing(
1466 "Nl80211Attrs",
1467 "MgmtSubtype",
1468 self.orig_loc,
1469 self.buf.as_ptr() as usize,
1470 ))
1471 }
1472 pub fn get_ie(&self) -> Result<&'a [u8], ErrorContext> {
1473 let mut iter = self.clone();
1474 iter.pos = 0;
1475 for attr in iter {
1476 if let Ok(Nl80211Attrs::Ie(val)) = attr {
1477 return Ok(val);
1478 }
1479 }
1480 Err(ErrorContext::new_missing(
1481 "Nl80211Attrs",
1482 "Ie",
1483 self.orig_loc,
1484 self.buf.as_ptr() as usize,
1485 ))
1486 }
1487 pub fn get_max_num_scan_ssids(&self) -> Result<u8, ErrorContext> {
1488 let mut iter = self.clone();
1489 iter.pos = 0;
1490 for attr in iter {
1491 if let Ok(Nl80211Attrs::MaxNumScanSsids(val)) = attr {
1492 return Ok(val);
1493 }
1494 }
1495 Err(ErrorContext::new_missing(
1496 "Nl80211Attrs",
1497 "MaxNumScanSsids",
1498 self.orig_loc,
1499 self.buf.as_ptr() as usize,
1500 ))
1501 }
1502 pub fn get_scan_frequencies(&self) -> Result<&'a [u8], ErrorContext> {
1503 let mut iter = self.clone();
1504 iter.pos = 0;
1505 for attr in iter {
1506 if let Ok(Nl80211Attrs::ScanFrequencies(val)) = attr {
1507 return Ok(val);
1508 }
1509 }
1510 Err(ErrorContext::new_missing(
1511 "Nl80211Attrs",
1512 "ScanFrequencies",
1513 self.orig_loc,
1514 self.buf.as_ptr() as usize,
1515 ))
1516 }
1517 pub fn get_scan_ssids(&self) -> Result<&'a [u8], ErrorContext> {
1518 let mut iter = self.clone();
1519 iter.pos = 0;
1520 for attr in iter {
1521 if let Ok(Nl80211Attrs::ScanSsids(val)) = attr {
1522 return Ok(val);
1523 }
1524 }
1525 Err(ErrorContext::new_missing(
1526 "Nl80211Attrs",
1527 "ScanSsids",
1528 self.orig_loc,
1529 self.buf.as_ptr() as usize,
1530 ))
1531 }
1532 pub fn get_generation(&self) -> Result<u32, ErrorContext> {
1533 let mut iter = self.clone();
1534 iter.pos = 0;
1535 for attr in iter {
1536 if let Ok(Nl80211Attrs::Generation(val)) = attr {
1537 return Ok(val);
1538 }
1539 }
1540 Err(ErrorContext::new_missing(
1541 "Nl80211Attrs",
1542 "Generation",
1543 self.orig_loc,
1544 self.buf.as_ptr() as usize,
1545 ))
1546 }
1547 pub fn get_bss(&self) -> Result<&'a [u8], ErrorContext> {
1548 let mut iter = self.clone();
1549 iter.pos = 0;
1550 for attr in iter {
1551 if let Ok(Nl80211Attrs::Bss(val)) = attr {
1552 return Ok(val);
1553 }
1554 }
1555 Err(ErrorContext::new_missing(
1556 "Nl80211Attrs",
1557 "Bss",
1558 self.orig_loc,
1559 self.buf.as_ptr() as usize,
1560 ))
1561 }
1562 pub fn get_reg_initiator(&self) -> Result<u8, ErrorContext> {
1563 let mut iter = self.clone();
1564 iter.pos = 0;
1565 for attr in iter {
1566 if let Ok(Nl80211Attrs::RegInitiator(val)) = attr {
1567 return Ok(val);
1568 }
1569 }
1570 Err(ErrorContext::new_missing(
1571 "Nl80211Attrs",
1572 "RegInitiator",
1573 self.orig_loc,
1574 self.buf.as_ptr() as usize,
1575 ))
1576 }
1577 pub fn get_reg_type(&self) -> Result<u8, ErrorContext> {
1578 let mut iter = self.clone();
1579 iter.pos = 0;
1580 for attr in iter {
1581 if let Ok(Nl80211Attrs::RegType(val)) = attr {
1582 return Ok(val);
1583 }
1584 }
1585 Err(ErrorContext::new_missing(
1586 "Nl80211Attrs",
1587 "RegType",
1588 self.orig_loc,
1589 self.buf.as_ptr() as usize,
1590 ))
1591 }
1592 #[doc = "Associated type: [`Commands`] (enum)"]
1593 pub fn get_supported_commands(
1594 &self,
1595 ) -> Result<ArrayIterable<IterableArrayU32<'a>, u32>, ErrorContext> {
1596 for attr in self.clone() {
1597 if let Ok(Nl80211Attrs::SupportedCommands(val)) = attr {
1598 return Ok(ArrayIterable::new(val));
1599 }
1600 }
1601 Err(ErrorContext::new_missing(
1602 "Nl80211Attrs",
1603 "SupportedCommands",
1604 self.orig_loc,
1605 self.buf.as_ptr() as usize,
1606 ))
1607 }
1608 pub fn get_frame(&self) -> Result<&'a [u8], ErrorContext> {
1609 let mut iter = self.clone();
1610 iter.pos = 0;
1611 for attr in iter {
1612 if let Ok(Nl80211Attrs::Frame(val)) = attr {
1613 return Ok(val);
1614 }
1615 }
1616 Err(ErrorContext::new_missing(
1617 "Nl80211Attrs",
1618 "Frame",
1619 self.orig_loc,
1620 self.buf.as_ptr() as usize,
1621 ))
1622 }
1623 pub fn get_ssid(&self) -> Result<&'a [u8], ErrorContext> {
1624 let mut iter = self.clone();
1625 iter.pos = 0;
1626 for attr in iter {
1627 if let Ok(Nl80211Attrs::Ssid(val)) = attr {
1628 return Ok(val);
1629 }
1630 }
1631 Err(ErrorContext::new_missing(
1632 "Nl80211Attrs",
1633 "Ssid",
1634 self.orig_loc,
1635 self.buf.as_ptr() as usize,
1636 ))
1637 }
1638 pub fn get_auth_type(&self) -> Result<u32, ErrorContext> {
1639 let mut iter = self.clone();
1640 iter.pos = 0;
1641 for attr in iter {
1642 if let Ok(Nl80211Attrs::AuthType(val)) = attr {
1643 return Ok(val);
1644 }
1645 }
1646 Err(ErrorContext::new_missing(
1647 "Nl80211Attrs",
1648 "AuthType",
1649 self.orig_loc,
1650 self.buf.as_ptr() as usize,
1651 ))
1652 }
1653 pub fn get_reason_code(&self) -> Result<u16, ErrorContext> {
1654 let mut iter = self.clone();
1655 iter.pos = 0;
1656 for attr in iter {
1657 if let Ok(Nl80211Attrs::ReasonCode(val)) = attr {
1658 return Ok(val);
1659 }
1660 }
1661 Err(ErrorContext::new_missing(
1662 "Nl80211Attrs",
1663 "ReasonCode",
1664 self.orig_loc,
1665 self.buf.as_ptr() as usize,
1666 ))
1667 }
1668 pub fn get_key_type(&self) -> Result<u32, ErrorContext> {
1669 let mut iter = self.clone();
1670 iter.pos = 0;
1671 for attr in iter {
1672 if let Ok(Nl80211Attrs::KeyType(val)) = attr {
1673 return Ok(val);
1674 }
1675 }
1676 Err(ErrorContext::new_missing(
1677 "Nl80211Attrs",
1678 "KeyType",
1679 self.orig_loc,
1680 self.buf.as_ptr() as usize,
1681 ))
1682 }
1683 pub fn get_max_scan_ie_len(&self) -> Result<u16, ErrorContext> {
1684 let mut iter = self.clone();
1685 iter.pos = 0;
1686 for attr in iter {
1687 if let Ok(Nl80211Attrs::MaxScanIeLen(val)) = attr {
1688 return Ok(val);
1689 }
1690 }
1691 Err(ErrorContext::new_missing(
1692 "Nl80211Attrs",
1693 "MaxScanIeLen",
1694 self.orig_loc,
1695 self.buf.as_ptr() as usize,
1696 ))
1697 }
1698 pub fn get_cipher_suites(&self) -> Result<&'a [u8], ErrorContext> {
1699 let mut iter = self.clone();
1700 iter.pos = 0;
1701 for attr in iter {
1702 if let Ok(Nl80211Attrs::CipherSuites(val)) = attr {
1703 return Ok(val);
1704 }
1705 }
1706 Err(ErrorContext::new_missing(
1707 "Nl80211Attrs",
1708 "CipherSuites",
1709 self.orig_loc,
1710 self.buf.as_ptr() as usize,
1711 ))
1712 }
1713 pub fn get_freq_before(&self) -> Result<&'a [u8], ErrorContext> {
1714 let mut iter = self.clone();
1715 iter.pos = 0;
1716 for attr in iter {
1717 if let Ok(Nl80211Attrs::FreqBefore(val)) = attr {
1718 return Ok(val);
1719 }
1720 }
1721 Err(ErrorContext::new_missing(
1722 "Nl80211Attrs",
1723 "FreqBefore",
1724 self.orig_loc,
1725 self.buf.as_ptr() as usize,
1726 ))
1727 }
1728 pub fn get_freq_after(&self) -> Result<&'a [u8], ErrorContext> {
1729 let mut iter = self.clone();
1730 iter.pos = 0;
1731 for attr in iter {
1732 if let Ok(Nl80211Attrs::FreqAfter(val)) = attr {
1733 return Ok(val);
1734 }
1735 }
1736 Err(ErrorContext::new_missing(
1737 "Nl80211Attrs",
1738 "FreqAfter",
1739 self.orig_loc,
1740 self.buf.as_ptr() as usize,
1741 ))
1742 }
1743 pub fn get_freq_fixed(&self) -> Result<(), ErrorContext> {
1744 let mut iter = self.clone();
1745 iter.pos = 0;
1746 for attr in iter {
1747 if let Ok(Nl80211Attrs::FreqFixed(val)) = attr {
1748 return Ok(val);
1749 }
1750 }
1751 Err(ErrorContext::new_missing(
1752 "Nl80211Attrs",
1753 "FreqFixed",
1754 self.orig_loc,
1755 self.buf.as_ptr() as usize,
1756 ))
1757 }
1758 pub fn get_wiphy_retry_short(&self) -> Result<u8, ErrorContext> {
1759 let mut iter = self.clone();
1760 iter.pos = 0;
1761 for attr in iter {
1762 if let Ok(Nl80211Attrs::WiphyRetryShort(val)) = attr {
1763 return Ok(val);
1764 }
1765 }
1766 Err(ErrorContext::new_missing(
1767 "Nl80211Attrs",
1768 "WiphyRetryShort",
1769 self.orig_loc,
1770 self.buf.as_ptr() as usize,
1771 ))
1772 }
1773 pub fn get_wiphy_retry_long(&self) -> Result<u8, ErrorContext> {
1774 let mut iter = self.clone();
1775 iter.pos = 0;
1776 for attr in iter {
1777 if let Ok(Nl80211Attrs::WiphyRetryLong(val)) = attr {
1778 return Ok(val);
1779 }
1780 }
1781 Err(ErrorContext::new_missing(
1782 "Nl80211Attrs",
1783 "WiphyRetryLong",
1784 self.orig_loc,
1785 self.buf.as_ptr() as usize,
1786 ))
1787 }
1788 pub fn get_wiphy_frag_threshold(&self) -> Result<u32, ErrorContext> {
1789 let mut iter = self.clone();
1790 iter.pos = 0;
1791 for attr in iter {
1792 if let Ok(Nl80211Attrs::WiphyFragThreshold(val)) = attr {
1793 return Ok(val);
1794 }
1795 }
1796 Err(ErrorContext::new_missing(
1797 "Nl80211Attrs",
1798 "WiphyFragThreshold",
1799 self.orig_loc,
1800 self.buf.as_ptr() as usize,
1801 ))
1802 }
1803 pub fn get_wiphy_rts_threshold(&self) -> Result<u32, ErrorContext> {
1804 let mut iter = self.clone();
1805 iter.pos = 0;
1806 for attr in iter {
1807 if let Ok(Nl80211Attrs::WiphyRtsThreshold(val)) = attr {
1808 return Ok(val);
1809 }
1810 }
1811 Err(ErrorContext::new_missing(
1812 "Nl80211Attrs",
1813 "WiphyRtsThreshold",
1814 self.orig_loc,
1815 self.buf.as_ptr() as usize,
1816 ))
1817 }
1818 pub fn get_timed_out(&self) -> Result<(), ErrorContext> {
1819 let mut iter = self.clone();
1820 iter.pos = 0;
1821 for attr in iter {
1822 if let Ok(Nl80211Attrs::TimedOut(val)) = attr {
1823 return Ok(val);
1824 }
1825 }
1826 Err(ErrorContext::new_missing(
1827 "Nl80211Attrs",
1828 "TimedOut",
1829 self.orig_loc,
1830 self.buf.as_ptr() as usize,
1831 ))
1832 }
1833 pub fn get_use_mfp(&self) -> Result<u32, ErrorContext> {
1834 let mut iter = self.clone();
1835 iter.pos = 0;
1836 for attr in iter {
1837 if let Ok(Nl80211Attrs::UseMfp(val)) = attr {
1838 return Ok(val);
1839 }
1840 }
1841 Err(ErrorContext::new_missing(
1842 "Nl80211Attrs",
1843 "UseMfp",
1844 self.orig_loc,
1845 self.buf.as_ptr() as usize,
1846 ))
1847 }
1848 pub fn get_sta_flags2(&self) -> Result<StaFlagUpdate, ErrorContext> {
1849 let mut iter = self.clone();
1850 iter.pos = 0;
1851 for attr in iter {
1852 if let Ok(Nl80211Attrs::StaFlags2(val)) = attr {
1853 return Ok(val);
1854 }
1855 }
1856 Err(ErrorContext::new_missing(
1857 "Nl80211Attrs",
1858 "StaFlags2",
1859 self.orig_loc,
1860 self.buf.as_ptr() as usize,
1861 ))
1862 }
1863 pub fn get_control_port(&self) -> Result<(), ErrorContext> {
1864 let mut iter = self.clone();
1865 iter.pos = 0;
1866 for attr in iter {
1867 if let Ok(Nl80211Attrs::ControlPort(val)) = attr {
1868 return Ok(val);
1869 }
1870 }
1871 Err(ErrorContext::new_missing(
1872 "Nl80211Attrs",
1873 "ControlPort",
1874 self.orig_loc,
1875 self.buf.as_ptr() as usize,
1876 ))
1877 }
1878 pub fn get_testdata(&self) -> Result<&'a [u8], ErrorContext> {
1879 let mut iter = self.clone();
1880 iter.pos = 0;
1881 for attr in iter {
1882 if let Ok(Nl80211Attrs::Testdata(val)) = attr {
1883 return Ok(val);
1884 }
1885 }
1886 Err(ErrorContext::new_missing(
1887 "Nl80211Attrs",
1888 "Testdata",
1889 self.orig_loc,
1890 self.buf.as_ptr() as usize,
1891 ))
1892 }
1893 pub fn get_privacy(&self) -> Result<(), ErrorContext> {
1894 let mut iter = self.clone();
1895 iter.pos = 0;
1896 for attr in iter {
1897 if let Ok(Nl80211Attrs::Privacy(val)) = attr {
1898 return Ok(val);
1899 }
1900 }
1901 Err(ErrorContext::new_missing(
1902 "Nl80211Attrs",
1903 "Privacy",
1904 self.orig_loc,
1905 self.buf.as_ptr() as usize,
1906 ))
1907 }
1908 pub fn get_disconnected_by_ap(&self) -> Result<(), ErrorContext> {
1909 let mut iter = self.clone();
1910 iter.pos = 0;
1911 for attr in iter {
1912 if let Ok(Nl80211Attrs::DisconnectedByAp(val)) = attr {
1913 return Ok(val);
1914 }
1915 }
1916 Err(ErrorContext::new_missing(
1917 "Nl80211Attrs",
1918 "DisconnectedByAp",
1919 self.orig_loc,
1920 self.buf.as_ptr() as usize,
1921 ))
1922 }
1923 pub fn get_status_code(&self) -> Result<u16, ErrorContext> {
1924 let mut iter = self.clone();
1925 iter.pos = 0;
1926 for attr in iter {
1927 if let Ok(Nl80211Attrs::StatusCode(val)) = attr {
1928 return Ok(val);
1929 }
1930 }
1931 Err(ErrorContext::new_missing(
1932 "Nl80211Attrs",
1933 "StatusCode",
1934 self.orig_loc,
1935 self.buf.as_ptr() as usize,
1936 ))
1937 }
1938 pub fn get_cipher_suites_pairwise(&self) -> Result<&'a [u8], ErrorContext> {
1939 let mut iter = self.clone();
1940 iter.pos = 0;
1941 for attr in iter {
1942 if let Ok(Nl80211Attrs::CipherSuitesPairwise(val)) = attr {
1943 return Ok(val);
1944 }
1945 }
1946 Err(ErrorContext::new_missing(
1947 "Nl80211Attrs",
1948 "CipherSuitesPairwise",
1949 self.orig_loc,
1950 self.buf.as_ptr() as usize,
1951 ))
1952 }
1953 pub fn get_cipher_suite_group(&self) -> Result<u32, ErrorContext> {
1954 let mut iter = self.clone();
1955 iter.pos = 0;
1956 for attr in iter {
1957 if let Ok(Nl80211Attrs::CipherSuiteGroup(val)) = attr {
1958 return Ok(val);
1959 }
1960 }
1961 Err(ErrorContext::new_missing(
1962 "Nl80211Attrs",
1963 "CipherSuiteGroup",
1964 self.orig_loc,
1965 self.buf.as_ptr() as usize,
1966 ))
1967 }
1968 pub fn get_wpa_versions(&self) -> Result<u32, ErrorContext> {
1969 let mut iter = self.clone();
1970 iter.pos = 0;
1971 for attr in iter {
1972 if let Ok(Nl80211Attrs::WpaVersions(val)) = attr {
1973 return Ok(val);
1974 }
1975 }
1976 Err(ErrorContext::new_missing(
1977 "Nl80211Attrs",
1978 "WpaVersions",
1979 self.orig_loc,
1980 self.buf.as_ptr() as usize,
1981 ))
1982 }
1983 pub fn get_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
1984 let mut iter = self.clone();
1985 iter.pos = 0;
1986 for attr in iter {
1987 if let Ok(Nl80211Attrs::AkmSuites(val)) = attr {
1988 return Ok(val);
1989 }
1990 }
1991 Err(ErrorContext::new_missing(
1992 "Nl80211Attrs",
1993 "AkmSuites",
1994 self.orig_loc,
1995 self.buf.as_ptr() as usize,
1996 ))
1997 }
1998 pub fn get_req_ie(&self) -> Result<&'a [u8], ErrorContext> {
1999 let mut iter = self.clone();
2000 iter.pos = 0;
2001 for attr in iter {
2002 if let Ok(Nl80211Attrs::ReqIe(val)) = attr {
2003 return Ok(val);
2004 }
2005 }
2006 Err(ErrorContext::new_missing(
2007 "Nl80211Attrs",
2008 "ReqIe",
2009 self.orig_loc,
2010 self.buf.as_ptr() as usize,
2011 ))
2012 }
2013 pub fn get_resp_ie(&self) -> Result<&'a [u8], ErrorContext> {
2014 let mut iter = self.clone();
2015 iter.pos = 0;
2016 for attr in iter {
2017 if let Ok(Nl80211Attrs::RespIe(val)) = attr {
2018 return Ok(val);
2019 }
2020 }
2021 Err(ErrorContext::new_missing(
2022 "Nl80211Attrs",
2023 "RespIe",
2024 self.orig_loc,
2025 self.buf.as_ptr() as usize,
2026 ))
2027 }
2028 pub fn get_prev_bssid(&self) -> Result<&'a [u8], ErrorContext> {
2029 let mut iter = self.clone();
2030 iter.pos = 0;
2031 for attr in iter {
2032 if let Ok(Nl80211Attrs::PrevBssid(val)) = attr {
2033 return Ok(val);
2034 }
2035 }
2036 Err(ErrorContext::new_missing(
2037 "Nl80211Attrs",
2038 "PrevBssid",
2039 self.orig_loc,
2040 self.buf.as_ptr() as usize,
2041 ))
2042 }
2043 pub fn get_key(&self) -> Result<&'a [u8], ErrorContext> {
2044 let mut iter = self.clone();
2045 iter.pos = 0;
2046 for attr in iter {
2047 if let Ok(Nl80211Attrs::Key(val)) = attr {
2048 return Ok(val);
2049 }
2050 }
2051 Err(ErrorContext::new_missing(
2052 "Nl80211Attrs",
2053 "Key",
2054 self.orig_loc,
2055 self.buf.as_ptr() as usize,
2056 ))
2057 }
2058 pub fn get_keys(&self) -> Result<&'a [u8], ErrorContext> {
2059 let mut iter = self.clone();
2060 iter.pos = 0;
2061 for attr in iter {
2062 if let Ok(Nl80211Attrs::Keys(val)) = attr {
2063 return Ok(val);
2064 }
2065 }
2066 Err(ErrorContext::new_missing(
2067 "Nl80211Attrs",
2068 "Keys",
2069 self.orig_loc,
2070 self.buf.as_ptr() as usize,
2071 ))
2072 }
2073 pub fn get_pid(&self) -> Result<u32, ErrorContext> {
2074 let mut iter = self.clone();
2075 iter.pos = 0;
2076 for attr in iter {
2077 if let Ok(Nl80211Attrs::Pid(val)) = attr {
2078 return Ok(val);
2079 }
2080 }
2081 Err(ErrorContext::new_missing(
2082 "Nl80211Attrs",
2083 "Pid",
2084 self.orig_loc,
2085 self.buf.as_ptr() as usize,
2086 ))
2087 }
2088 pub fn get_4addr(&self) -> Result<u8, ErrorContext> {
2089 let mut iter = self.clone();
2090 iter.pos = 0;
2091 for attr in iter {
2092 if let Ok(Nl80211Attrs::_4addr(val)) = attr {
2093 return Ok(val);
2094 }
2095 }
2096 Err(ErrorContext::new_missing(
2097 "Nl80211Attrs",
2098 "4addr",
2099 self.orig_loc,
2100 self.buf.as_ptr() as usize,
2101 ))
2102 }
2103 pub fn get_survey_info(&self) -> Result<&'a [u8], ErrorContext> {
2104 let mut iter = self.clone();
2105 iter.pos = 0;
2106 for attr in iter {
2107 if let Ok(Nl80211Attrs::SurveyInfo(val)) = attr {
2108 return Ok(val);
2109 }
2110 }
2111 Err(ErrorContext::new_missing(
2112 "Nl80211Attrs",
2113 "SurveyInfo",
2114 self.orig_loc,
2115 self.buf.as_ptr() as usize,
2116 ))
2117 }
2118 pub fn get_pmkid(&self) -> Result<&'a [u8], ErrorContext> {
2119 let mut iter = self.clone();
2120 iter.pos = 0;
2121 for attr in iter {
2122 if let Ok(Nl80211Attrs::Pmkid(val)) = attr {
2123 return Ok(val);
2124 }
2125 }
2126 Err(ErrorContext::new_missing(
2127 "Nl80211Attrs",
2128 "Pmkid",
2129 self.orig_loc,
2130 self.buf.as_ptr() as usize,
2131 ))
2132 }
2133 pub fn get_max_num_pmkids(&self) -> Result<u8, ErrorContext> {
2134 let mut iter = self.clone();
2135 iter.pos = 0;
2136 for attr in iter {
2137 if let Ok(Nl80211Attrs::MaxNumPmkids(val)) = attr {
2138 return Ok(val);
2139 }
2140 }
2141 Err(ErrorContext::new_missing(
2142 "Nl80211Attrs",
2143 "MaxNumPmkids",
2144 self.orig_loc,
2145 self.buf.as_ptr() as usize,
2146 ))
2147 }
2148 pub fn get_duration(&self) -> Result<u32, ErrorContext> {
2149 let mut iter = self.clone();
2150 iter.pos = 0;
2151 for attr in iter {
2152 if let Ok(Nl80211Attrs::Duration(val)) = attr {
2153 return Ok(val);
2154 }
2155 }
2156 Err(ErrorContext::new_missing(
2157 "Nl80211Attrs",
2158 "Duration",
2159 self.orig_loc,
2160 self.buf.as_ptr() as usize,
2161 ))
2162 }
2163 pub fn get_cookie(&self) -> Result<u64, ErrorContext> {
2164 let mut iter = self.clone();
2165 iter.pos = 0;
2166 for attr in iter {
2167 if let Ok(Nl80211Attrs::Cookie(val)) = attr {
2168 return Ok(val);
2169 }
2170 }
2171 Err(ErrorContext::new_missing(
2172 "Nl80211Attrs",
2173 "Cookie",
2174 self.orig_loc,
2175 self.buf.as_ptr() as usize,
2176 ))
2177 }
2178 pub fn get_wiphy_coverage_class(&self) -> Result<u8, ErrorContext> {
2179 let mut iter = self.clone();
2180 iter.pos = 0;
2181 for attr in iter {
2182 if let Ok(Nl80211Attrs::WiphyCoverageClass(val)) = attr {
2183 return Ok(val);
2184 }
2185 }
2186 Err(ErrorContext::new_missing(
2187 "Nl80211Attrs",
2188 "WiphyCoverageClass",
2189 self.orig_loc,
2190 self.buf.as_ptr() as usize,
2191 ))
2192 }
2193 pub fn get_tx_rates(&self) -> Result<&'a [u8], ErrorContext> {
2194 let mut iter = self.clone();
2195 iter.pos = 0;
2196 for attr in iter {
2197 if let Ok(Nl80211Attrs::TxRates(val)) = attr {
2198 return Ok(val);
2199 }
2200 }
2201 Err(ErrorContext::new_missing(
2202 "Nl80211Attrs",
2203 "TxRates",
2204 self.orig_loc,
2205 self.buf.as_ptr() as usize,
2206 ))
2207 }
2208 pub fn get_frame_match(&self) -> Result<&'a [u8], ErrorContext> {
2209 let mut iter = self.clone();
2210 iter.pos = 0;
2211 for attr in iter {
2212 if let Ok(Nl80211Attrs::FrameMatch(val)) = attr {
2213 return Ok(val);
2214 }
2215 }
2216 Err(ErrorContext::new_missing(
2217 "Nl80211Attrs",
2218 "FrameMatch",
2219 self.orig_loc,
2220 self.buf.as_ptr() as usize,
2221 ))
2222 }
2223 pub fn get_ack(&self) -> Result<(), ErrorContext> {
2224 let mut iter = self.clone();
2225 iter.pos = 0;
2226 for attr in iter {
2227 if let Ok(Nl80211Attrs::Ack(val)) = attr {
2228 return Ok(val);
2229 }
2230 }
2231 Err(ErrorContext::new_missing(
2232 "Nl80211Attrs",
2233 "Ack",
2234 self.orig_loc,
2235 self.buf.as_ptr() as usize,
2236 ))
2237 }
2238 pub fn get_ps_state(&self) -> Result<u32, ErrorContext> {
2239 let mut iter = self.clone();
2240 iter.pos = 0;
2241 for attr in iter {
2242 if let Ok(Nl80211Attrs::PsState(val)) = attr {
2243 return Ok(val);
2244 }
2245 }
2246 Err(ErrorContext::new_missing(
2247 "Nl80211Attrs",
2248 "PsState",
2249 self.orig_loc,
2250 self.buf.as_ptr() as usize,
2251 ))
2252 }
2253 pub fn get_cqm(&self) -> Result<&'a [u8], ErrorContext> {
2254 let mut iter = self.clone();
2255 iter.pos = 0;
2256 for attr in iter {
2257 if let Ok(Nl80211Attrs::Cqm(val)) = attr {
2258 return Ok(val);
2259 }
2260 }
2261 Err(ErrorContext::new_missing(
2262 "Nl80211Attrs",
2263 "Cqm",
2264 self.orig_loc,
2265 self.buf.as_ptr() as usize,
2266 ))
2267 }
2268 pub fn get_local_state_change(&self) -> Result<(), ErrorContext> {
2269 let mut iter = self.clone();
2270 iter.pos = 0;
2271 for attr in iter {
2272 if let Ok(Nl80211Attrs::LocalStateChange(val)) = attr {
2273 return Ok(val);
2274 }
2275 }
2276 Err(ErrorContext::new_missing(
2277 "Nl80211Attrs",
2278 "LocalStateChange",
2279 self.orig_loc,
2280 self.buf.as_ptr() as usize,
2281 ))
2282 }
2283 pub fn get_ap_isolate(&self) -> Result<u8, ErrorContext> {
2284 let mut iter = self.clone();
2285 iter.pos = 0;
2286 for attr in iter {
2287 if let Ok(Nl80211Attrs::ApIsolate(val)) = attr {
2288 return Ok(val);
2289 }
2290 }
2291 Err(ErrorContext::new_missing(
2292 "Nl80211Attrs",
2293 "ApIsolate",
2294 self.orig_loc,
2295 self.buf.as_ptr() as usize,
2296 ))
2297 }
2298 pub fn get_wiphy_tx_power_setting(&self) -> Result<u32, ErrorContext> {
2299 let mut iter = self.clone();
2300 iter.pos = 0;
2301 for attr in iter {
2302 if let Ok(Nl80211Attrs::WiphyTxPowerSetting(val)) = attr {
2303 return Ok(val);
2304 }
2305 }
2306 Err(ErrorContext::new_missing(
2307 "Nl80211Attrs",
2308 "WiphyTxPowerSetting",
2309 self.orig_loc,
2310 self.buf.as_ptr() as usize,
2311 ))
2312 }
2313 pub fn get_wiphy_tx_power_level(&self) -> Result<u32, ErrorContext> {
2314 let mut iter = self.clone();
2315 iter.pos = 0;
2316 for attr in iter {
2317 if let Ok(Nl80211Attrs::WiphyTxPowerLevel(val)) = attr {
2318 return Ok(val);
2319 }
2320 }
2321 Err(ErrorContext::new_missing(
2322 "Nl80211Attrs",
2323 "WiphyTxPowerLevel",
2324 self.orig_loc,
2325 self.buf.as_ptr() as usize,
2326 ))
2327 }
2328 pub fn get_tx_frame_types(&self) -> Result<IterableIftypeAttrs<'a>, ErrorContext> {
2329 let mut iter = self.clone();
2330 iter.pos = 0;
2331 for attr in iter {
2332 if let Ok(Nl80211Attrs::TxFrameTypes(val)) = attr {
2333 return Ok(val);
2334 }
2335 }
2336 Err(ErrorContext::new_missing(
2337 "Nl80211Attrs",
2338 "TxFrameTypes",
2339 self.orig_loc,
2340 self.buf.as_ptr() as usize,
2341 ))
2342 }
2343 pub fn get_rx_frame_types(&self) -> Result<IterableIftypeAttrs<'a>, ErrorContext> {
2344 let mut iter = self.clone();
2345 iter.pos = 0;
2346 for attr in iter {
2347 if let Ok(Nl80211Attrs::RxFrameTypes(val)) = attr {
2348 return Ok(val);
2349 }
2350 }
2351 Err(ErrorContext::new_missing(
2352 "Nl80211Attrs",
2353 "RxFrameTypes",
2354 self.orig_loc,
2355 self.buf.as_ptr() as usize,
2356 ))
2357 }
2358 pub fn get_frame_type(&self) -> Result<u16, ErrorContext> {
2359 let mut iter = self.clone();
2360 iter.pos = 0;
2361 for attr in iter {
2362 if let Ok(Nl80211Attrs::FrameType(val)) = attr {
2363 return Ok(val);
2364 }
2365 }
2366 Err(ErrorContext::new_missing(
2367 "Nl80211Attrs",
2368 "FrameType",
2369 self.orig_loc,
2370 self.buf.as_ptr() as usize,
2371 ))
2372 }
2373 pub fn get_control_port_ethertype(&self) -> Result<(), ErrorContext> {
2374 let mut iter = self.clone();
2375 iter.pos = 0;
2376 for attr in iter {
2377 if let Ok(Nl80211Attrs::ControlPortEthertype(val)) = attr {
2378 return Ok(val);
2379 }
2380 }
2381 Err(ErrorContext::new_missing(
2382 "Nl80211Attrs",
2383 "ControlPortEthertype",
2384 self.orig_loc,
2385 self.buf.as_ptr() as usize,
2386 ))
2387 }
2388 pub fn get_control_port_no_encrypt(&self) -> Result<(), ErrorContext> {
2389 let mut iter = self.clone();
2390 iter.pos = 0;
2391 for attr in iter {
2392 if let Ok(Nl80211Attrs::ControlPortNoEncrypt(val)) = attr {
2393 return Ok(val);
2394 }
2395 }
2396 Err(ErrorContext::new_missing(
2397 "Nl80211Attrs",
2398 "ControlPortNoEncrypt",
2399 self.orig_loc,
2400 self.buf.as_ptr() as usize,
2401 ))
2402 }
2403 pub fn get_support_ibss_rsn(&self) -> Result<(), ErrorContext> {
2404 let mut iter = self.clone();
2405 iter.pos = 0;
2406 for attr in iter {
2407 if let Ok(Nl80211Attrs::SupportIbssRsn(val)) = attr {
2408 return Ok(val);
2409 }
2410 }
2411 Err(ErrorContext::new_missing(
2412 "Nl80211Attrs",
2413 "SupportIbssRsn",
2414 self.orig_loc,
2415 self.buf.as_ptr() as usize,
2416 ))
2417 }
2418 pub fn get_wiphy_antenna_tx(&self) -> Result<u32, ErrorContext> {
2419 let mut iter = self.clone();
2420 iter.pos = 0;
2421 for attr in iter {
2422 if let Ok(Nl80211Attrs::WiphyAntennaTx(val)) = attr {
2423 return Ok(val);
2424 }
2425 }
2426 Err(ErrorContext::new_missing(
2427 "Nl80211Attrs",
2428 "WiphyAntennaTx",
2429 self.orig_loc,
2430 self.buf.as_ptr() as usize,
2431 ))
2432 }
2433 pub fn get_wiphy_antenna_rx(&self) -> Result<u32, ErrorContext> {
2434 let mut iter = self.clone();
2435 iter.pos = 0;
2436 for attr in iter {
2437 if let Ok(Nl80211Attrs::WiphyAntennaRx(val)) = attr {
2438 return Ok(val);
2439 }
2440 }
2441 Err(ErrorContext::new_missing(
2442 "Nl80211Attrs",
2443 "WiphyAntennaRx",
2444 self.orig_loc,
2445 self.buf.as_ptr() as usize,
2446 ))
2447 }
2448 pub fn get_mcast_rate(&self) -> Result<u32, ErrorContext> {
2449 let mut iter = self.clone();
2450 iter.pos = 0;
2451 for attr in iter {
2452 if let Ok(Nl80211Attrs::McastRate(val)) = attr {
2453 return Ok(val);
2454 }
2455 }
2456 Err(ErrorContext::new_missing(
2457 "Nl80211Attrs",
2458 "McastRate",
2459 self.orig_loc,
2460 self.buf.as_ptr() as usize,
2461 ))
2462 }
2463 pub fn get_offchannel_tx_ok(&self) -> Result<(), ErrorContext> {
2464 let mut iter = self.clone();
2465 iter.pos = 0;
2466 for attr in iter {
2467 if let Ok(Nl80211Attrs::OffchannelTxOk(val)) = attr {
2468 return Ok(val);
2469 }
2470 }
2471 Err(ErrorContext::new_missing(
2472 "Nl80211Attrs",
2473 "OffchannelTxOk",
2474 self.orig_loc,
2475 self.buf.as_ptr() as usize,
2476 ))
2477 }
2478 pub fn get_bss_ht_opmode(&self) -> Result<u16, ErrorContext> {
2479 let mut iter = self.clone();
2480 iter.pos = 0;
2481 for attr in iter {
2482 if let Ok(Nl80211Attrs::BssHtOpmode(val)) = attr {
2483 return Ok(val);
2484 }
2485 }
2486 Err(ErrorContext::new_missing(
2487 "Nl80211Attrs",
2488 "BssHtOpmode",
2489 self.orig_loc,
2490 self.buf.as_ptr() as usize,
2491 ))
2492 }
2493 pub fn get_key_default_types(&self) -> Result<&'a [u8], ErrorContext> {
2494 let mut iter = self.clone();
2495 iter.pos = 0;
2496 for attr in iter {
2497 if let Ok(Nl80211Attrs::KeyDefaultTypes(val)) = attr {
2498 return Ok(val);
2499 }
2500 }
2501 Err(ErrorContext::new_missing(
2502 "Nl80211Attrs",
2503 "KeyDefaultTypes",
2504 self.orig_loc,
2505 self.buf.as_ptr() as usize,
2506 ))
2507 }
2508 pub fn get_max_remain_on_channel_duration(&self) -> Result<u32, ErrorContext> {
2509 let mut iter = self.clone();
2510 iter.pos = 0;
2511 for attr in iter {
2512 if let Ok(Nl80211Attrs::MaxRemainOnChannelDuration(val)) = attr {
2513 return Ok(val);
2514 }
2515 }
2516 Err(ErrorContext::new_missing(
2517 "Nl80211Attrs",
2518 "MaxRemainOnChannelDuration",
2519 self.orig_loc,
2520 self.buf.as_ptr() as usize,
2521 ))
2522 }
2523 pub fn get_mesh_setup(&self) -> Result<&'a [u8], ErrorContext> {
2524 let mut iter = self.clone();
2525 iter.pos = 0;
2526 for attr in iter {
2527 if let Ok(Nl80211Attrs::MeshSetup(val)) = attr {
2528 return Ok(val);
2529 }
2530 }
2531 Err(ErrorContext::new_missing(
2532 "Nl80211Attrs",
2533 "MeshSetup",
2534 self.orig_loc,
2535 self.buf.as_ptr() as usize,
2536 ))
2537 }
2538 pub fn get_wiphy_antenna_avail_tx(&self) -> Result<u32, ErrorContext> {
2539 let mut iter = self.clone();
2540 iter.pos = 0;
2541 for attr in iter {
2542 if let Ok(Nl80211Attrs::WiphyAntennaAvailTx(val)) = attr {
2543 return Ok(val);
2544 }
2545 }
2546 Err(ErrorContext::new_missing(
2547 "Nl80211Attrs",
2548 "WiphyAntennaAvailTx",
2549 self.orig_loc,
2550 self.buf.as_ptr() as usize,
2551 ))
2552 }
2553 pub fn get_wiphy_antenna_avail_rx(&self) -> Result<u32, ErrorContext> {
2554 let mut iter = self.clone();
2555 iter.pos = 0;
2556 for attr in iter {
2557 if let Ok(Nl80211Attrs::WiphyAntennaAvailRx(val)) = attr {
2558 return Ok(val);
2559 }
2560 }
2561 Err(ErrorContext::new_missing(
2562 "Nl80211Attrs",
2563 "WiphyAntennaAvailRx",
2564 self.orig_loc,
2565 self.buf.as_ptr() as usize,
2566 ))
2567 }
2568 pub fn get_support_mesh_auth(&self) -> Result<(), ErrorContext> {
2569 let mut iter = self.clone();
2570 iter.pos = 0;
2571 for attr in iter {
2572 if let Ok(Nl80211Attrs::SupportMeshAuth(val)) = attr {
2573 return Ok(val);
2574 }
2575 }
2576 Err(ErrorContext::new_missing(
2577 "Nl80211Attrs",
2578 "SupportMeshAuth",
2579 self.orig_loc,
2580 self.buf.as_ptr() as usize,
2581 ))
2582 }
2583 pub fn get_sta_plink_state(&self) -> Result<u8, ErrorContext> {
2584 let mut iter = self.clone();
2585 iter.pos = 0;
2586 for attr in iter {
2587 if let Ok(Nl80211Attrs::StaPlinkState(val)) = attr {
2588 return Ok(val);
2589 }
2590 }
2591 Err(ErrorContext::new_missing(
2592 "Nl80211Attrs",
2593 "StaPlinkState",
2594 self.orig_loc,
2595 self.buf.as_ptr() as usize,
2596 ))
2597 }
2598 pub fn get_wowlan_triggers(&self) -> Result<&'a [u8], ErrorContext> {
2599 let mut iter = self.clone();
2600 iter.pos = 0;
2601 for attr in iter {
2602 if let Ok(Nl80211Attrs::WowlanTriggers(val)) = attr {
2603 return Ok(val);
2604 }
2605 }
2606 Err(ErrorContext::new_missing(
2607 "Nl80211Attrs",
2608 "WowlanTriggers",
2609 self.orig_loc,
2610 self.buf.as_ptr() as usize,
2611 ))
2612 }
2613 pub fn get_wowlan_triggers_supported(
2614 &self,
2615 ) -> Result<IterableWowlanTriggersAttrs<'a>, ErrorContext> {
2616 let mut iter = self.clone();
2617 iter.pos = 0;
2618 for attr in iter {
2619 if let Ok(Nl80211Attrs::WowlanTriggersSupported(val)) = attr {
2620 return Ok(val);
2621 }
2622 }
2623 Err(ErrorContext::new_missing(
2624 "Nl80211Attrs",
2625 "WowlanTriggersSupported",
2626 self.orig_loc,
2627 self.buf.as_ptr() as usize,
2628 ))
2629 }
2630 pub fn get_sched_scan_interval(&self) -> Result<u32, ErrorContext> {
2631 let mut iter = self.clone();
2632 iter.pos = 0;
2633 for attr in iter {
2634 if let Ok(Nl80211Attrs::SchedScanInterval(val)) = attr {
2635 return Ok(val);
2636 }
2637 }
2638 Err(ErrorContext::new_missing(
2639 "Nl80211Attrs",
2640 "SchedScanInterval",
2641 self.orig_loc,
2642 self.buf.as_ptr() as usize,
2643 ))
2644 }
2645 pub fn get_interface_combinations(
2646 &self,
2647 ) -> Result<
2648 ArrayIterable<
2649 IterableArrayIfCombinationAttributes<'a>,
2650 IterableIfCombinationAttributes<'a>,
2651 >,
2652 ErrorContext,
2653 > {
2654 for attr in self.clone() {
2655 if let Ok(Nl80211Attrs::InterfaceCombinations(val)) = attr {
2656 return Ok(ArrayIterable::new(val));
2657 }
2658 }
2659 Err(ErrorContext::new_missing(
2660 "Nl80211Attrs",
2661 "InterfaceCombinations",
2662 self.orig_loc,
2663 self.buf.as_ptr() as usize,
2664 ))
2665 }
2666 pub fn get_software_iftypes(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
2667 let mut iter = self.clone();
2668 iter.pos = 0;
2669 for attr in iter {
2670 if let Ok(Nl80211Attrs::SoftwareIftypes(val)) = attr {
2671 return Ok(val);
2672 }
2673 }
2674 Err(ErrorContext::new_missing(
2675 "Nl80211Attrs",
2676 "SoftwareIftypes",
2677 self.orig_loc,
2678 self.buf.as_ptr() as usize,
2679 ))
2680 }
2681 pub fn get_rekey_data(&self) -> Result<&'a [u8], ErrorContext> {
2682 let mut iter = self.clone();
2683 iter.pos = 0;
2684 for attr in iter {
2685 if let Ok(Nl80211Attrs::RekeyData(val)) = attr {
2686 return Ok(val);
2687 }
2688 }
2689 Err(ErrorContext::new_missing(
2690 "Nl80211Attrs",
2691 "RekeyData",
2692 self.orig_loc,
2693 self.buf.as_ptr() as usize,
2694 ))
2695 }
2696 pub fn get_max_num_sched_scan_ssids(&self) -> Result<u8, ErrorContext> {
2697 let mut iter = self.clone();
2698 iter.pos = 0;
2699 for attr in iter {
2700 if let Ok(Nl80211Attrs::MaxNumSchedScanSsids(val)) = attr {
2701 return Ok(val);
2702 }
2703 }
2704 Err(ErrorContext::new_missing(
2705 "Nl80211Attrs",
2706 "MaxNumSchedScanSsids",
2707 self.orig_loc,
2708 self.buf.as_ptr() as usize,
2709 ))
2710 }
2711 pub fn get_max_sched_scan_ie_len(&self) -> Result<u16, ErrorContext> {
2712 let mut iter = self.clone();
2713 iter.pos = 0;
2714 for attr in iter {
2715 if let Ok(Nl80211Attrs::MaxSchedScanIeLen(val)) = attr {
2716 return Ok(val);
2717 }
2718 }
2719 Err(ErrorContext::new_missing(
2720 "Nl80211Attrs",
2721 "MaxSchedScanIeLen",
2722 self.orig_loc,
2723 self.buf.as_ptr() as usize,
2724 ))
2725 }
2726 pub fn get_scan_supp_rates(&self) -> Result<&'a [u8], ErrorContext> {
2727 let mut iter = self.clone();
2728 iter.pos = 0;
2729 for attr in iter {
2730 if let Ok(Nl80211Attrs::ScanSuppRates(val)) = attr {
2731 return Ok(val);
2732 }
2733 }
2734 Err(ErrorContext::new_missing(
2735 "Nl80211Attrs",
2736 "ScanSuppRates",
2737 self.orig_loc,
2738 self.buf.as_ptr() as usize,
2739 ))
2740 }
2741 pub fn get_hidden_ssid(&self) -> Result<u32, ErrorContext> {
2742 let mut iter = self.clone();
2743 iter.pos = 0;
2744 for attr in iter {
2745 if let Ok(Nl80211Attrs::HiddenSsid(val)) = attr {
2746 return Ok(val);
2747 }
2748 }
2749 Err(ErrorContext::new_missing(
2750 "Nl80211Attrs",
2751 "HiddenSsid",
2752 self.orig_loc,
2753 self.buf.as_ptr() as usize,
2754 ))
2755 }
2756 pub fn get_ie_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
2757 let mut iter = self.clone();
2758 iter.pos = 0;
2759 for attr in iter {
2760 if let Ok(Nl80211Attrs::IeProbeResp(val)) = attr {
2761 return Ok(val);
2762 }
2763 }
2764 Err(ErrorContext::new_missing(
2765 "Nl80211Attrs",
2766 "IeProbeResp",
2767 self.orig_loc,
2768 self.buf.as_ptr() as usize,
2769 ))
2770 }
2771 pub fn get_ie_assoc_resp(&self) -> Result<&'a [u8], ErrorContext> {
2772 let mut iter = self.clone();
2773 iter.pos = 0;
2774 for attr in iter {
2775 if let Ok(Nl80211Attrs::IeAssocResp(val)) = attr {
2776 return Ok(val);
2777 }
2778 }
2779 Err(ErrorContext::new_missing(
2780 "Nl80211Attrs",
2781 "IeAssocResp",
2782 self.orig_loc,
2783 self.buf.as_ptr() as usize,
2784 ))
2785 }
2786 pub fn get_sta_wme(&self) -> Result<&'a [u8], ErrorContext> {
2787 let mut iter = self.clone();
2788 iter.pos = 0;
2789 for attr in iter {
2790 if let Ok(Nl80211Attrs::StaWme(val)) = attr {
2791 return Ok(val);
2792 }
2793 }
2794 Err(ErrorContext::new_missing(
2795 "Nl80211Attrs",
2796 "StaWme",
2797 self.orig_loc,
2798 self.buf.as_ptr() as usize,
2799 ))
2800 }
2801 pub fn get_support_ap_uapsd(&self) -> Result<(), ErrorContext> {
2802 let mut iter = self.clone();
2803 iter.pos = 0;
2804 for attr in iter {
2805 if let Ok(Nl80211Attrs::SupportApUapsd(val)) = attr {
2806 return Ok(val);
2807 }
2808 }
2809 Err(ErrorContext::new_missing(
2810 "Nl80211Attrs",
2811 "SupportApUapsd",
2812 self.orig_loc,
2813 self.buf.as_ptr() as usize,
2814 ))
2815 }
2816 pub fn get_roam_support(&self) -> Result<(), ErrorContext> {
2817 let mut iter = self.clone();
2818 iter.pos = 0;
2819 for attr in iter {
2820 if let Ok(Nl80211Attrs::RoamSupport(val)) = attr {
2821 return Ok(val);
2822 }
2823 }
2824 Err(ErrorContext::new_missing(
2825 "Nl80211Attrs",
2826 "RoamSupport",
2827 self.orig_loc,
2828 self.buf.as_ptr() as usize,
2829 ))
2830 }
2831 pub fn get_sched_scan_match(&self) -> Result<&'a [u8], ErrorContext> {
2832 let mut iter = self.clone();
2833 iter.pos = 0;
2834 for attr in iter {
2835 if let Ok(Nl80211Attrs::SchedScanMatch(val)) = attr {
2836 return Ok(val);
2837 }
2838 }
2839 Err(ErrorContext::new_missing(
2840 "Nl80211Attrs",
2841 "SchedScanMatch",
2842 self.orig_loc,
2843 self.buf.as_ptr() as usize,
2844 ))
2845 }
2846 pub fn get_max_match_sets(&self) -> Result<u8, ErrorContext> {
2847 let mut iter = self.clone();
2848 iter.pos = 0;
2849 for attr in iter {
2850 if let Ok(Nl80211Attrs::MaxMatchSets(val)) = attr {
2851 return Ok(val);
2852 }
2853 }
2854 Err(ErrorContext::new_missing(
2855 "Nl80211Attrs",
2856 "MaxMatchSets",
2857 self.orig_loc,
2858 self.buf.as_ptr() as usize,
2859 ))
2860 }
2861 pub fn get_pmksa_candidate(&self) -> Result<&'a [u8], ErrorContext> {
2862 let mut iter = self.clone();
2863 iter.pos = 0;
2864 for attr in iter {
2865 if let Ok(Nl80211Attrs::PmksaCandidate(val)) = attr {
2866 return Ok(val);
2867 }
2868 }
2869 Err(ErrorContext::new_missing(
2870 "Nl80211Attrs",
2871 "PmksaCandidate",
2872 self.orig_loc,
2873 self.buf.as_ptr() as usize,
2874 ))
2875 }
2876 pub fn get_tx_no_cck_rate(&self) -> Result<(), ErrorContext> {
2877 let mut iter = self.clone();
2878 iter.pos = 0;
2879 for attr in iter {
2880 if let Ok(Nl80211Attrs::TxNoCckRate(val)) = attr {
2881 return Ok(val);
2882 }
2883 }
2884 Err(ErrorContext::new_missing(
2885 "Nl80211Attrs",
2886 "TxNoCckRate",
2887 self.orig_loc,
2888 self.buf.as_ptr() as usize,
2889 ))
2890 }
2891 pub fn get_tdls_action(&self) -> Result<u8, ErrorContext> {
2892 let mut iter = self.clone();
2893 iter.pos = 0;
2894 for attr in iter {
2895 if let Ok(Nl80211Attrs::TdlsAction(val)) = attr {
2896 return Ok(val);
2897 }
2898 }
2899 Err(ErrorContext::new_missing(
2900 "Nl80211Attrs",
2901 "TdlsAction",
2902 self.orig_loc,
2903 self.buf.as_ptr() as usize,
2904 ))
2905 }
2906 pub fn get_tdls_dialog_token(&self) -> Result<u8, ErrorContext> {
2907 let mut iter = self.clone();
2908 iter.pos = 0;
2909 for attr in iter {
2910 if let Ok(Nl80211Attrs::TdlsDialogToken(val)) = attr {
2911 return Ok(val);
2912 }
2913 }
2914 Err(ErrorContext::new_missing(
2915 "Nl80211Attrs",
2916 "TdlsDialogToken",
2917 self.orig_loc,
2918 self.buf.as_ptr() as usize,
2919 ))
2920 }
2921 pub fn get_tdls_operation(&self) -> Result<u8, ErrorContext> {
2922 let mut iter = self.clone();
2923 iter.pos = 0;
2924 for attr in iter {
2925 if let Ok(Nl80211Attrs::TdlsOperation(val)) = attr {
2926 return Ok(val);
2927 }
2928 }
2929 Err(ErrorContext::new_missing(
2930 "Nl80211Attrs",
2931 "TdlsOperation",
2932 self.orig_loc,
2933 self.buf.as_ptr() as usize,
2934 ))
2935 }
2936 pub fn get_tdls_support(&self) -> Result<(), ErrorContext> {
2937 let mut iter = self.clone();
2938 iter.pos = 0;
2939 for attr in iter {
2940 if let Ok(Nl80211Attrs::TdlsSupport(val)) = attr {
2941 return Ok(val);
2942 }
2943 }
2944 Err(ErrorContext::new_missing(
2945 "Nl80211Attrs",
2946 "TdlsSupport",
2947 self.orig_loc,
2948 self.buf.as_ptr() as usize,
2949 ))
2950 }
2951 pub fn get_tdls_external_setup(&self) -> Result<(), ErrorContext> {
2952 let mut iter = self.clone();
2953 iter.pos = 0;
2954 for attr in iter {
2955 if let Ok(Nl80211Attrs::TdlsExternalSetup(val)) = attr {
2956 return Ok(val);
2957 }
2958 }
2959 Err(ErrorContext::new_missing(
2960 "Nl80211Attrs",
2961 "TdlsExternalSetup",
2962 self.orig_loc,
2963 self.buf.as_ptr() as usize,
2964 ))
2965 }
2966 pub fn get_device_ap_sme(&self) -> Result<u32, ErrorContext> {
2967 let mut iter = self.clone();
2968 iter.pos = 0;
2969 for attr in iter {
2970 if let Ok(Nl80211Attrs::DeviceApSme(val)) = attr {
2971 return Ok(val);
2972 }
2973 }
2974 Err(ErrorContext::new_missing(
2975 "Nl80211Attrs",
2976 "DeviceApSme",
2977 self.orig_loc,
2978 self.buf.as_ptr() as usize,
2979 ))
2980 }
2981 pub fn get_dont_wait_for_ack(&self) -> Result<(), ErrorContext> {
2982 let mut iter = self.clone();
2983 iter.pos = 0;
2984 for attr in iter {
2985 if let Ok(Nl80211Attrs::DontWaitForAck(val)) = attr {
2986 return Ok(val);
2987 }
2988 }
2989 Err(ErrorContext::new_missing(
2990 "Nl80211Attrs",
2991 "DontWaitForAck",
2992 self.orig_loc,
2993 self.buf.as_ptr() as usize,
2994 ))
2995 }
2996 #[doc = "Associated type: [`FeatureFlags`] (1 bit per enumeration)"]
2997 pub fn get_feature_flags(&self) -> Result<u32, ErrorContext> {
2998 let mut iter = self.clone();
2999 iter.pos = 0;
3000 for attr in iter {
3001 if let Ok(Nl80211Attrs::FeatureFlags(val)) = attr {
3002 return Ok(val);
3003 }
3004 }
3005 Err(ErrorContext::new_missing(
3006 "Nl80211Attrs",
3007 "FeatureFlags",
3008 self.orig_loc,
3009 self.buf.as_ptr() as usize,
3010 ))
3011 }
3012 pub fn get_probe_resp_offload(&self) -> Result<u32, ErrorContext> {
3013 let mut iter = self.clone();
3014 iter.pos = 0;
3015 for attr in iter {
3016 if let Ok(Nl80211Attrs::ProbeRespOffload(val)) = attr {
3017 return Ok(val);
3018 }
3019 }
3020 Err(ErrorContext::new_missing(
3021 "Nl80211Attrs",
3022 "ProbeRespOffload",
3023 self.orig_loc,
3024 self.buf.as_ptr() as usize,
3025 ))
3026 }
3027 pub fn get_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
3028 let mut iter = self.clone();
3029 iter.pos = 0;
3030 for attr in iter {
3031 if let Ok(Nl80211Attrs::ProbeResp(val)) = attr {
3032 return Ok(val);
3033 }
3034 }
3035 Err(ErrorContext::new_missing(
3036 "Nl80211Attrs",
3037 "ProbeResp",
3038 self.orig_loc,
3039 self.buf.as_ptr() as usize,
3040 ))
3041 }
3042 pub fn get_dfs_region(&self) -> Result<u8, ErrorContext> {
3043 let mut iter = self.clone();
3044 iter.pos = 0;
3045 for attr in iter {
3046 if let Ok(Nl80211Attrs::DfsRegion(val)) = attr {
3047 return Ok(val);
3048 }
3049 }
3050 Err(ErrorContext::new_missing(
3051 "Nl80211Attrs",
3052 "DfsRegion",
3053 self.orig_loc,
3054 self.buf.as_ptr() as usize,
3055 ))
3056 }
3057 pub fn get_disable_ht(&self) -> Result<(), ErrorContext> {
3058 let mut iter = self.clone();
3059 iter.pos = 0;
3060 for attr in iter {
3061 if let Ok(Nl80211Attrs::DisableHt(val)) = attr {
3062 return Ok(val);
3063 }
3064 }
3065 Err(ErrorContext::new_missing(
3066 "Nl80211Attrs",
3067 "DisableHt",
3068 self.orig_loc,
3069 self.buf.as_ptr() as usize,
3070 ))
3071 }
3072 pub fn get_ht_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
3073 let mut iter = self.clone();
3074 iter.pos = 0;
3075 for attr in iter {
3076 if let Ok(Nl80211Attrs::HtCapabilityMask(val)) = attr {
3077 return Ok(val);
3078 }
3079 }
3080 Err(ErrorContext::new_missing(
3081 "Nl80211Attrs",
3082 "HtCapabilityMask",
3083 self.orig_loc,
3084 self.buf.as_ptr() as usize,
3085 ))
3086 }
3087 pub fn get_noack_map(&self) -> Result<u16, ErrorContext> {
3088 let mut iter = self.clone();
3089 iter.pos = 0;
3090 for attr in iter {
3091 if let Ok(Nl80211Attrs::NoackMap(val)) = attr {
3092 return Ok(val);
3093 }
3094 }
3095 Err(ErrorContext::new_missing(
3096 "Nl80211Attrs",
3097 "NoackMap",
3098 self.orig_loc,
3099 self.buf.as_ptr() as usize,
3100 ))
3101 }
3102 pub fn get_inactivity_timeout(&self) -> Result<u16, ErrorContext> {
3103 let mut iter = self.clone();
3104 iter.pos = 0;
3105 for attr in iter {
3106 if let Ok(Nl80211Attrs::InactivityTimeout(val)) = attr {
3107 return Ok(val);
3108 }
3109 }
3110 Err(ErrorContext::new_missing(
3111 "Nl80211Attrs",
3112 "InactivityTimeout",
3113 self.orig_loc,
3114 self.buf.as_ptr() as usize,
3115 ))
3116 }
3117 pub fn get_rx_signal_dbm(&self) -> Result<u32, ErrorContext> {
3118 let mut iter = self.clone();
3119 iter.pos = 0;
3120 for attr in iter {
3121 if let Ok(Nl80211Attrs::RxSignalDbm(val)) = attr {
3122 return Ok(val);
3123 }
3124 }
3125 Err(ErrorContext::new_missing(
3126 "Nl80211Attrs",
3127 "RxSignalDbm",
3128 self.orig_loc,
3129 self.buf.as_ptr() as usize,
3130 ))
3131 }
3132 pub fn get_bg_scan_period(&self) -> Result<u16, ErrorContext> {
3133 let mut iter = self.clone();
3134 iter.pos = 0;
3135 for attr in iter {
3136 if let Ok(Nl80211Attrs::BgScanPeriod(val)) = attr {
3137 return Ok(val);
3138 }
3139 }
3140 Err(ErrorContext::new_missing(
3141 "Nl80211Attrs",
3142 "BgScanPeriod",
3143 self.orig_loc,
3144 self.buf.as_ptr() as usize,
3145 ))
3146 }
3147 pub fn get_wdev(&self) -> Result<u64, ErrorContext> {
3148 let mut iter = self.clone();
3149 iter.pos = 0;
3150 for attr in iter {
3151 if let Ok(Nl80211Attrs::Wdev(val)) = attr {
3152 return Ok(val);
3153 }
3154 }
3155 Err(ErrorContext::new_missing(
3156 "Nl80211Attrs",
3157 "Wdev",
3158 self.orig_loc,
3159 self.buf.as_ptr() as usize,
3160 ))
3161 }
3162 pub fn get_user_reg_hint_type(&self) -> Result<u32, ErrorContext> {
3163 let mut iter = self.clone();
3164 iter.pos = 0;
3165 for attr in iter {
3166 if let Ok(Nl80211Attrs::UserRegHintType(val)) = attr {
3167 return Ok(val);
3168 }
3169 }
3170 Err(ErrorContext::new_missing(
3171 "Nl80211Attrs",
3172 "UserRegHintType",
3173 self.orig_loc,
3174 self.buf.as_ptr() as usize,
3175 ))
3176 }
3177 pub fn get_conn_failed_reason(&self) -> Result<u32, ErrorContext> {
3178 let mut iter = self.clone();
3179 iter.pos = 0;
3180 for attr in iter {
3181 if let Ok(Nl80211Attrs::ConnFailedReason(val)) = attr {
3182 return Ok(val);
3183 }
3184 }
3185 Err(ErrorContext::new_missing(
3186 "Nl80211Attrs",
3187 "ConnFailedReason",
3188 self.orig_loc,
3189 self.buf.as_ptr() as usize,
3190 ))
3191 }
3192 pub fn get_auth_data(&self) -> Result<&'a [u8], ErrorContext> {
3193 let mut iter = self.clone();
3194 iter.pos = 0;
3195 for attr in iter {
3196 if let Ok(Nl80211Attrs::AuthData(val)) = attr {
3197 return Ok(val);
3198 }
3199 }
3200 Err(ErrorContext::new_missing(
3201 "Nl80211Attrs",
3202 "AuthData",
3203 self.orig_loc,
3204 self.buf.as_ptr() as usize,
3205 ))
3206 }
3207 pub fn get_vht_capability(&self) -> Result<&'a [u8], ErrorContext> {
3208 let mut iter = self.clone();
3209 iter.pos = 0;
3210 for attr in iter {
3211 if let Ok(Nl80211Attrs::VhtCapability(val)) = attr {
3212 return Ok(val);
3213 }
3214 }
3215 Err(ErrorContext::new_missing(
3216 "Nl80211Attrs",
3217 "VhtCapability",
3218 self.orig_loc,
3219 self.buf.as_ptr() as usize,
3220 ))
3221 }
3222 pub fn get_scan_flags(&self) -> Result<u32, ErrorContext> {
3223 let mut iter = self.clone();
3224 iter.pos = 0;
3225 for attr in iter {
3226 if let Ok(Nl80211Attrs::ScanFlags(val)) = attr {
3227 return Ok(val);
3228 }
3229 }
3230 Err(ErrorContext::new_missing(
3231 "Nl80211Attrs",
3232 "ScanFlags",
3233 self.orig_loc,
3234 self.buf.as_ptr() as usize,
3235 ))
3236 }
3237 pub fn get_channel_width(&self) -> Result<u32, ErrorContext> {
3238 let mut iter = self.clone();
3239 iter.pos = 0;
3240 for attr in iter {
3241 if let Ok(Nl80211Attrs::ChannelWidth(val)) = attr {
3242 return Ok(val);
3243 }
3244 }
3245 Err(ErrorContext::new_missing(
3246 "Nl80211Attrs",
3247 "ChannelWidth",
3248 self.orig_loc,
3249 self.buf.as_ptr() as usize,
3250 ))
3251 }
3252 pub fn get_center_freq1(&self) -> Result<u32, ErrorContext> {
3253 let mut iter = self.clone();
3254 iter.pos = 0;
3255 for attr in iter {
3256 if let Ok(Nl80211Attrs::CenterFreq1(val)) = attr {
3257 return Ok(val);
3258 }
3259 }
3260 Err(ErrorContext::new_missing(
3261 "Nl80211Attrs",
3262 "CenterFreq1",
3263 self.orig_loc,
3264 self.buf.as_ptr() as usize,
3265 ))
3266 }
3267 pub fn get_center_freq2(&self) -> Result<u32, ErrorContext> {
3268 let mut iter = self.clone();
3269 iter.pos = 0;
3270 for attr in iter {
3271 if let Ok(Nl80211Attrs::CenterFreq2(val)) = attr {
3272 return Ok(val);
3273 }
3274 }
3275 Err(ErrorContext::new_missing(
3276 "Nl80211Attrs",
3277 "CenterFreq2",
3278 self.orig_loc,
3279 self.buf.as_ptr() as usize,
3280 ))
3281 }
3282 pub fn get_p2p_ctwindow(&self) -> Result<u8, ErrorContext> {
3283 let mut iter = self.clone();
3284 iter.pos = 0;
3285 for attr in iter {
3286 if let Ok(Nl80211Attrs::P2pCtwindow(val)) = attr {
3287 return Ok(val);
3288 }
3289 }
3290 Err(ErrorContext::new_missing(
3291 "Nl80211Attrs",
3292 "P2pCtwindow",
3293 self.orig_loc,
3294 self.buf.as_ptr() as usize,
3295 ))
3296 }
3297 pub fn get_p2p_oppps(&self) -> Result<u8, ErrorContext> {
3298 let mut iter = self.clone();
3299 iter.pos = 0;
3300 for attr in iter {
3301 if let Ok(Nl80211Attrs::P2pOppps(val)) = attr {
3302 return Ok(val);
3303 }
3304 }
3305 Err(ErrorContext::new_missing(
3306 "Nl80211Attrs",
3307 "P2pOppps",
3308 self.orig_loc,
3309 self.buf.as_ptr() as usize,
3310 ))
3311 }
3312 pub fn get_local_mesh_power_mode(&self) -> Result<u32, ErrorContext> {
3313 let mut iter = self.clone();
3314 iter.pos = 0;
3315 for attr in iter {
3316 if let Ok(Nl80211Attrs::LocalMeshPowerMode(val)) = attr {
3317 return Ok(val);
3318 }
3319 }
3320 Err(ErrorContext::new_missing(
3321 "Nl80211Attrs",
3322 "LocalMeshPowerMode",
3323 self.orig_loc,
3324 self.buf.as_ptr() as usize,
3325 ))
3326 }
3327 pub fn get_acl_policy(&self) -> Result<u32, ErrorContext> {
3328 let mut iter = self.clone();
3329 iter.pos = 0;
3330 for attr in iter {
3331 if let Ok(Nl80211Attrs::AclPolicy(val)) = attr {
3332 return Ok(val);
3333 }
3334 }
3335 Err(ErrorContext::new_missing(
3336 "Nl80211Attrs",
3337 "AclPolicy",
3338 self.orig_loc,
3339 self.buf.as_ptr() as usize,
3340 ))
3341 }
3342 pub fn get_mac_addrs(&self) -> Result<&'a [u8], ErrorContext> {
3343 let mut iter = self.clone();
3344 iter.pos = 0;
3345 for attr in iter {
3346 if let Ok(Nl80211Attrs::MacAddrs(val)) = attr {
3347 return Ok(val);
3348 }
3349 }
3350 Err(ErrorContext::new_missing(
3351 "Nl80211Attrs",
3352 "MacAddrs",
3353 self.orig_loc,
3354 self.buf.as_ptr() as usize,
3355 ))
3356 }
3357 pub fn get_mac_acl_max(&self) -> Result<u32, ErrorContext> {
3358 let mut iter = self.clone();
3359 iter.pos = 0;
3360 for attr in iter {
3361 if let Ok(Nl80211Attrs::MacAclMax(val)) = attr {
3362 return Ok(val);
3363 }
3364 }
3365 Err(ErrorContext::new_missing(
3366 "Nl80211Attrs",
3367 "MacAclMax",
3368 self.orig_loc,
3369 self.buf.as_ptr() as usize,
3370 ))
3371 }
3372 pub fn get_radar_event(&self) -> Result<u32, ErrorContext> {
3373 let mut iter = self.clone();
3374 iter.pos = 0;
3375 for attr in iter {
3376 if let Ok(Nl80211Attrs::RadarEvent(val)) = attr {
3377 return Ok(val);
3378 }
3379 }
3380 Err(ErrorContext::new_missing(
3381 "Nl80211Attrs",
3382 "RadarEvent",
3383 self.orig_loc,
3384 self.buf.as_ptr() as usize,
3385 ))
3386 }
3387 pub fn get_ext_capa(&self) -> Result<&'a [u8], ErrorContext> {
3388 let mut iter = self.clone();
3389 iter.pos = 0;
3390 for attr in iter {
3391 if let Ok(Nl80211Attrs::ExtCapa(val)) = attr {
3392 return Ok(val);
3393 }
3394 }
3395 Err(ErrorContext::new_missing(
3396 "Nl80211Attrs",
3397 "ExtCapa",
3398 self.orig_loc,
3399 self.buf.as_ptr() as usize,
3400 ))
3401 }
3402 pub fn get_ext_capa_mask(&self) -> Result<&'a [u8], ErrorContext> {
3403 let mut iter = self.clone();
3404 iter.pos = 0;
3405 for attr in iter {
3406 if let Ok(Nl80211Attrs::ExtCapaMask(val)) = attr {
3407 return Ok(val);
3408 }
3409 }
3410 Err(ErrorContext::new_missing(
3411 "Nl80211Attrs",
3412 "ExtCapaMask",
3413 self.orig_loc,
3414 self.buf.as_ptr() as usize,
3415 ))
3416 }
3417 pub fn get_sta_capability(&self) -> Result<u16, ErrorContext> {
3418 let mut iter = self.clone();
3419 iter.pos = 0;
3420 for attr in iter {
3421 if let Ok(Nl80211Attrs::StaCapability(val)) = attr {
3422 return Ok(val);
3423 }
3424 }
3425 Err(ErrorContext::new_missing(
3426 "Nl80211Attrs",
3427 "StaCapability",
3428 self.orig_loc,
3429 self.buf.as_ptr() as usize,
3430 ))
3431 }
3432 pub fn get_sta_ext_capability(&self) -> Result<&'a [u8], ErrorContext> {
3433 let mut iter = self.clone();
3434 iter.pos = 0;
3435 for attr in iter {
3436 if let Ok(Nl80211Attrs::StaExtCapability(val)) = attr {
3437 return Ok(val);
3438 }
3439 }
3440 Err(ErrorContext::new_missing(
3441 "Nl80211Attrs",
3442 "StaExtCapability",
3443 self.orig_loc,
3444 self.buf.as_ptr() as usize,
3445 ))
3446 }
3447 #[doc = "Associated type: [`ProtocolFeatures`] (enum)"]
3448 pub fn get_protocol_features(&self) -> Result<u32, ErrorContext> {
3449 let mut iter = self.clone();
3450 iter.pos = 0;
3451 for attr in iter {
3452 if let Ok(Nl80211Attrs::ProtocolFeatures(val)) = attr {
3453 return Ok(val);
3454 }
3455 }
3456 Err(ErrorContext::new_missing(
3457 "Nl80211Attrs",
3458 "ProtocolFeatures",
3459 self.orig_loc,
3460 self.buf.as_ptr() as usize,
3461 ))
3462 }
3463 pub fn get_split_wiphy_dump(&self) -> Result<(), ErrorContext> {
3464 let mut iter = self.clone();
3465 iter.pos = 0;
3466 for attr in iter {
3467 if let Ok(Nl80211Attrs::SplitWiphyDump(val)) = attr {
3468 return Ok(val);
3469 }
3470 }
3471 Err(ErrorContext::new_missing(
3472 "Nl80211Attrs",
3473 "SplitWiphyDump",
3474 self.orig_loc,
3475 self.buf.as_ptr() as usize,
3476 ))
3477 }
3478 pub fn get_disable_vht(&self) -> Result<(), ErrorContext> {
3479 let mut iter = self.clone();
3480 iter.pos = 0;
3481 for attr in iter {
3482 if let Ok(Nl80211Attrs::DisableVht(val)) = attr {
3483 return Ok(val);
3484 }
3485 }
3486 Err(ErrorContext::new_missing(
3487 "Nl80211Attrs",
3488 "DisableVht",
3489 self.orig_loc,
3490 self.buf.as_ptr() as usize,
3491 ))
3492 }
3493 pub fn get_vht_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
3494 let mut iter = self.clone();
3495 iter.pos = 0;
3496 for attr in iter {
3497 if let Ok(Nl80211Attrs::VhtCapabilityMask(val)) = attr {
3498 return Ok(val);
3499 }
3500 }
3501 Err(ErrorContext::new_missing(
3502 "Nl80211Attrs",
3503 "VhtCapabilityMask",
3504 self.orig_loc,
3505 self.buf.as_ptr() as usize,
3506 ))
3507 }
3508 pub fn get_mdid(&self) -> Result<u16, ErrorContext> {
3509 let mut iter = self.clone();
3510 iter.pos = 0;
3511 for attr in iter {
3512 if let Ok(Nl80211Attrs::Mdid(val)) = attr {
3513 return Ok(val);
3514 }
3515 }
3516 Err(ErrorContext::new_missing(
3517 "Nl80211Attrs",
3518 "Mdid",
3519 self.orig_loc,
3520 self.buf.as_ptr() as usize,
3521 ))
3522 }
3523 pub fn get_ie_ric(&self) -> Result<&'a [u8], ErrorContext> {
3524 let mut iter = self.clone();
3525 iter.pos = 0;
3526 for attr in iter {
3527 if let Ok(Nl80211Attrs::IeRic(val)) = attr {
3528 return Ok(val);
3529 }
3530 }
3531 Err(ErrorContext::new_missing(
3532 "Nl80211Attrs",
3533 "IeRic",
3534 self.orig_loc,
3535 self.buf.as_ptr() as usize,
3536 ))
3537 }
3538 pub fn get_crit_prot_id(&self) -> Result<u16, ErrorContext> {
3539 let mut iter = self.clone();
3540 iter.pos = 0;
3541 for attr in iter {
3542 if let Ok(Nl80211Attrs::CritProtId(val)) = attr {
3543 return Ok(val);
3544 }
3545 }
3546 Err(ErrorContext::new_missing(
3547 "Nl80211Attrs",
3548 "CritProtId",
3549 self.orig_loc,
3550 self.buf.as_ptr() as usize,
3551 ))
3552 }
3553 pub fn get_max_crit_prot_duration(&self) -> Result<u16, ErrorContext> {
3554 let mut iter = self.clone();
3555 iter.pos = 0;
3556 for attr in iter {
3557 if let Ok(Nl80211Attrs::MaxCritProtDuration(val)) = attr {
3558 return Ok(val);
3559 }
3560 }
3561 Err(ErrorContext::new_missing(
3562 "Nl80211Attrs",
3563 "MaxCritProtDuration",
3564 self.orig_loc,
3565 self.buf.as_ptr() as usize,
3566 ))
3567 }
3568 pub fn get_peer_aid(&self) -> Result<u16, ErrorContext> {
3569 let mut iter = self.clone();
3570 iter.pos = 0;
3571 for attr in iter {
3572 if let Ok(Nl80211Attrs::PeerAid(val)) = attr {
3573 return Ok(val);
3574 }
3575 }
3576 Err(ErrorContext::new_missing(
3577 "Nl80211Attrs",
3578 "PeerAid",
3579 self.orig_loc,
3580 self.buf.as_ptr() as usize,
3581 ))
3582 }
3583 pub fn get_coalesce_rule(&self) -> Result<&'a [u8], ErrorContext> {
3584 let mut iter = self.clone();
3585 iter.pos = 0;
3586 for attr in iter {
3587 if let Ok(Nl80211Attrs::CoalesceRule(val)) = attr {
3588 return Ok(val);
3589 }
3590 }
3591 Err(ErrorContext::new_missing(
3592 "Nl80211Attrs",
3593 "CoalesceRule",
3594 self.orig_loc,
3595 self.buf.as_ptr() as usize,
3596 ))
3597 }
3598 pub fn get_ch_switch_count(&self) -> Result<u32, ErrorContext> {
3599 let mut iter = self.clone();
3600 iter.pos = 0;
3601 for attr in iter {
3602 if let Ok(Nl80211Attrs::ChSwitchCount(val)) = attr {
3603 return Ok(val);
3604 }
3605 }
3606 Err(ErrorContext::new_missing(
3607 "Nl80211Attrs",
3608 "ChSwitchCount",
3609 self.orig_loc,
3610 self.buf.as_ptr() as usize,
3611 ))
3612 }
3613 pub fn get_ch_switch_block_tx(&self) -> Result<(), ErrorContext> {
3614 let mut iter = self.clone();
3615 iter.pos = 0;
3616 for attr in iter {
3617 if let Ok(Nl80211Attrs::ChSwitchBlockTx(val)) = attr {
3618 return Ok(val);
3619 }
3620 }
3621 Err(ErrorContext::new_missing(
3622 "Nl80211Attrs",
3623 "ChSwitchBlockTx",
3624 self.orig_loc,
3625 self.buf.as_ptr() as usize,
3626 ))
3627 }
3628 pub fn get_csa_ies(&self) -> Result<&'a [u8], ErrorContext> {
3629 let mut iter = self.clone();
3630 iter.pos = 0;
3631 for attr in iter {
3632 if let Ok(Nl80211Attrs::CsaIes(val)) = attr {
3633 return Ok(val);
3634 }
3635 }
3636 Err(ErrorContext::new_missing(
3637 "Nl80211Attrs",
3638 "CsaIes",
3639 self.orig_loc,
3640 self.buf.as_ptr() as usize,
3641 ))
3642 }
3643 pub fn get_cntdwn_offs_beacon(&self) -> Result<&'a [u8], ErrorContext> {
3644 let mut iter = self.clone();
3645 iter.pos = 0;
3646 for attr in iter {
3647 if let Ok(Nl80211Attrs::CntdwnOffsBeacon(val)) = attr {
3648 return Ok(val);
3649 }
3650 }
3651 Err(ErrorContext::new_missing(
3652 "Nl80211Attrs",
3653 "CntdwnOffsBeacon",
3654 self.orig_loc,
3655 self.buf.as_ptr() as usize,
3656 ))
3657 }
3658 pub fn get_cntdwn_offs_presp(&self) -> Result<&'a [u8], ErrorContext> {
3659 let mut iter = self.clone();
3660 iter.pos = 0;
3661 for attr in iter {
3662 if let Ok(Nl80211Attrs::CntdwnOffsPresp(val)) = attr {
3663 return Ok(val);
3664 }
3665 }
3666 Err(ErrorContext::new_missing(
3667 "Nl80211Attrs",
3668 "CntdwnOffsPresp",
3669 self.orig_loc,
3670 self.buf.as_ptr() as usize,
3671 ))
3672 }
3673 pub fn get_rxmgmt_flags(&self) -> Result<&'a [u8], ErrorContext> {
3674 let mut iter = self.clone();
3675 iter.pos = 0;
3676 for attr in iter {
3677 if let Ok(Nl80211Attrs::RxmgmtFlags(val)) = attr {
3678 return Ok(val);
3679 }
3680 }
3681 Err(ErrorContext::new_missing(
3682 "Nl80211Attrs",
3683 "RxmgmtFlags",
3684 self.orig_loc,
3685 self.buf.as_ptr() as usize,
3686 ))
3687 }
3688 pub fn get_sta_supported_channels(&self) -> Result<&'a [u8], ErrorContext> {
3689 let mut iter = self.clone();
3690 iter.pos = 0;
3691 for attr in iter {
3692 if let Ok(Nl80211Attrs::StaSupportedChannels(val)) = attr {
3693 return Ok(val);
3694 }
3695 }
3696 Err(ErrorContext::new_missing(
3697 "Nl80211Attrs",
3698 "StaSupportedChannels",
3699 self.orig_loc,
3700 self.buf.as_ptr() as usize,
3701 ))
3702 }
3703 pub fn get_sta_supported_oper_classes(&self) -> Result<&'a [u8], ErrorContext> {
3704 let mut iter = self.clone();
3705 iter.pos = 0;
3706 for attr in iter {
3707 if let Ok(Nl80211Attrs::StaSupportedOperClasses(val)) = attr {
3708 return Ok(val);
3709 }
3710 }
3711 Err(ErrorContext::new_missing(
3712 "Nl80211Attrs",
3713 "StaSupportedOperClasses",
3714 self.orig_loc,
3715 self.buf.as_ptr() as usize,
3716 ))
3717 }
3718 pub fn get_handle_dfs(&self) -> Result<(), ErrorContext> {
3719 let mut iter = self.clone();
3720 iter.pos = 0;
3721 for attr in iter {
3722 if let Ok(Nl80211Attrs::HandleDfs(val)) = attr {
3723 return Ok(val);
3724 }
3725 }
3726 Err(ErrorContext::new_missing(
3727 "Nl80211Attrs",
3728 "HandleDfs",
3729 self.orig_loc,
3730 self.buf.as_ptr() as usize,
3731 ))
3732 }
3733 pub fn get_support_5_mhz(&self) -> Result<(), ErrorContext> {
3734 let mut iter = self.clone();
3735 iter.pos = 0;
3736 for attr in iter {
3737 if let Ok(Nl80211Attrs::Support5Mhz(val)) = attr {
3738 return Ok(val);
3739 }
3740 }
3741 Err(ErrorContext::new_missing(
3742 "Nl80211Attrs",
3743 "Support5Mhz",
3744 self.orig_loc,
3745 self.buf.as_ptr() as usize,
3746 ))
3747 }
3748 pub fn get_support_10_mhz(&self) -> Result<(), ErrorContext> {
3749 let mut iter = self.clone();
3750 iter.pos = 0;
3751 for attr in iter {
3752 if let Ok(Nl80211Attrs::Support10Mhz(val)) = attr {
3753 return Ok(val);
3754 }
3755 }
3756 Err(ErrorContext::new_missing(
3757 "Nl80211Attrs",
3758 "Support10Mhz",
3759 self.orig_loc,
3760 self.buf.as_ptr() as usize,
3761 ))
3762 }
3763 pub fn get_opmode_notif(&self) -> Result<u8, ErrorContext> {
3764 let mut iter = self.clone();
3765 iter.pos = 0;
3766 for attr in iter {
3767 if let Ok(Nl80211Attrs::OpmodeNotif(val)) = attr {
3768 return Ok(val);
3769 }
3770 }
3771 Err(ErrorContext::new_missing(
3772 "Nl80211Attrs",
3773 "OpmodeNotif",
3774 self.orig_loc,
3775 self.buf.as_ptr() as usize,
3776 ))
3777 }
3778 pub fn get_vendor_id(&self) -> Result<u32, ErrorContext> {
3779 let mut iter = self.clone();
3780 iter.pos = 0;
3781 for attr in iter {
3782 if let Ok(Nl80211Attrs::VendorId(val)) = attr {
3783 return Ok(val);
3784 }
3785 }
3786 Err(ErrorContext::new_missing(
3787 "Nl80211Attrs",
3788 "VendorId",
3789 self.orig_loc,
3790 self.buf.as_ptr() as usize,
3791 ))
3792 }
3793 pub fn get_vendor_subcmd(&self) -> Result<u32, ErrorContext> {
3794 let mut iter = self.clone();
3795 iter.pos = 0;
3796 for attr in iter {
3797 if let Ok(Nl80211Attrs::VendorSubcmd(val)) = attr {
3798 return Ok(val);
3799 }
3800 }
3801 Err(ErrorContext::new_missing(
3802 "Nl80211Attrs",
3803 "VendorSubcmd",
3804 self.orig_loc,
3805 self.buf.as_ptr() as usize,
3806 ))
3807 }
3808 pub fn get_vendor_data(&self) -> Result<&'a [u8], ErrorContext> {
3809 let mut iter = self.clone();
3810 iter.pos = 0;
3811 for attr in iter {
3812 if let Ok(Nl80211Attrs::VendorData(val)) = attr {
3813 return Ok(val);
3814 }
3815 }
3816 Err(ErrorContext::new_missing(
3817 "Nl80211Attrs",
3818 "VendorData",
3819 self.orig_loc,
3820 self.buf.as_ptr() as usize,
3821 ))
3822 }
3823 pub fn get_vendor_events(&self) -> Result<&'a [u8], ErrorContext> {
3824 let mut iter = self.clone();
3825 iter.pos = 0;
3826 for attr in iter {
3827 if let Ok(Nl80211Attrs::VendorEvents(val)) = attr {
3828 return Ok(val);
3829 }
3830 }
3831 Err(ErrorContext::new_missing(
3832 "Nl80211Attrs",
3833 "VendorEvents",
3834 self.orig_loc,
3835 self.buf.as_ptr() as usize,
3836 ))
3837 }
3838 pub fn get_qos_map(&self) -> Result<&'a [u8], ErrorContext> {
3839 let mut iter = self.clone();
3840 iter.pos = 0;
3841 for attr in iter {
3842 if let Ok(Nl80211Attrs::QosMap(val)) = attr {
3843 return Ok(val);
3844 }
3845 }
3846 Err(ErrorContext::new_missing(
3847 "Nl80211Attrs",
3848 "QosMap",
3849 self.orig_loc,
3850 self.buf.as_ptr() as usize,
3851 ))
3852 }
3853 pub fn get_mac_hint(&self) -> Result<&'a [u8], ErrorContext> {
3854 let mut iter = self.clone();
3855 iter.pos = 0;
3856 for attr in iter {
3857 if let Ok(Nl80211Attrs::MacHint(val)) = attr {
3858 return Ok(val);
3859 }
3860 }
3861 Err(ErrorContext::new_missing(
3862 "Nl80211Attrs",
3863 "MacHint",
3864 self.orig_loc,
3865 self.buf.as_ptr() as usize,
3866 ))
3867 }
3868 pub fn get_wiphy_freq_hint(&self) -> Result<u32, ErrorContext> {
3869 let mut iter = self.clone();
3870 iter.pos = 0;
3871 for attr in iter {
3872 if let Ok(Nl80211Attrs::WiphyFreqHint(val)) = attr {
3873 return Ok(val);
3874 }
3875 }
3876 Err(ErrorContext::new_missing(
3877 "Nl80211Attrs",
3878 "WiphyFreqHint",
3879 self.orig_loc,
3880 self.buf.as_ptr() as usize,
3881 ))
3882 }
3883 pub fn get_max_ap_assoc_sta(&self) -> Result<u32, ErrorContext> {
3884 let mut iter = self.clone();
3885 iter.pos = 0;
3886 for attr in iter {
3887 if let Ok(Nl80211Attrs::MaxApAssocSta(val)) = attr {
3888 return Ok(val);
3889 }
3890 }
3891 Err(ErrorContext::new_missing(
3892 "Nl80211Attrs",
3893 "MaxApAssocSta",
3894 self.orig_loc,
3895 self.buf.as_ptr() as usize,
3896 ))
3897 }
3898 pub fn get_tdls_peer_capability(&self) -> Result<u32, ErrorContext> {
3899 let mut iter = self.clone();
3900 iter.pos = 0;
3901 for attr in iter {
3902 if let Ok(Nl80211Attrs::TdlsPeerCapability(val)) = attr {
3903 return Ok(val);
3904 }
3905 }
3906 Err(ErrorContext::new_missing(
3907 "Nl80211Attrs",
3908 "TdlsPeerCapability",
3909 self.orig_loc,
3910 self.buf.as_ptr() as usize,
3911 ))
3912 }
3913 pub fn get_socket_owner(&self) -> Result<(), ErrorContext> {
3914 let mut iter = self.clone();
3915 iter.pos = 0;
3916 for attr in iter {
3917 if let Ok(Nl80211Attrs::SocketOwner(val)) = attr {
3918 return Ok(val);
3919 }
3920 }
3921 Err(ErrorContext::new_missing(
3922 "Nl80211Attrs",
3923 "SocketOwner",
3924 self.orig_loc,
3925 self.buf.as_ptr() as usize,
3926 ))
3927 }
3928 pub fn get_csa_c_offsets_tx(&self) -> Result<&'a [u8], ErrorContext> {
3929 let mut iter = self.clone();
3930 iter.pos = 0;
3931 for attr in iter {
3932 if let Ok(Nl80211Attrs::CsaCOffsetsTx(val)) = attr {
3933 return Ok(val);
3934 }
3935 }
3936 Err(ErrorContext::new_missing(
3937 "Nl80211Attrs",
3938 "CsaCOffsetsTx",
3939 self.orig_loc,
3940 self.buf.as_ptr() as usize,
3941 ))
3942 }
3943 pub fn get_max_csa_counters(&self) -> Result<u8, ErrorContext> {
3944 let mut iter = self.clone();
3945 iter.pos = 0;
3946 for attr in iter {
3947 if let Ok(Nl80211Attrs::MaxCsaCounters(val)) = attr {
3948 return Ok(val);
3949 }
3950 }
3951 Err(ErrorContext::new_missing(
3952 "Nl80211Attrs",
3953 "MaxCsaCounters",
3954 self.orig_loc,
3955 self.buf.as_ptr() as usize,
3956 ))
3957 }
3958 pub fn get_tdls_initiator(&self) -> Result<(), ErrorContext> {
3959 let mut iter = self.clone();
3960 iter.pos = 0;
3961 for attr in iter {
3962 if let Ok(Nl80211Attrs::TdlsInitiator(val)) = attr {
3963 return Ok(val);
3964 }
3965 }
3966 Err(ErrorContext::new_missing(
3967 "Nl80211Attrs",
3968 "TdlsInitiator",
3969 self.orig_loc,
3970 self.buf.as_ptr() as usize,
3971 ))
3972 }
3973 pub fn get_use_rrm(&self) -> Result<(), ErrorContext> {
3974 let mut iter = self.clone();
3975 iter.pos = 0;
3976 for attr in iter {
3977 if let Ok(Nl80211Attrs::UseRrm(val)) = attr {
3978 return Ok(val);
3979 }
3980 }
3981 Err(ErrorContext::new_missing(
3982 "Nl80211Attrs",
3983 "UseRrm",
3984 self.orig_loc,
3985 self.buf.as_ptr() as usize,
3986 ))
3987 }
3988 pub fn get_wiphy_dyn_ack(&self) -> Result<(), ErrorContext> {
3989 let mut iter = self.clone();
3990 iter.pos = 0;
3991 for attr in iter {
3992 if let Ok(Nl80211Attrs::WiphyDynAck(val)) = attr {
3993 return Ok(val);
3994 }
3995 }
3996 Err(ErrorContext::new_missing(
3997 "Nl80211Attrs",
3998 "WiphyDynAck",
3999 self.orig_loc,
4000 self.buf.as_ptr() as usize,
4001 ))
4002 }
4003 pub fn get_tsid(&self) -> Result<u8, ErrorContext> {
4004 let mut iter = self.clone();
4005 iter.pos = 0;
4006 for attr in iter {
4007 if let Ok(Nl80211Attrs::Tsid(val)) = attr {
4008 return Ok(val);
4009 }
4010 }
4011 Err(ErrorContext::new_missing(
4012 "Nl80211Attrs",
4013 "Tsid",
4014 self.orig_loc,
4015 self.buf.as_ptr() as usize,
4016 ))
4017 }
4018 pub fn get_user_prio(&self) -> Result<u8, ErrorContext> {
4019 let mut iter = self.clone();
4020 iter.pos = 0;
4021 for attr in iter {
4022 if let Ok(Nl80211Attrs::UserPrio(val)) = attr {
4023 return Ok(val);
4024 }
4025 }
4026 Err(ErrorContext::new_missing(
4027 "Nl80211Attrs",
4028 "UserPrio",
4029 self.orig_loc,
4030 self.buf.as_ptr() as usize,
4031 ))
4032 }
4033 pub fn get_admitted_time(&self) -> Result<u16, ErrorContext> {
4034 let mut iter = self.clone();
4035 iter.pos = 0;
4036 for attr in iter {
4037 if let Ok(Nl80211Attrs::AdmittedTime(val)) = attr {
4038 return Ok(val);
4039 }
4040 }
4041 Err(ErrorContext::new_missing(
4042 "Nl80211Attrs",
4043 "AdmittedTime",
4044 self.orig_loc,
4045 self.buf.as_ptr() as usize,
4046 ))
4047 }
4048 pub fn get_smps_mode(&self) -> Result<u8, ErrorContext> {
4049 let mut iter = self.clone();
4050 iter.pos = 0;
4051 for attr in iter {
4052 if let Ok(Nl80211Attrs::SmpsMode(val)) = attr {
4053 return Ok(val);
4054 }
4055 }
4056 Err(ErrorContext::new_missing(
4057 "Nl80211Attrs",
4058 "SmpsMode",
4059 self.orig_loc,
4060 self.buf.as_ptr() as usize,
4061 ))
4062 }
4063 pub fn get_oper_class(&self) -> Result<u8, ErrorContext> {
4064 let mut iter = self.clone();
4065 iter.pos = 0;
4066 for attr in iter {
4067 if let Ok(Nl80211Attrs::OperClass(val)) = attr {
4068 return Ok(val);
4069 }
4070 }
4071 Err(ErrorContext::new_missing(
4072 "Nl80211Attrs",
4073 "OperClass",
4074 self.orig_loc,
4075 self.buf.as_ptr() as usize,
4076 ))
4077 }
4078 pub fn get_mac_mask(&self) -> Result<&'a [u8], ErrorContext> {
4079 let mut iter = self.clone();
4080 iter.pos = 0;
4081 for attr in iter {
4082 if let Ok(Nl80211Attrs::MacMask(val)) = attr {
4083 return Ok(val);
4084 }
4085 }
4086 Err(ErrorContext::new_missing(
4087 "Nl80211Attrs",
4088 "MacMask",
4089 self.orig_loc,
4090 self.buf.as_ptr() as usize,
4091 ))
4092 }
4093 pub fn get_wiphy_self_managed_reg(&self) -> Result<(), ErrorContext> {
4094 let mut iter = self.clone();
4095 iter.pos = 0;
4096 for attr in iter {
4097 if let Ok(Nl80211Attrs::WiphySelfManagedReg(val)) = attr {
4098 return Ok(val);
4099 }
4100 }
4101 Err(ErrorContext::new_missing(
4102 "Nl80211Attrs",
4103 "WiphySelfManagedReg",
4104 self.orig_loc,
4105 self.buf.as_ptr() as usize,
4106 ))
4107 }
4108 pub fn get_ext_features(&self) -> Result<&'a [u8], ErrorContext> {
4109 let mut iter = self.clone();
4110 iter.pos = 0;
4111 for attr in iter {
4112 if let Ok(Nl80211Attrs::ExtFeatures(val)) = attr {
4113 return Ok(val);
4114 }
4115 }
4116 Err(ErrorContext::new_missing(
4117 "Nl80211Attrs",
4118 "ExtFeatures",
4119 self.orig_loc,
4120 self.buf.as_ptr() as usize,
4121 ))
4122 }
4123 pub fn get_survey_radio_stats(&self) -> Result<&'a [u8], ErrorContext> {
4124 let mut iter = self.clone();
4125 iter.pos = 0;
4126 for attr in iter {
4127 if let Ok(Nl80211Attrs::SurveyRadioStats(val)) = attr {
4128 return Ok(val);
4129 }
4130 }
4131 Err(ErrorContext::new_missing(
4132 "Nl80211Attrs",
4133 "SurveyRadioStats",
4134 self.orig_loc,
4135 self.buf.as_ptr() as usize,
4136 ))
4137 }
4138 pub fn get_netns_fd(&self) -> Result<u32, ErrorContext> {
4139 let mut iter = self.clone();
4140 iter.pos = 0;
4141 for attr in iter {
4142 if let Ok(Nl80211Attrs::NetnsFd(val)) = attr {
4143 return Ok(val);
4144 }
4145 }
4146 Err(ErrorContext::new_missing(
4147 "Nl80211Attrs",
4148 "NetnsFd",
4149 self.orig_loc,
4150 self.buf.as_ptr() as usize,
4151 ))
4152 }
4153 pub fn get_sched_scan_delay(&self) -> Result<u32, ErrorContext> {
4154 let mut iter = self.clone();
4155 iter.pos = 0;
4156 for attr in iter {
4157 if let Ok(Nl80211Attrs::SchedScanDelay(val)) = attr {
4158 return Ok(val);
4159 }
4160 }
4161 Err(ErrorContext::new_missing(
4162 "Nl80211Attrs",
4163 "SchedScanDelay",
4164 self.orig_loc,
4165 self.buf.as_ptr() as usize,
4166 ))
4167 }
4168 pub fn get_reg_indoor(&self) -> Result<(), ErrorContext> {
4169 let mut iter = self.clone();
4170 iter.pos = 0;
4171 for attr in iter {
4172 if let Ok(Nl80211Attrs::RegIndoor(val)) = attr {
4173 return Ok(val);
4174 }
4175 }
4176 Err(ErrorContext::new_missing(
4177 "Nl80211Attrs",
4178 "RegIndoor",
4179 self.orig_loc,
4180 self.buf.as_ptr() as usize,
4181 ))
4182 }
4183 pub fn get_max_num_sched_scan_plans(&self) -> Result<u32, ErrorContext> {
4184 let mut iter = self.clone();
4185 iter.pos = 0;
4186 for attr in iter {
4187 if let Ok(Nl80211Attrs::MaxNumSchedScanPlans(val)) = attr {
4188 return Ok(val);
4189 }
4190 }
4191 Err(ErrorContext::new_missing(
4192 "Nl80211Attrs",
4193 "MaxNumSchedScanPlans",
4194 self.orig_loc,
4195 self.buf.as_ptr() as usize,
4196 ))
4197 }
4198 pub fn get_max_scan_plan_interval(&self) -> Result<u32, ErrorContext> {
4199 let mut iter = self.clone();
4200 iter.pos = 0;
4201 for attr in iter {
4202 if let Ok(Nl80211Attrs::MaxScanPlanInterval(val)) = attr {
4203 return Ok(val);
4204 }
4205 }
4206 Err(ErrorContext::new_missing(
4207 "Nl80211Attrs",
4208 "MaxScanPlanInterval",
4209 self.orig_loc,
4210 self.buf.as_ptr() as usize,
4211 ))
4212 }
4213 pub fn get_max_scan_plan_iterations(&self) -> Result<u32, ErrorContext> {
4214 let mut iter = self.clone();
4215 iter.pos = 0;
4216 for attr in iter {
4217 if let Ok(Nl80211Attrs::MaxScanPlanIterations(val)) = attr {
4218 return Ok(val);
4219 }
4220 }
4221 Err(ErrorContext::new_missing(
4222 "Nl80211Attrs",
4223 "MaxScanPlanIterations",
4224 self.orig_loc,
4225 self.buf.as_ptr() as usize,
4226 ))
4227 }
4228 pub fn get_sched_scan_plans(&self) -> Result<&'a [u8], ErrorContext> {
4229 let mut iter = self.clone();
4230 iter.pos = 0;
4231 for attr in iter {
4232 if let Ok(Nl80211Attrs::SchedScanPlans(val)) = attr {
4233 return Ok(val);
4234 }
4235 }
4236 Err(ErrorContext::new_missing(
4237 "Nl80211Attrs",
4238 "SchedScanPlans",
4239 self.orig_loc,
4240 self.buf.as_ptr() as usize,
4241 ))
4242 }
4243 pub fn get_pbss(&self) -> Result<(), ErrorContext> {
4244 let mut iter = self.clone();
4245 iter.pos = 0;
4246 for attr in iter {
4247 if let Ok(Nl80211Attrs::Pbss(val)) = attr {
4248 return Ok(val);
4249 }
4250 }
4251 Err(ErrorContext::new_missing(
4252 "Nl80211Attrs",
4253 "Pbss",
4254 self.orig_loc,
4255 self.buf.as_ptr() as usize,
4256 ))
4257 }
4258 pub fn get_bss_select(&self) -> Result<&'a [u8], ErrorContext> {
4259 let mut iter = self.clone();
4260 iter.pos = 0;
4261 for attr in iter {
4262 if let Ok(Nl80211Attrs::BssSelect(val)) = attr {
4263 return Ok(val);
4264 }
4265 }
4266 Err(ErrorContext::new_missing(
4267 "Nl80211Attrs",
4268 "BssSelect",
4269 self.orig_loc,
4270 self.buf.as_ptr() as usize,
4271 ))
4272 }
4273 pub fn get_sta_support_p2p_ps(&self) -> Result<u8, ErrorContext> {
4274 let mut iter = self.clone();
4275 iter.pos = 0;
4276 for attr in iter {
4277 if let Ok(Nl80211Attrs::StaSupportP2pPs(val)) = attr {
4278 return Ok(val);
4279 }
4280 }
4281 Err(ErrorContext::new_missing(
4282 "Nl80211Attrs",
4283 "StaSupportP2pPs",
4284 self.orig_loc,
4285 self.buf.as_ptr() as usize,
4286 ))
4287 }
4288 pub fn get_pad(&self) -> Result<&'a [u8], ErrorContext> {
4289 let mut iter = self.clone();
4290 iter.pos = 0;
4291 for attr in iter {
4292 if let Ok(Nl80211Attrs::Pad(val)) = attr {
4293 return Ok(val);
4294 }
4295 }
4296 Err(ErrorContext::new_missing(
4297 "Nl80211Attrs",
4298 "Pad",
4299 self.orig_loc,
4300 self.buf.as_ptr() as usize,
4301 ))
4302 }
4303 pub fn get_iftype_ext_capa(&self) -> Result<&'a [u8], ErrorContext> {
4304 let mut iter = self.clone();
4305 iter.pos = 0;
4306 for attr in iter {
4307 if let Ok(Nl80211Attrs::IftypeExtCapa(val)) = attr {
4308 return Ok(val);
4309 }
4310 }
4311 Err(ErrorContext::new_missing(
4312 "Nl80211Attrs",
4313 "IftypeExtCapa",
4314 self.orig_loc,
4315 self.buf.as_ptr() as usize,
4316 ))
4317 }
4318 pub fn get_mu_mimo_group_data(&self) -> Result<&'a [u8], ErrorContext> {
4319 let mut iter = self.clone();
4320 iter.pos = 0;
4321 for attr in iter {
4322 if let Ok(Nl80211Attrs::MuMimoGroupData(val)) = attr {
4323 return Ok(val);
4324 }
4325 }
4326 Err(ErrorContext::new_missing(
4327 "Nl80211Attrs",
4328 "MuMimoGroupData",
4329 self.orig_loc,
4330 self.buf.as_ptr() as usize,
4331 ))
4332 }
4333 pub fn get_mu_mimo_follow_mac_addr(&self) -> Result<&'a [u8], ErrorContext> {
4334 let mut iter = self.clone();
4335 iter.pos = 0;
4336 for attr in iter {
4337 if let Ok(Nl80211Attrs::MuMimoFollowMacAddr(val)) = attr {
4338 return Ok(val);
4339 }
4340 }
4341 Err(ErrorContext::new_missing(
4342 "Nl80211Attrs",
4343 "MuMimoFollowMacAddr",
4344 self.orig_loc,
4345 self.buf.as_ptr() as usize,
4346 ))
4347 }
4348 pub fn get_scan_start_time_tsf(&self) -> Result<u64, ErrorContext> {
4349 let mut iter = self.clone();
4350 iter.pos = 0;
4351 for attr in iter {
4352 if let Ok(Nl80211Attrs::ScanStartTimeTsf(val)) = attr {
4353 return Ok(val);
4354 }
4355 }
4356 Err(ErrorContext::new_missing(
4357 "Nl80211Attrs",
4358 "ScanStartTimeTsf",
4359 self.orig_loc,
4360 self.buf.as_ptr() as usize,
4361 ))
4362 }
4363 pub fn get_scan_start_time_tsf_bssid(&self) -> Result<&'a [u8], ErrorContext> {
4364 let mut iter = self.clone();
4365 iter.pos = 0;
4366 for attr in iter {
4367 if let Ok(Nl80211Attrs::ScanStartTimeTsfBssid(val)) = attr {
4368 return Ok(val);
4369 }
4370 }
4371 Err(ErrorContext::new_missing(
4372 "Nl80211Attrs",
4373 "ScanStartTimeTsfBssid",
4374 self.orig_loc,
4375 self.buf.as_ptr() as usize,
4376 ))
4377 }
4378 pub fn get_measurement_duration(&self) -> Result<u16, ErrorContext> {
4379 let mut iter = self.clone();
4380 iter.pos = 0;
4381 for attr in iter {
4382 if let Ok(Nl80211Attrs::MeasurementDuration(val)) = attr {
4383 return Ok(val);
4384 }
4385 }
4386 Err(ErrorContext::new_missing(
4387 "Nl80211Attrs",
4388 "MeasurementDuration",
4389 self.orig_loc,
4390 self.buf.as_ptr() as usize,
4391 ))
4392 }
4393 pub fn get_measurement_duration_mandatory(&self) -> Result<(), ErrorContext> {
4394 let mut iter = self.clone();
4395 iter.pos = 0;
4396 for attr in iter {
4397 if let Ok(Nl80211Attrs::MeasurementDurationMandatory(val)) = attr {
4398 return Ok(val);
4399 }
4400 }
4401 Err(ErrorContext::new_missing(
4402 "Nl80211Attrs",
4403 "MeasurementDurationMandatory",
4404 self.orig_loc,
4405 self.buf.as_ptr() as usize,
4406 ))
4407 }
4408 pub fn get_mesh_peer_aid(&self) -> Result<u16, ErrorContext> {
4409 let mut iter = self.clone();
4410 iter.pos = 0;
4411 for attr in iter {
4412 if let Ok(Nl80211Attrs::MeshPeerAid(val)) = attr {
4413 return Ok(val);
4414 }
4415 }
4416 Err(ErrorContext::new_missing(
4417 "Nl80211Attrs",
4418 "MeshPeerAid",
4419 self.orig_loc,
4420 self.buf.as_ptr() as usize,
4421 ))
4422 }
4423 pub fn get_nan_master_pref(&self) -> Result<u8, ErrorContext> {
4424 let mut iter = self.clone();
4425 iter.pos = 0;
4426 for attr in iter {
4427 if let Ok(Nl80211Attrs::NanMasterPref(val)) = attr {
4428 return Ok(val);
4429 }
4430 }
4431 Err(ErrorContext::new_missing(
4432 "Nl80211Attrs",
4433 "NanMasterPref",
4434 self.orig_loc,
4435 self.buf.as_ptr() as usize,
4436 ))
4437 }
4438 pub fn get_bands(&self) -> Result<u32, ErrorContext> {
4439 let mut iter = self.clone();
4440 iter.pos = 0;
4441 for attr in iter {
4442 if let Ok(Nl80211Attrs::Bands(val)) = attr {
4443 return Ok(val);
4444 }
4445 }
4446 Err(ErrorContext::new_missing(
4447 "Nl80211Attrs",
4448 "Bands",
4449 self.orig_loc,
4450 self.buf.as_ptr() as usize,
4451 ))
4452 }
4453 pub fn get_nan_func(&self) -> Result<&'a [u8], ErrorContext> {
4454 let mut iter = self.clone();
4455 iter.pos = 0;
4456 for attr in iter {
4457 if let Ok(Nl80211Attrs::NanFunc(val)) = attr {
4458 return Ok(val);
4459 }
4460 }
4461 Err(ErrorContext::new_missing(
4462 "Nl80211Attrs",
4463 "NanFunc",
4464 self.orig_loc,
4465 self.buf.as_ptr() as usize,
4466 ))
4467 }
4468 pub fn get_nan_match(&self) -> Result<&'a [u8], ErrorContext> {
4469 let mut iter = self.clone();
4470 iter.pos = 0;
4471 for attr in iter {
4472 if let Ok(Nl80211Attrs::NanMatch(val)) = attr {
4473 return Ok(val);
4474 }
4475 }
4476 Err(ErrorContext::new_missing(
4477 "Nl80211Attrs",
4478 "NanMatch",
4479 self.orig_loc,
4480 self.buf.as_ptr() as usize,
4481 ))
4482 }
4483 pub fn get_fils_kek(&self) -> Result<&'a [u8], ErrorContext> {
4484 let mut iter = self.clone();
4485 iter.pos = 0;
4486 for attr in iter {
4487 if let Ok(Nl80211Attrs::FilsKek(val)) = attr {
4488 return Ok(val);
4489 }
4490 }
4491 Err(ErrorContext::new_missing(
4492 "Nl80211Attrs",
4493 "FilsKek",
4494 self.orig_loc,
4495 self.buf.as_ptr() as usize,
4496 ))
4497 }
4498 pub fn get_fils_nonces(&self) -> Result<&'a [u8], ErrorContext> {
4499 let mut iter = self.clone();
4500 iter.pos = 0;
4501 for attr in iter {
4502 if let Ok(Nl80211Attrs::FilsNonces(val)) = attr {
4503 return Ok(val);
4504 }
4505 }
4506 Err(ErrorContext::new_missing(
4507 "Nl80211Attrs",
4508 "FilsNonces",
4509 self.orig_loc,
4510 self.buf.as_ptr() as usize,
4511 ))
4512 }
4513 pub fn get_multicast_to_unicast_enabled(&self) -> Result<(), ErrorContext> {
4514 let mut iter = self.clone();
4515 iter.pos = 0;
4516 for attr in iter {
4517 if let Ok(Nl80211Attrs::MulticastToUnicastEnabled(val)) = attr {
4518 return Ok(val);
4519 }
4520 }
4521 Err(ErrorContext::new_missing(
4522 "Nl80211Attrs",
4523 "MulticastToUnicastEnabled",
4524 self.orig_loc,
4525 self.buf.as_ptr() as usize,
4526 ))
4527 }
4528 pub fn get_bssid(&self) -> Result<&'a [u8], ErrorContext> {
4529 let mut iter = self.clone();
4530 iter.pos = 0;
4531 for attr in iter {
4532 if let Ok(Nl80211Attrs::Bssid(val)) = attr {
4533 return Ok(val);
4534 }
4535 }
4536 Err(ErrorContext::new_missing(
4537 "Nl80211Attrs",
4538 "Bssid",
4539 self.orig_loc,
4540 self.buf.as_ptr() as usize,
4541 ))
4542 }
4543 pub fn get_sched_scan_relative_rssi(&self) -> Result<i8, ErrorContext> {
4544 let mut iter = self.clone();
4545 iter.pos = 0;
4546 for attr in iter {
4547 if let Ok(Nl80211Attrs::SchedScanRelativeRssi(val)) = attr {
4548 return Ok(val);
4549 }
4550 }
4551 Err(ErrorContext::new_missing(
4552 "Nl80211Attrs",
4553 "SchedScanRelativeRssi",
4554 self.orig_loc,
4555 self.buf.as_ptr() as usize,
4556 ))
4557 }
4558 pub fn get_sched_scan_rssi_adjust(&self) -> Result<&'a [u8], ErrorContext> {
4559 let mut iter = self.clone();
4560 iter.pos = 0;
4561 for attr in iter {
4562 if let Ok(Nl80211Attrs::SchedScanRssiAdjust(val)) = attr {
4563 return Ok(val);
4564 }
4565 }
4566 Err(ErrorContext::new_missing(
4567 "Nl80211Attrs",
4568 "SchedScanRssiAdjust",
4569 self.orig_loc,
4570 self.buf.as_ptr() as usize,
4571 ))
4572 }
4573 pub fn get_timeout_reason(&self) -> Result<u32, ErrorContext> {
4574 let mut iter = self.clone();
4575 iter.pos = 0;
4576 for attr in iter {
4577 if let Ok(Nl80211Attrs::TimeoutReason(val)) = attr {
4578 return Ok(val);
4579 }
4580 }
4581 Err(ErrorContext::new_missing(
4582 "Nl80211Attrs",
4583 "TimeoutReason",
4584 self.orig_loc,
4585 self.buf.as_ptr() as usize,
4586 ))
4587 }
4588 pub fn get_fils_erp_username(&self) -> Result<&'a [u8], ErrorContext> {
4589 let mut iter = self.clone();
4590 iter.pos = 0;
4591 for attr in iter {
4592 if let Ok(Nl80211Attrs::FilsErpUsername(val)) = attr {
4593 return Ok(val);
4594 }
4595 }
4596 Err(ErrorContext::new_missing(
4597 "Nl80211Attrs",
4598 "FilsErpUsername",
4599 self.orig_loc,
4600 self.buf.as_ptr() as usize,
4601 ))
4602 }
4603 pub fn get_fils_erp_realm(&self) -> Result<&'a [u8], ErrorContext> {
4604 let mut iter = self.clone();
4605 iter.pos = 0;
4606 for attr in iter {
4607 if let Ok(Nl80211Attrs::FilsErpRealm(val)) = attr {
4608 return Ok(val);
4609 }
4610 }
4611 Err(ErrorContext::new_missing(
4612 "Nl80211Attrs",
4613 "FilsErpRealm",
4614 self.orig_loc,
4615 self.buf.as_ptr() as usize,
4616 ))
4617 }
4618 pub fn get_fils_erp_next_seq_num(&self) -> Result<u16, ErrorContext> {
4619 let mut iter = self.clone();
4620 iter.pos = 0;
4621 for attr in iter {
4622 if let Ok(Nl80211Attrs::FilsErpNextSeqNum(val)) = attr {
4623 return Ok(val);
4624 }
4625 }
4626 Err(ErrorContext::new_missing(
4627 "Nl80211Attrs",
4628 "FilsErpNextSeqNum",
4629 self.orig_loc,
4630 self.buf.as_ptr() as usize,
4631 ))
4632 }
4633 pub fn get_fils_erp_rrk(&self) -> Result<&'a [u8], ErrorContext> {
4634 let mut iter = self.clone();
4635 iter.pos = 0;
4636 for attr in iter {
4637 if let Ok(Nl80211Attrs::FilsErpRrk(val)) = attr {
4638 return Ok(val);
4639 }
4640 }
4641 Err(ErrorContext::new_missing(
4642 "Nl80211Attrs",
4643 "FilsErpRrk",
4644 self.orig_loc,
4645 self.buf.as_ptr() as usize,
4646 ))
4647 }
4648 pub fn get_fils_cache_id(&self) -> Result<&'a [u8], ErrorContext> {
4649 let mut iter = self.clone();
4650 iter.pos = 0;
4651 for attr in iter {
4652 if let Ok(Nl80211Attrs::FilsCacheId(val)) = attr {
4653 return Ok(val);
4654 }
4655 }
4656 Err(ErrorContext::new_missing(
4657 "Nl80211Attrs",
4658 "FilsCacheId",
4659 self.orig_loc,
4660 self.buf.as_ptr() as usize,
4661 ))
4662 }
4663 pub fn get_pmk(&self) -> Result<&'a [u8], ErrorContext> {
4664 let mut iter = self.clone();
4665 iter.pos = 0;
4666 for attr in iter {
4667 if let Ok(Nl80211Attrs::Pmk(val)) = attr {
4668 return Ok(val);
4669 }
4670 }
4671 Err(ErrorContext::new_missing(
4672 "Nl80211Attrs",
4673 "Pmk",
4674 self.orig_loc,
4675 self.buf.as_ptr() as usize,
4676 ))
4677 }
4678 pub fn get_sched_scan_multi(&self) -> Result<(), ErrorContext> {
4679 let mut iter = self.clone();
4680 iter.pos = 0;
4681 for attr in iter {
4682 if let Ok(Nl80211Attrs::SchedScanMulti(val)) = attr {
4683 return Ok(val);
4684 }
4685 }
4686 Err(ErrorContext::new_missing(
4687 "Nl80211Attrs",
4688 "SchedScanMulti",
4689 self.orig_loc,
4690 self.buf.as_ptr() as usize,
4691 ))
4692 }
4693 pub fn get_sched_scan_max_reqs(&self) -> Result<u32, ErrorContext> {
4694 let mut iter = self.clone();
4695 iter.pos = 0;
4696 for attr in iter {
4697 if let Ok(Nl80211Attrs::SchedScanMaxReqs(val)) = attr {
4698 return Ok(val);
4699 }
4700 }
4701 Err(ErrorContext::new_missing(
4702 "Nl80211Attrs",
4703 "SchedScanMaxReqs",
4704 self.orig_loc,
4705 self.buf.as_ptr() as usize,
4706 ))
4707 }
4708 pub fn get_want_1x_4way_hs(&self) -> Result<(), ErrorContext> {
4709 let mut iter = self.clone();
4710 iter.pos = 0;
4711 for attr in iter {
4712 if let Ok(Nl80211Attrs::Want1x4wayHs(val)) = attr {
4713 return Ok(val);
4714 }
4715 }
4716 Err(ErrorContext::new_missing(
4717 "Nl80211Attrs",
4718 "Want1x4wayHs",
4719 self.orig_loc,
4720 self.buf.as_ptr() as usize,
4721 ))
4722 }
4723 pub fn get_pmkr0_name(&self) -> Result<&'a [u8], ErrorContext> {
4724 let mut iter = self.clone();
4725 iter.pos = 0;
4726 for attr in iter {
4727 if let Ok(Nl80211Attrs::Pmkr0Name(val)) = attr {
4728 return Ok(val);
4729 }
4730 }
4731 Err(ErrorContext::new_missing(
4732 "Nl80211Attrs",
4733 "Pmkr0Name",
4734 self.orig_loc,
4735 self.buf.as_ptr() as usize,
4736 ))
4737 }
4738 pub fn get_port_authorized(&self) -> Result<&'a [u8], ErrorContext> {
4739 let mut iter = self.clone();
4740 iter.pos = 0;
4741 for attr in iter {
4742 if let Ok(Nl80211Attrs::PortAuthorized(val)) = attr {
4743 return Ok(val);
4744 }
4745 }
4746 Err(ErrorContext::new_missing(
4747 "Nl80211Attrs",
4748 "PortAuthorized",
4749 self.orig_loc,
4750 self.buf.as_ptr() as usize,
4751 ))
4752 }
4753 pub fn get_external_auth_action(&self) -> Result<u32, ErrorContext> {
4754 let mut iter = self.clone();
4755 iter.pos = 0;
4756 for attr in iter {
4757 if let Ok(Nl80211Attrs::ExternalAuthAction(val)) = attr {
4758 return Ok(val);
4759 }
4760 }
4761 Err(ErrorContext::new_missing(
4762 "Nl80211Attrs",
4763 "ExternalAuthAction",
4764 self.orig_loc,
4765 self.buf.as_ptr() as usize,
4766 ))
4767 }
4768 pub fn get_external_auth_support(&self) -> Result<(), ErrorContext> {
4769 let mut iter = self.clone();
4770 iter.pos = 0;
4771 for attr in iter {
4772 if let Ok(Nl80211Attrs::ExternalAuthSupport(val)) = attr {
4773 return Ok(val);
4774 }
4775 }
4776 Err(ErrorContext::new_missing(
4777 "Nl80211Attrs",
4778 "ExternalAuthSupport",
4779 self.orig_loc,
4780 self.buf.as_ptr() as usize,
4781 ))
4782 }
4783 pub fn get_nss(&self) -> Result<u8, ErrorContext> {
4784 let mut iter = self.clone();
4785 iter.pos = 0;
4786 for attr in iter {
4787 if let Ok(Nl80211Attrs::Nss(val)) = attr {
4788 return Ok(val);
4789 }
4790 }
4791 Err(ErrorContext::new_missing(
4792 "Nl80211Attrs",
4793 "Nss",
4794 self.orig_loc,
4795 self.buf.as_ptr() as usize,
4796 ))
4797 }
4798 pub fn get_ack_signal(&self) -> Result<i32, ErrorContext> {
4799 let mut iter = self.clone();
4800 iter.pos = 0;
4801 for attr in iter {
4802 if let Ok(Nl80211Attrs::AckSignal(val)) = attr {
4803 return Ok(val);
4804 }
4805 }
4806 Err(ErrorContext::new_missing(
4807 "Nl80211Attrs",
4808 "AckSignal",
4809 self.orig_loc,
4810 self.buf.as_ptr() as usize,
4811 ))
4812 }
4813 pub fn get_control_port_over_nl80211(&self) -> Result<(), ErrorContext> {
4814 let mut iter = self.clone();
4815 iter.pos = 0;
4816 for attr in iter {
4817 if let Ok(Nl80211Attrs::ControlPortOverNl80211(val)) = attr {
4818 return Ok(val);
4819 }
4820 }
4821 Err(ErrorContext::new_missing(
4822 "Nl80211Attrs",
4823 "ControlPortOverNl80211",
4824 self.orig_loc,
4825 self.buf.as_ptr() as usize,
4826 ))
4827 }
4828 pub fn get_txq_stats(&self) -> Result<IterableTxqStatsAttrs<'a>, ErrorContext> {
4829 let mut iter = self.clone();
4830 iter.pos = 0;
4831 for attr in iter {
4832 if let Ok(Nl80211Attrs::TxqStats(val)) = attr {
4833 return Ok(val);
4834 }
4835 }
4836 Err(ErrorContext::new_missing(
4837 "Nl80211Attrs",
4838 "TxqStats",
4839 self.orig_loc,
4840 self.buf.as_ptr() as usize,
4841 ))
4842 }
4843 pub fn get_txq_limit(&self) -> Result<u32, ErrorContext> {
4844 let mut iter = self.clone();
4845 iter.pos = 0;
4846 for attr in iter {
4847 if let Ok(Nl80211Attrs::TxqLimit(val)) = attr {
4848 return Ok(val);
4849 }
4850 }
4851 Err(ErrorContext::new_missing(
4852 "Nl80211Attrs",
4853 "TxqLimit",
4854 self.orig_loc,
4855 self.buf.as_ptr() as usize,
4856 ))
4857 }
4858 pub fn get_txq_memory_limit(&self) -> Result<u32, ErrorContext> {
4859 let mut iter = self.clone();
4860 iter.pos = 0;
4861 for attr in iter {
4862 if let Ok(Nl80211Attrs::TxqMemoryLimit(val)) = attr {
4863 return Ok(val);
4864 }
4865 }
4866 Err(ErrorContext::new_missing(
4867 "Nl80211Attrs",
4868 "TxqMemoryLimit",
4869 self.orig_loc,
4870 self.buf.as_ptr() as usize,
4871 ))
4872 }
4873 pub fn get_txq_quantum(&self) -> Result<u32, ErrorContext> {
4874 let mut iter = self.clone();
4875 iter.pos = 0;
4876 for attr in iter {
4877 if let Ok(Nl80211Attrs::TxqQuantum(val)) = attr {
4878 return Ok(val);
4879 }
4880 }
4881 Err(ErrorContext::new_missing(
4882 "Nl80211Attrs",
4883 "TxqQuantum",
4884 self.orig_loc,
4885 self.buf.as_ptr() as usize,
4886 ))
4887 }
4888 pub fn get_he_capability(&self) -> Result<&'a [u8], ErrorContext> {
4889 let mut iter = self.clone();
4890 iter.pos = 0;
4891 for attr in iter {
4892 if let Ok(Nl80211Attrs::HeCapability(val)) = attr {
4893 return Ok(val);
4894 }
4895 }
4896 Err(ErrorContext::new_missing(
4897 "Nl80211Attrs",
4898 "HeCapability",
4899 self.orig_loc,
4900 self.buf.as_ptr() as usize,
4901 ))
4902 }
4903 pub fn get_ftm_responder(&self) -> Result<&'a [u8], ErrorContext> {
4904 let mut iter = self.clone();
4905 iter.pos = 0;
4906 for attr in iter {
4907 if let Ok(Nl80211Attrs::FtmResponder(val)) = attr {
4908 return Ok(val);
4909 }
4910 }
4911 Err(ErrorContext::new_missing(
4912 "Nl80211Attrs",
4913 "FtmResponder",
4914 self.orig_loc,
4915 self.buf.as_ptr() as usize,
4916 ))
4917 }
4918 pub fn get_ftm_responder_stats(&self) -> Result<&'a [u8], ErrorContext> {
4919 let mut iter = self.clone();
4920 iter.pos = 0;
4921 for attr in iter {
4922 if let Ok(Nl80211Attrs::FtmResponderStats(val)) = attr {
4923 return Ok(val);
4924 }
4925 }
4926 Err(ErrorContext::new_missing(
4927 "Nl80211Attrs",
4928 "FtmResponderStats",
4929 self.orig_loc,
4930 self.buf.as_ptr() as usize,
4931 ))
4932 }
4933 pub fn get_timeout(&self) -> Result<u32, ErrorContext> {
4934 let mut iter = self.clone();
4935 iter.pos = 0;
4936 for attr in iter {
4937 if let Ok(Nl80211Attrs::Timeout(val)) = attr {
4938 return Ok(val);
4939 }
4940 }
4941 Err(ErrorContext::new_missing(
4942 "Nl80211Attrs",
4943 "Timeout",
4944 self.orig_loc,
4945 self.buf.as_ptr() as usize,
4946 ))
4947 }
4948 pub fn get_peer_measurements(&self) -> Result<&'a [u8], ErrorContext> {
4949 let mut iter = self.clone();
4950 iter.pos = 0;
4951 for attr in iter {
4952 if let Ok(Nl80211Attrs::PeerMeasurements(val)) = attr {
4953 return Ok(val);
4954 }
4955 }
4956 Err(ErrorContext::new_missing(
4957 "Nl80211Attrs",
4958 "PeerMeasurements",
4959 self.orig_loc,
4960 self.buf.as_ptr() as usize,
4961 ))
4962 }
4963 pub fn get_airtime_weight(&self) -> Result<u16, ErrorContext> {
4964 let mut iter = self.clone();
4965 iter.pos = 0;
4966 for attr in iter {
4967 if let Ok(Nl80211Attrs::AirtimeWeight(val)) = attr {
4968 return Ok(val);
4969 }
4970 }
4971 Err(ErrorContext::new_missing(
4972 "Nl80211Attrs",
4973 "AirtimeWeight",
4974 self.orig_loc,
4975 self.buf.as_ptr() as usize,
4976 ))
4977 }
4978 pub fn get_sta_tx_power_setting(&self) -> Result<u8, ErrorContext> {
4979 let mut iter = self.clone();
4980 iter.pos = 0;
4981 for attr in iter {
4982 if let Ok(Nl80211Attrs::StaTxPowerSetting(val)) = attr {
4983 return Ok(val);
4984 }
4985 }
4986 Err(ErrorContext::new_missing(
4987 "Nl80211Attrs",
4988 "StaTxPowerSetting",
4989 self.orig_loc,
4990 self.buf.as_ptr() as usize,
4991 ))
4992 }
4993 pub fn get_sta_tx_power(&self) -> Result<i16, ErrorContext> {
4994 let mut iter = self.clone();
4995 iter.pos = 0;
4996 for attr in iter {
4997 if let Ok(Nl80211Attrs::StaTxPower(val)) = attr {
4998 return Ok(val);
4999 }
5000 }
5001 Err(ErrorContext::new_missing(
5002 "Nl80211Attrs",
5003 "StaTxPower",
5004 self.orig_loc,
5005 self.buf.as_ptr() as usize,
5006 ))
5007 }
5008 pub fn get_sae_password(&self) -> Result<&'a [u8], ErrorContext> {
5009 let mut iter = self.clone();
5010 iter.pos = 0;
5011 for attr in iter {
5012 if let Ok(Nl80211Attrs::SaePassword(val)) = attr {
5013 return Ok(val);
5014 }
5015 }
5016 Err(ErrorContext::new_missing(
5017 "Nl80211Attrs",
5018 "SaePassword",
5019 self.orig_loc,
5020 self.buf.as_ptr() as usize,
5021 ))
5022 }
5023 pub fn get_twt_responder(&self) -> Result<(), ErrorContext> {
5024 let mut iter = self.clone();
5025 iter.pos = 0;
5026 for attr in iter {
5027 if let Ok(Nl80211Attrs::TwtResponder(val)) = attr {
5028 return Ok(val);
5029 }
5030 }
5031 Err(ErrorContext::new_missing(
5032 "Nl80211Attrs",
5033 "TwtResponder",
5034 self.orig_loc,
5035 self.buf.as_ptr() as usize,
5036 ))
5037 }
5038 pub fn get_he_obss_pd(&self) -> Result<&'a [u8], ErrorContext> {
5039 let mut iter = self.clone();
5040 iter.pos = 0;
5041 for attr in iter {
5042 if let Ok(Nl80211Attrs::HeObssPd(val)) = attr {
5043 return Ok(val);
5044 }
5045 }
5046 Err(ErrorContext::new_missing(
5047 "Nl80211Attrs",
5048 "HeObssPd",
5049 self.orig_loc,
5050 self.buf.as_ptr() as usize,
5051 ))
5052 }
5053 pub fn get_wiphy_edmg_channels(&self) -> Result<u8, ErrorContext> {
5054 let mut iter = self.clone();
5055 iter.pos = 0;
5056 for attr in iter {
5057 if let Ok(Nl80211Attrs::WiphyEdmgChannels(val)) = attr {
5058 return Ok(val);
5059 }
5060 }
5061 Err(ErrorContext::new_missing(
5062 "Nl80211Attrs",
5063 "WiphyEdmgChannels",
5064 self.orig_loc,
5065 self.buf.as_ptr() as usize,
5066 ))
5067 }
5068 pub fn get_wiphy_edmg_bw_config(&self) -> Result<u8, ErrorContext> {
5069 let mut iter = self.clone();
5070 iter.pos = 0;
5071 for attr in iter {
5072 if let Ok(Nl80211Attrs::WiphyEdmgBwConfig(val)) = attr {
5073 return Ok(val);
5074 }
5075 }
5076 Err(ErrorContext::new_missing(
5077 "Nl80211Attrs",
5078 "WiphyEdmgBwConfig",
5079 self.orig_loc,
5080 self.buf.as_ptr() as usize,
5081 ))
5082 }
5083 pub fn get_vlan_id(&self) -> Result<u16, ErrorContext> {
5084 let mut iter = self.clone();
5085 iter.pos = 0;
5086 for attr in iter {
5087 if let Ok(Nl80211Attrs::VlanId(val)) = attr {
5088 return Ok(val);
5089 }
5090 }
5091 Err(ErrorContext::new_missing(
5092 "Nl80211Attrs",
5093 "VlanId",
5094 self.orig_loc,
5095 self.buf.as_ptr() as usize,
5096 ))
5097 }
5098 pub fn get_he_bss_color(&self) -> Result<&'a [u8], ErrorContext> {
5099 let mut iter = self.clone();
5100 iter.pos = 0;
5101 for attr in iter {
5102 if let Ok(Nl80211Attrs::HeBssColor(val)) = attr {
5103 return Ok(val);
5104 }
5105 }
5106 Err(ErrorContext::new_missing(
5107 "Nl80211Attrs",
5108 "HeBssColor",
5109 self.orig_loc,
5110 self.buf.as_ptr() as usize,
5111 ))
5112 }
5113 pub fn get_iftype_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
5114 let mut iter = self.clone();
5115 iter.pos = 0;
5116 for attr in iter {
5117 if let Ok(Nl80211Attrs::IftypeAkmSuites(val)) = attr {
5118 return Ok(val);
5119 }
5120 }
5121 Err(ErrorContext::new_missing(
5122 "Nl80211Attrs",
5123 "IftypeAkmSuites",
5124 self.orig_loc,
5125 self.buf.as_ptr() as usize,
5126 ))
5127 }
5128 pub fn get_tid_config(&self) -> Result<&'a [u8], ErrorContext> {
5129 let mut iter = self.clone();
5130 iter.pos = 0;
5131 for attr in iter {
5132 if let Ok(Nl80211Attrs::TidConfig(val)) = attr {
5133 return Ok(val);
5134 }
5135 }
5136 Err(ErrorContext::new_missing(
5137 "Nl80211Attrs",
5138 "TidConfig",
5139 self.orig_loc,
5140 self.buf.as_ptr() as usize,
5141 ))
5142 }
5143 pub fn get_control_port_no_preauth(&self) -> Result<(), ErrorContext> {
5144 let mut iter = self.clone();
5145 iter.pos = 0;
5146 for attr in iter {
5147 if let Ok(Nl80211Attrs::ControlPortNoPreauth(val)) = attr {
5148 return Ok(val);
5149 }
5150 }
5151 Err(ErrorContext::new_missing(
5152 "Nl80211Attrs",
5153 "ControlPortNoPreauth",
5154 self.orig_loc,
5155 self.buf.as_ptr() as usize,
5156 ))
5157 }
5158 pub fn get_pmk_lifetime(&self) -> Result<u32, ErrorContext> {
5159 let mut iter = self.clone();
5160 iter.pos = 0;
5161 for attr in iter {
5162 if let Ok(Nl80211Attrs::PmkLifetime(val)) = attr {
5163 return Ok(val);
5164 }
5165 }
5166 Err(ErrorContext::new_missing(
5167 "Nl80211Attrs",
5168 "PmkLifetime",
5169 self.orig_loc,
5170 self.buf.as_ptr() as usize,
5171 ))
5172 }
5173 pub fn get_pmk_reauth_threshold(&self) -> Result<u8, ErrorContext> {
5174 let mut iter = self.clone();
5175 iter.pos = 0;
5176 for attr in iter {
5177 if let Ok(Nl80211Attrs::PmkReauthThreshold(val)) = attr {
5178 return Ok(val);
5179 }
5180 }
5181 Err(ErrorContext::new_missing(
5182 "Nl80211Attrs",
5183 "PmkReauthThreshold",
5184 self.orig_loc,
5185 self.buf.as_ptr() as usize,
5186 ))
5187 }
5188 pub fn get_receive_multicast(&self) -> Result<(), ErrorContext> {
5189 let mut iter = self.clone();
5190 iter.pos = 0;
5191 for attr in iter {
5192 if let Ok(Nl80211Attrs::ReceiveMulticast(val)) = attr {
5193 return Ok(val);
5194 }
5195 }
5196 Err(ErrorContext::new_missing(
5197 "Nl80211Attrs",
5198 "ReceiveMulticast",
5199 self.orig_loc,
5200 self.buf.as_ptr() as usize,
5201 ))
5202 }
5203 pub fn get_wiphy_freq_offset(&self) -> Result<u32, ErrorContext> {
5204 let mut iter = self.clone();
5205 iter.pos = 0;
5206 for attr in iter {
5207 if let Ok(Nl80211Attrs::WiphyFreqOffset(val)) = attr {
5208 return Ok(val);
5209 }
5210 }
5211 Err(ErrorContext::new_missing(
5212 "Nl80211Attrs",
5213 "WiphyFreqOffset",
5214 self.orig_loc,
5215 self.buf.as_ptr() as usize,
5216 ))
5217 }
5218 pub fn get_center_freq1_offset(&self) -> Result<u32, ErrorContext> {
5219 let mut iter = self.clone();
5220 iter.pos = 0;
5221 for attr in iter {
5222 if let Ok(Nl80211Attrs::CenterFreq1Offset(val)) = attr {
5223 return Ok(val);
5224 }
5225 }
5226 Err(ErrorContext::new_missing(
5227 "Nl80211Attrs",
5228 "CenterFreq1Offset",
5229 self.orig_loc,
5230 self.buf.as_ptr() as usize,
5231 ))
5232 }
5233 pub fn get_scan_freq_khz(&self) -> Result<&'a [u8], ErrorContext> {
5234 let mut iter = self.clone();
5235 iter.pos = 0;
5236 for attr in iter {
5237 if let Ok(Nl80211Attrs::ScanFreqKhz(val)) = attr {
5238 return Ok(val);
5239 }
5240 }
5241 Err(ErrorContext::new_missing(
5242 "Nl80211Attrs",
5243 "ScanFreqKhz",
5244 self.orig_loc,
5245 self.buf.as_ptr() as usize,
5246 ))
5247 }
5248 pub fn get_he_6ghz_capability(&self) -> Result<&'a [u8], ErrorContext> {
5249 let mut iter = self.clone();
5250 iter.pos = 0;
5251 for attr in iter {
5252 if let Ok(Nl80211Attrs::He6ghzCapability(val)) = attr {
5253 return Ok(val);
5254 }
5255 }
5256 Err(ErrorContext::new_missing(
5257 "Nl80211Attrs",
5258 "He6ghzCapability",
5259 self.orig_loc,
5260 self.buf.as_ptr() as usize,
5261 ))
5262 }
5263 pub fn get_fils_discovery(&self) -> Result<&'a [u8], ErrorContext> {
5264 let mut iter = self.clone();
5265 iter.pos = 0;
5266 for attr in iter {
5267 if let Ok(Nl80211Attrs::FilsDiscovery(val)) = attr {
5268 return Ok(val);
5269 }
5270 }
5271 Err(ErrorContext::new_missing(
5272 "Nl80211Attrs",
5273 "FilsDiscovery",
5274 self.orig_loc,
5275 self.buf.as_ptr() as usize,
5276 ))
5277 }
5278 pub fn get_unsol_bcast_probe_resp(&self) -> Result<&'a [u8], ErrorContext> {
5279 let mut iter = self.clone();
5280 iter.pos = 0;
5281 for attr in iter {
5282 if let Ok(Nl80211Attrs::UnsolBcastProbeResp(val)) = attr {
5283 return Ok(val);
5284 }
5285 }
5286 Err(ErrorContext::new_missing(
5287 "Nl80211Attrs",
5288 "UnsolBcastProbeResp",
5289 self.orig_loc,
5290 self.buf.as_ptr() as usize,
5291 ))
5292 }
5293 pub fn get_s1g_capability(&self) -> Result<&'a [u8], ErrorContext> {
5294 let mut iter = self.clone();
5295 iter.pos = 0;
5296 for attr in iter {
5297 if let Ok(Nl80211Attrs::S1gCapability(val)) = attr {
5298 return Ok(val);
5299 }
5300 }
5301 Err(ErrorContext::new_missing(
5302 "Nl80211Attrs",
5303 "S1gCapability",
5304 self.orig_loc,
5305 self.buf.as_ptr() as usize,
5306 ))
5307 }
5308 pub fn get_s1g_capability_mask(&self) -> Result<&'a [u8], ErrorContext> {
5309 let mut iter = self.clone();
5310 iter.pos = 0;
5311 for attr in iter {
5312 if let Ok(Nl80211Attrs::S1gCapabilityMask(val)) = attr {
5313 return Ok(val);
5314 }
5315 }
5316 Err(ErrorContext::new_missing(
5317 "Nl80211Attrs",
5318 "S1gCapabilityMask",
5319 self.orig_loc,
5320 self.buf.as_ptr() as usize,
5321 ))
5322 }
5323 pub fn get_sae_pwe(&self) -> Result<u8, ErrorContext> {
5324 let mut iter = self.clone();
5325 iter.pos = 0;
5326 for attr in iter {
5327 if let Ok(Nl80211Attrs::SaePwe(val)) = attr {
5328 return Ok(val);
5329 }
5330 }
5331 Err(ErrorContext::new_missing(
5332 "Nl80211Attrs",
5333 "SaePwe",
5334 self.orig_loc,
5335 self.buf.as_ptr() as usize,
5336 ))
5337 }
5338 pub fn get_reconnect_requested(&self) -> Result<&'a [u8], ErrorContext> {
5339 let mut iter = self.clone();
5340 iter.pos = 0;
5341 for attr in iter {
5342 if let Ok(Nl80211Attrs::ReconnectRequested(val)) = attr {
5343 return Ok(val);
5344 }
5345 }
5346 Err(ErrorContext::new_missing(
5347 "Nl80211Attrs",
5348 "ReconnectRequested",
5349 self.orig_loc,
5350 self.buf.as_ptr() as usize,
5351 ))
5352 }
5353 pub fn get_sar_spec(&self) -> Result<IterableSarAttributes<'a>, ErrorContext> {
5354 let mut iter = self.clone();
5355 iter.pos = 0;
5356 for attr in iter {
5357 if let Ok(Nl80211Attrs::SarSpec(val)) = attr {
5358 return Ok(val);
5359 }
5360 }
5361 Err(ErrorContext::new_missing(
5362 "Nl80211Attrs",
5363 "SarSpec",
5364 self.orig_loc,
5365 self.buf.as_ptr() as usize,
5366 ))
5367 }
5368 pub fn get_disable_he(&self) -> Result<(), ErrorContext> {
5369 let mut iter = self.clone();
5370 iter.pos = 0;
5371 for attr in iter {
5372 if let Ok(Nl80211Attrs::DisableHe(val)) = attr {
5373 return Ok(val);
5374 }
5375 }
5376 Err(ErrorContext::new_missing(
5377 "Nl80211Attrs",
5378 "DisableHe",
5379 self.orig_loc,
5380 self.buf.as_ptr() as usize,
5381 ))
5382 }
5383 pub fn get_obss_color_bitmap(&self) -> Result<u64, ErrorContext> {
5384 let mut iter = self.clone();
5385 iter.pos = 0;
5386 for attr in iter {
5387 if let Ok(Nl80211Attrs::ObssColorBitmap(val)) = attr {
5388 return Ok(val);
5389 }
5390 }
5391 Err(ErrorContext::new_missing(
5392 "Nl80211Attrs",
5393 "ObssColorBitmap",
5394 self.orig_loc,
5395 self.buf.as_ptr() as usize,
5396 ))
5397 }
5398 pub fn get_color_change_count(&self) -> Result<u8, ErrorContext> {
5399 let mut iter = self.clone();
5400 iter.pos = 0;
5401 for attr in iter {
5402 if let Ok(Nl80211Attrs::ColorChangeCount(val)) = attr {
5403 return Ok(val);
5404 }
5405 }
5406 Err(ErrorContext::new_missing(
5407 "Nl80211Attrs",
5408 "ColorChangeCount",
5409 self.orig_loc,
5410 self.buf.as_ptr() as usize,
5411 ))
5412 }
5413 pub fn get_color_change_color(&self) -> Result<u8, ErrorContext> {
5414 let mut iter = self.clone();
5415 iter.pos = 0;
5416 for attr in iter {
5417 if let Ok(Nl80211Attrs::ColorChangeColor(val)) = attr {
5418 return Ok(val);
5419 }
5420 }
5421 Err(ErrorContext::new_missing(
5422 "Nl80211Attrs",
5423 "ColorChangeColor",
5424 self.orig_loc,
5425 self.buf.as_ptr() as usize,
5426 ))
5427 }
5428 pub fn get_color_change_elems(&self) -> Result<&'a [u8], ErrorContext> {
5429 let mut iter = self.clone();
5430 iter.pos = 0;
5431 for attr in iter {
5432 if let Ok(Nl80211Attrs::ColorChangeElems(val)) = attr {
5433 return Ok(val);
5434 }
5435 }
5436 Err(ErrorContext::new_missing(
5437 "Nl80211Attrs",
5438 "ColorChangeElems",
5439 self.orig_loc,
5440 self.buf.as_ptr() as usize,
5441 ))
5442 }
5443 pub fn get_mbssid_config(&self) -> Result<&'a [u8], ErrorContext> {
5444 let mut iter = self.clone();
5445 iter.pos = 0;
5446 for attr in iter {
5447 if let Ok(Nl80211Attrs::MbssidConfig(val)) = attr {
5448 return Ok(val);
5449 }
5450 }
5451 Err(ErrorContext::new_missing(
5452 "Nl80211Attrs",
5453 "MbssidConfig",
5454 self.orig_loc,
5455 self.buf.as_ptr() as usize,
5456 ))
5457 }
5458 pub fn get_mbssid_elems(&self) -> Result<&'a [u8], ErrorContext> {
5459 let mut iter = self.clone();
5460 iter.pos = 0;
5461 for attr in iter {
5462 if let Ok(Nl80211Attrs::MbssidElems(val)) = attr {
5463 return Ok(val);
5464 }
5465 }
5466 Err(ErrorContext::new_missing(
5467 "Nl80211Attrs",
5468 "MbssidElems",
5469 self.orig_loc,
5470 self.buf.as_ptr() as usize,
5471 ))
5472 }
5473 pub fn get_radar_background(&self) -> Result<(), ErrorContext> {
5474 let mut iter = self.clone();
5475 iter.pos = 0;
5476 for attr in iter {
5477 if let Ok(Nl80211Attrs::RadarBackground(val)) = attr {
5478 return Ok(val);
5479 }
5480 }
5481 Err(ErrorContext::new_missing(
5482 "Nl80211Attrs",
5483 "RadarBackground",
5484 self.orig_loc,
5485 self.buf.as_ptr() as usize,
5486 ))
5487 }
5488 pub fn get_ap_settings_flags(&self) -> Result<u32, ErrorContext> {
5489 let mut iter = self.clone();
5490 iter.pos = 0;
5491 for attr in iter {
5492 if let Ok(Nl80211Attrs::ApSettingsFlags(val)) = attr {
5493 return Ok(val);
5494 }
5495 }
5496 Err(ErrorContext::new_missing(
5497 "Nl80211Attrs",
5498 "ApSettingsFlags",
5499 self.orig_loc,
5500 self.buf.as_ptr() as usize,
5501 ))
5502 }
5503 pub fn get_eht_capability(&self) -> Result<&'a [u8], ErrorContext> {
5504 let mut iter = self.clone();
5505 iter.pos = 0;
5506 for attr in iter {
5507 if let Ok(Nl80211Attrs::EhtCapability(val)) = attr {
5508 return Ok(val);
5509 }
5510 }
5511 Err(ErrorContext::new_missing(
5512 "Nl80211Attrs",
5513 "EhtCapability",
5514 self.orig_loc,
5515 self.buf.as_ptr() as usize,
5516 ))
5517 }
5518 pub fn get_disable_eht(&self) -> Result<(), ErrorContext> {
5519 let mut iter = self.clone();
5520 iter.pos = 0;
5521 for attr in iter {
5522 if let Ok(Nl80211Attrs::DisableEht(val)) = attr {
5523 return Ok(val);
5524 }
5525 }
5526 Err(ErrorContext::new_missing(
5527 "Nl80211Attrs",
5528 "DisableEht",
5529 self.orig_loc,
5530 self.buf.as_ptr() as usize,
5531 ))
5532 }
5533 pub fn get_mlo_links(&self) -> Result<&'a [u8], ErrorContext> {
5534 let mut iter = self.clone();
5535 iter.pos = 0;
5536 for attr in iter {
5537 if let Ok(Nl80211Attrs::MloLinks(val)) = attr {
5538 return Ok(val);
5539 }
5540 }
5541 Err(ErrorContext::new_missing(
5542 "Nl80211Attrs",
5543 "MloLinks",
5544 self.orig_loc,
5545 self.buf.as_ptr() as usize,
5546 ))
5547 }
5548 pub fn get_mlo_link_id(&self) -> Result<u8, ErrorContext> {
5549 let mut iter = self.clone();
5550 iter.pos = 0;
5551 for attr in iter {
5552 if let Ok(Nl80211Attrs::MloLinkId(val)) = attr {
5553 return Ok(val);
5554 }
5555 }
5556 Err(ErrorContext::new_missing(
5557 "Nl80211Attrs",
5558 "MloLinkId",
5559 self.orig_loc,
5560 self.buf.as_ptr() as usize,
5561 ))
5562 }
5563 pub fn get_mld_addr(&self) -> Result<&'a [u8], ErrorContext> {
5564 let mut iter = self.clone();
5565 iter.pos = 0;
5566 for attr in iter {
5567 if let Ok(Nl80211Attrs::MldAddr(val)) = attr {
5568 return Ok(val);
5569 }
5570 }
5571 Err(ErrorContext::new_missing(
5572 "Nl80211Attrs",
5573 "MldAddr",
5574 self.orig_loc,
5575 self.buf.as_ptr() as usize,
5576 ))
5577 }
5578 pub fn get_mlo_support(&self) -> Result<(), ErrorContext> {
5579 let mut iter = self.clone();
5580 iter.pos = 0;
5581 for attr in iter {
5582 if let Ok(Nl80211Attrs::MloSupport(val)) = attr {
5583 return Ok(val);
5584 }
5585 }
5586 Err(ErrorContext::new_missing(
5587 "Nl80211Attrs",
5588 "MloSupport",
5589 self.orig_loc,
5590 self.buf.as_ptr() as usize,
5591 ))
5592 }
5593 pub fn get_max_num_akm_suites(&self) -> Result<&'a [u8], ErrorContext> {
5594 let mut iter = self.clone();
5595 iter.pos = 0;
5596 for attr in iter {
5597 if let Ok(Nl80211Attrs::MaxNumAkmSuites(val)) = attr {
5598 return Ok(val);
5599 }
5600 }
5601 Err(ErrorContext::new_missing(
5602 "Nl80211Attrs",
5603 "MaxNumAkmSuites",
5604 self.orig_loc,
5605 self.buf.as_ptr() as usize,
5606 ))
5607 }
5608 pub fn get_eml_capability(&self) -> Result<u16, ErrorContext> {
5609 let mut iter = self.clone();
5610 iter.pos = 0;
5611 for attr in iter {
5612 if let Ok(Nl80211Attrs::EmlCapability(val)) = attr {
5613 return Ok(val);
5614 }
5615 }
5616 Err(ErrorContext::new_missing(
5617 "Nl80211Attrs",
5618 "EmlCapability",
5619 self.orig_loc,
5620 self.buf.as_ptr() as usize,
5621 ))
5622 }
5623 pub fn get_mld_capa_and_ops(&self) -> Result<u16, ErrorContext> {
5624 let mut iter = self.clone();
5625 iter.pos = 0;
5626 for attr in iter {
5627 if let Ok(Nl80211Attrs::MldCapaAndOps(val)) = attr {
5628 return Ok(val);
5629 }
5630 }
5631 Err(ErrorContext::new_missing(
5632 "Nl80211Attrs",
5633 "MldCapaAndOps",
5634 self.orig_loc,
5635 self.buf.as_ptr() as usize,
5636 ))
5637 }
5638 pub fn get_tx_hw_timestamp(&self) -> Result<u64, ErrorContext> {
5639 let mut iter = self.clone();
5640 iter.pos = 0;
5641 for attr in iter {
5642 if let Ok(Nl80211Attrs::TxHwTimestamp(val)) = attr {
5643 return Ok(val);
5644 }
5645 }
5646 Err(ErrorContext::new_missing(
5647 "Nl80211Attrs",
5648 "TxHwTimestamp",
5649 self.orig_loc,
5650 self.buf.as_ptr() as usize,
5651 ))
5652 }
5653 pub fn get_rx_hw_timestamp(&self) -> Result<u64, ErrorContext> {
5654 let mut iter = self.clone();
5655 iter.pos = 0;
5656 for attr in iter {
5657 if let Ok(Nl80211Attrs::RxHwTimestamp(val)) = attr {
5658 return Ok(val);
5659 }
5660 }
5661 Err(ErrorContext::new_missing(
5662 "Nl80211Attrs",
5663 "RxHwTimestamp",
5664 self.orig_loc,
5665 self.buf.as_ptr() as usize,
5666 ))
5667 }
5668 pub fn get_td_bitmap(&self) -> Result<&'a [u8], ErrorContext> {
5669 let mut iter = self.clone();
5670 iter.pos = 0;
5671 for attr in iter {
5672 if let Ok(Nl80211Attrs::TdBitmap(val)) = attr {
5673 return Ok(val);
5674 }
5675 }
5676 Err(ErrorContext::new_missing(
5677 "Nl80211Attrs",
5678 "TdBitmap",
5679 self.orig_loc,
5680 self.buf.as_ptr() as usize,
5681 ))
5682 }
5683 pub fn get_punct_bitmap(&self) -> Result<u32, ErrorContext> {
5684 let mut iter = self.clone();
5685 iter.pos = 0;
5686 for attr in iter {
5687 if let Ok(Nl80211Attrs::PunctBitmap(val)) = attr {
5688 return Ok(val);
5689 }
5690 }
5691 Err(ErrorContext::new_missing(
5692 "Nl80211Attrs",
5693 "PunctBitmap",
5694 self.orig_loc,
5695 self.buf.as_ptr() as usize,
5696 ))
5697 }
5698 pub fn get_max_hw_timestamp_peers(&self) -> Result<u16, ErrorContext> {
5699 let mut iter = self.clone();
5700 iter.pos = 0;
5701 for attr in iter {
5702 if let Ok(Nl80211Attrs::MaxHwTimestampPeers(val)) = attr {
5703 return Ok(val);
5704 }
5705 }
5706 Err(ErrorContext::new_missing(
5707 "Nl80211Attrs",
5708 "MaxHwTimestampPeers",
5709 self.orig_loc,
5710 self.buf.as_ptr() as usize,
5711 ))
5712 }
5713 pub fn get_hw_timestamp_enabled(&self) -> Result<(), ErrorContext> {
5714 let mut iter = self.clone();
5715 iter.pos = 0;
5716 for attr in iter {
5717 if let Ok(Nl80211Attrs::HwTimestampEnabled(val)) = attr {
5718 return Ok(val);
5719 }
5720 }
5721 Err(ErrorContext::new_missing(
5722 "Nl80211Attrs",
5723 "HwTimestampEnabled",
5724 self.orig_loc,
5725 self.buf.as_ptr() as usize,
5726 ))
5727 }
5728 pub fn get_ema_rnr_elems(&self) -> Result<&'a [u8], ErrorContext> {
5729 let mut iter = self.clone();
5730 iter.pos = 0;
5731 for attr in iter {
5732 if let Ok(Nl80211Attrs::EmaRnrElems(val)) = attr {
5733 return Ok(val);
5734 }
5735 }
5736 Err(ErrorContext::new_missing(
5737 "Nl80211Attrs",
5738 "EmaRnrElems",
5739 self.orig_loc,
5740 self.buf.as_ptr() as usize,
5741 ))
5742 }
5743 pub fn get_mlo_link_disabled(&self) -> Result<(), ErrorContext> {
5744 let mut iter = self.clone();
5745 iter.pos = 0;
5746 for attr in iter {
5747 if let Ok(Nl80211Attrs::MloLinkDisabled(val)) = attr {
5748 return Ok(val);
5749 }
5750 }
5751 Err(ErrorContext::new_missing(
5752 "Nl80211Attrs",
5753 "MloLinkDisabled",
5754 self.orig_loc,
5755 self.buf.as_ptr() as usize,
5756 ))
5757 }
5758 pub fn get_bss_dump_include_use_data(&self) -> Result<(), ErrorContext> {
5759 let mut iter = self.clone();
5760 iter.pos = 0;
5761 for attr in iter {
5762 if let Ok(Nl80211Attrs::BssDumpIncludeUseData(val)) = attr {
5763 return Ok(val);
5764 }
5765 }
5766 Err(ErrorContext::new_missing(
5767 "Nl80211Attrs",
5768 "BssDumpIncludeUseData",
5769 self.orig_loc,
5770 self.buf.as_ptr() as usize,
5771 ))
5772 }
5773 pub fn get_mlo_ttlm_dlink(&self) -> Result<u16, ErrorContext> {
5774 let mut iter = self.clone();
5775 iter.pos = 0;
5776 for attr in iter {
5777 if let Ok(Nl80211Attrs::MloTtlmDlink(val)) = attr {
5778 return Ok(val);
5779 }
5780 }
5781 Err(ErrorContext::new_missing(
5782 "Nl80211Attrs",
5783 "MloTtlmDlink",
5784 self.orig_loc,
5785 self.buf.as_ptr() as usize,
5786 ))
5787 }
5788 pub fn get_mlo_ttlm_ulink(&self) -> Result<u16, ErrorContext> {
5789 let mut iter = self.clone();
5790 iter.pos = 0;
5791 for attr in iter {
5792 if let Ok(Nl80211Attrs::MloTtlmUlink(val)) = attr {
5793 return Ok(val);
5794 }
5795 }
5796 Err(ErrorContext::new_missing(
5797 "Nl80211Attrs",
5798 "MloTtlmUlink",
5799 self.orig_loc,
5800 self.buf.as_ptr() as usize,
5801 ))
5802 }
5803 pub fn get_assoc_spp_amsdu(&self) -> Result<(), ErrorContext> {
5804 let mut iter = self.clone();
5805 iter.pos = 0;
5806 for attr in iter {
5807 if let Ok(Nl80211Attrs::AssocSppAmsdu(val)) = attr {
5808 return Ok(val);
5809 }
5810 }
5811 Err(ErrorContext::new_missing(
5812 "Nl80211Attrs",
5813 "AssocSppAmsdu",
5814 self.orig_loc,
5815 self.buf.as_ptr() as usize,
5816 ))
5817 }
5818 pub fn get_wiphy_radios(&self) -> Result<&'a [u8], ErrorContext> {
5819 let mut iter = self.clone();
5820 iter.pos = 0;
5821 for attr in iter {
5822 if let Ok(Nl80211Attrs::WiphyRadios(val)) = attr {
5823 return Ok(val);
5824 }
5825 }
5826 Err(ErrorContext::new_missing(
5827 "Nl80211Attrs",
5828 "WiphyRadios",
5829 self.orig_loc,
5830 self.buf.as_ptr() as usize,
5831 ))
5832 }
5833 pub fn get_wiphy_interface_combinations(&self) -> Result<&'a [u8], ErrorContext> {
5834 let mut iter = self.clone();
5835 iter.pos = 0;
5836 for attr in iter {
5837 if let Ok(Nl80211Attrs::WiphyInterfaceCombinations(val)) = attr {
5838 return Ok(val);
5839 }
5840 }
5841 Err(ErrorContext::new_missing(
5842 "Nl80211Attrs",
5843 "WiphyInterfaceCombinations",
5844 self.orig_loc,
5845 self.buf.as_ptr() as usize,
5846 ))
5847 }
5848 pub fn get_vif_radio_mask(&self) -> Result<u32, ErrorContext> {
5849 let mut iter = self.clone();
5850 iter.pos = 0;
5851 for attr in iter {
5852 if let Ok(Nl80211Attrs::VifRadioMask(val)) = attr {
5853 return Ok(val);
5854 }
5855 }
5856 Err(ErrorContext::new_missing(
5857 "Nl80211Attrs",
5858 "VifRadioMask",
5859 self.orig_loc,
5860 self.buf.as_ptr() as usize,
5861 ))
5862 }
5863}
5864#[derive(Clone, Copy, Default)]
5865pub struct IterableArrayU32<'a> {
5866 buf: &'a [u8],
5867 pos: usize,
5868 orig_loc: usize,
5869}
5870impl<'a> IterableArrayU32<'a> {
5871 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
5872 Self {
5873 buf,
5874 pos: 0,
5875 orig_loc,
5876 }
5877 }
5878 pub fn get_buf(&self) -> &'a [u8] {
5879 self.buf
5880 }
5881}
5882impl<'a> Iterator for IterableArrayU32<'a> {
5883 type Item = Result<u32, ErrorContext>;
5884 fn next(&mut self) -> Option<Self::Item> {
5885 if self.buf.len() == self.pos {
5886 return None;
5887 }
5888 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
5889 {
5890 let Some(res) = parse_u32(next) else { break };
5891 return Some(Ok(res));
5892 }
5893 }
5894 let pos = self.pos;
5895 self.pos = self.buf.len();
5896 Some(Err(ErrorContext::new(
5897 "u32",
5898 None,
5899 self.orig_loc,
5900 self.buf.as_ptr().wrapping_add(pos) as usize,
5901 )))
5902 }
5903}
5904impl<'a> IfCombinationAttributes<'a> {
5905 pub fn new_array(buf: &[u8]) -> IterableArrayIfCombinationAttributes<'_> {
5906 IterableArrayIfCombinationAttributes::with_loc(buf, buf.as_ptr() as usize)
5907 }
5908}
5909#[derive(Clone, Copy, Default)]
5910pub struct IterableArrayIfCombinationAttributes<'a> {
5911 buf: &'a [u8],
5912 pos: usize,
5913 orig_loc: usize,
5914}
5915impl<'a> IterableArrayIfCombinationAttributes<'a> {
5916 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
5917 Self {
5918 buf,
5919 pos: 0,
5920 orig_loc,
5921 }
5922 }
5923 pub fn get_buf(&self) -> &'a [u8] {
5924 self.buf
5925 }
5926}
5927impl<'a> Iterator for IterableArrayIfCombinationAttributes<'a> {
5928 type Item = Result<IterableIfCombinationAttributes<'a>, ErrorContext>;
5929 fn next(&mut self) -> Option<Self::Item> {
5930 if self.buf.len() == self.pos {
5931 return None;
5932 }
5933 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
5934 {
5935 return Some(Ok(IterableIfCombinationAttributes::with_loc(
5936 next,
5937 self.orig_loc,
5938 )));
5939 }
5940 }
5941 let pos = self.pos;
5942 self.pos = self.buf.len();
5943 Some(Err(ErrorContext::new(
5944 "IfCombinationAttributes",
5945 None,
5946 self.orig_loc,
5947 self.buf.as_ptr().wrapping_add(pos) as usize,
5948 )))
5949 }
5950}
5951impl Nl80211Attrs<'_> {
5952 pub fn new<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
5953 IterableNl80211Attrs::with_loc(buf, buf.as_ptr() as usize)
5954 }
5955 fn attr_from_type(r#type: u16) -> Option<&'static str> {
5956 let res = match r#type {
5957 1u16 => "Wiphy",
5958 2u16 => "WiphyName",
5959 3u16 => "Ifindex",
5960 4u16 => "Ifname",
5961 5u16 => "Iftype",
5962 6u16 => "Mac",
5963 7u16 => "KeyData",
5964 8u16 => "KeyIdx",
5965 9u16 => "KeyCipher",
5966 10u16 => "KeySeq",
5967 11u16 => "KeyDefault",
5968 12u16 => "BeaconInterval",
5969 13u16 => "DtimPeriod",
5970 14u16 => "BeaconHead",
5971 15u16 => "BeaconTail",
5972 16u16 => "StaAid",
5973 17u16 => "StaFlags",
5974 18u16 => "StaListenInterval",
5975 19u16 => "StaSupportedRates",
5976 20u16 => "StaVlan",
5977 21u16 => "StaInfo",
5978 22u16 => "WiphyBands",
5979 23u16 => "MntrFlags",
5980 24u16 => "MeshId",
5981 25u16 => "StaPlinkAction",
5982 26u16 => "MpathNextHop",
5983 27u16 => "MpathInfo",
5984 28u16 => "BssCtsProt",
5985 29u16 => "BssShortPreamble",
5986 30u16 => "BssShortSlotTime",
5987 31u16 => "HtCapability",
5988 32u16 => "SupportedIftypes",
5989 33u16 => "RegAlpha2",
5990 34u16 => "RegRules",
5991 35u16 => "MeshConfig",
5992 36u16 => "BssBasicRates",
5993 37u16 => "WiphyTxqParams",
5994 38u16 => "WiphyFreq",
5995 39u16 => "WiphyChannelType",
5996 40u16 => "KeyDefaultMgmt",
5997 41u16 => "MgmtSubtype",
5998 42u16 => "Ie",
5999 43u16 => "MaxNumScanSsids",
6000 44u16 => "ScanFrequencies",
6001 45u16 => "ScanSsids",
6002 46u16 => "Generation",
6003 47u16 => "Bss",
6004 48u16 => "RegInitiator",
6005 49u16 => "RegType",
6006 50u16 => "SupportedCommands",
6007 51u16 => "Frame",
6008 52u16 => "Ssid",
6009 53u16 => "AuthType",
6010 54u16 => "ReasonCode",
6011 55u16 => "KeyType",
6012 56u16 => "MaxScanIeLen",
6013 57u16 => "CipherSuites",
6014 58u16 => "FreqBefore",
6015 59u16 => "FreqAfter",
6016 60u16 => "FreqFixed",
6017 61u16 => "WiphyRetryShort",
6018 62u16 => "WiphyRetryLong",
6019 63u16 => "WiphyFragThreshold",
6020 64u16 => "WiphyRtsThreshold",
6021 65u16 => "TimedOut",
6022 66u16 => "UseMfp",
6023 67u16 => "StaFlags2",
6024 68u16 => "ControlPort",
6025 69u16 => "Testdata",
6026 70u16 => "Privacy",
6027 71u16 => "DisconnectedByAp",
6028 72u16 => "StatusCode",
6029 73u16 => "CipherSuitesPairwise",
6030 74u16 => "CipherSuiteGroup",
6031 75u16 => "WpaVersions",
6032 76u16 => "AkmSuites",
6033 77u16 => "ReqIe",
6034 78u16 => "RespIe",
6035 79u16 => "PrevBssid",
6036 80u16 => "Key",
6037 81u16 => "Keys",
6038 82u16 => "Pid",
6039 83u16 => "4addr",
6040 84u16 => "SurveyInfo",
6041 85u16 => "Pmkid",
6042 86u16 => "MaxNumPmkids",
6043 87u16 => "Duration",
6044 88u16 => "Cookie",
6045 89u16 => "WiphyCoverageClass",
6046 90u16 => "TxRates",
6047 91u16 => "FrameMatch",
6048 92u16 => "Ack",
6049 93u16 => "PsState",
6050 94u16 => "Cqm",
6051 95u16 => "LocalStateChange",
6052 96u16 => "ApIsolate",
6053 97u16 => "WiphyTxPowerSetting",
6054 98u16 => "WiphyTxPowerLevel",
6055 99u16 => "TxFrameTypes",
6056 100u16 => "RxFrameTypes",
6057 101u16 => "FrameType",
6058 102u16 => "ControlPortEthertype",
6059 103u16 => "ControlPortNoEncrypt",
6060 104u16 => "SupportIbssRsn",
6061 105u16 => "WiphyAntennaTx",
6062 106u16 => "WiphyAntennaRx",
6063 107u16 => "McastRate",
6064 108u16 => "OffchannelTxOk",
6065 109u16 => "BssHtOpmode",
6066 110u16 => "KeyDefaultTypes",
6067 111u16 => "MaxRemainOnChannelDuration",
6068 112u16 => "MeshSetup",
6069 113u16 => "WiphyAntennaAvailTx",
6070 114u16 => "WiphyAntennaAvailRx",
6071 115u16 => "SupportMeshAuth",
6072 116u16 => "StaPlinkState",
6073 117u16 => "WowlanTriggers",
6074 118u16 => "WowlanTriggersSupported",
6075 119u16 => "SchedScanInterval",
6076 120u16 => "InterfaceCombinations",
6077 121u16 => "SoftwareIftypes",
6078 122u16 => "RekeyData",
6079 123u16 => "MaxNumSchedScanSsids",
6080 124u16 => "MaxSchedScanIeLen",
6081 125u16 => "ScanSuppRates",
6082 126u16 => "HiddenSsid",
6083 127u16 => "IeProbeResp",
6084 128u16 => "IeAssocResp",
6085 129u16 => "StaWme",
6086 130u16 => "SupportApUapsd",
6087 131u16 => "RoamSupport",
6088 132u16 => "SchedScanMatch",
6089 133u16 => "MaxMatchSets",
6090 134u16 => "PmksaCandidate",
6091 135u16 => "TxNoCckRate",
6092 136u16 => "TdlsAction",
6093 137u16 => "TdlsDialogToken",
6094 138u16 => "TdlsOperation",
6095 139u16 => "TdlsSupport",
6096 140u16 => "TdlsExternalSetup",
6097 141u16 => "DeviceApSme",
6098 142u16 => "DontWaitForAck",
6099 143u16 => "FeatureFlags",
6100 144u16 => "ProbeRespOffload",
6101 145u16 => "ProbeResp",
6102 146u16 => "DfsRegion",
6103 147u16 => "DisableHt",
6104 148u16 => "HtCapabilityMask",
6105 149u16 => "NoackMap",
6106 150u16 => "InactivityTimeout",
6107 151u16 => "RxSignalDbm",
6108 152u16 => "BgScanPeriod",
6109 153u16 => "Wdev",
6110 154u16 => "UserRegHintType",
6111 155u16 => "ConnFailedReason",
6112 156u16 => "AuthData",
6113 157u16 => "VhtCapability",
6114 158u16 => "ScanFlags",
6115 159u16 => "ChannelWidth",
6116 160u16 => "CenterFreq1",
6117 161u16 => "CenterFreq2",
6118 162u16 => "P2pCtwindow",
6119 163u16 => "P2pOppps",
6120 164u16 => "LocalMeshPowerMode",
6121 165u16 => "AclPolicy",
6122 166u16 => "MacAddrs",
6123 167u16 => "MacAclMax",
6124 168u16 => "RadarEvent",
6125 169u16 => "ExtCapa",
6126 170u16 => "ExtCapaMask",
6127 171u16 => "StaCapability",
6128 172u16 => "StaExtCapability",
6129 173u16 => "ProtocolFeatures",
6130 174u16 => "SplitWiphyDump",
6131 175u16 => "DisableVht",
6132 176u16 => "VhtCapabilityMask",
6133 177u16 => "Mdid",
6134 178u16 => "IeRic",
6135 179u16 => "CritProtId",
6136 180u16 => "MaxCritProtDuration",
6137 181u16 => "PeerAid",
6138 182u16 => "CoalesceRule",
6139 183u16 => "ChSwitchCount",
6140 184u16 => "ChSwitchBlockTx",
6141 185u16 => "CsaIes",
6142 186u16 => "CntdwnOffsBeacon",
6143 187u16 => "CntdwnOffsPresp",
6144 188u16 => "RxmgmtFlags",
6145 189u16 => "StaSupportedChannels",
6146 190u16 => "StaSupportedOperClasses",
6147 191u16 => "HandleDfs",
6148 192u16 => "Support5Mhz",
6149 193u16 => "Support10Mhz",
6150 194u16 => "OpmodeNotif",
6151 195u16 => "VendorId",
6152 196u16 => "VendorSubcmd",
6153 197u16 => "VendorData",
6154 198u16 => "VendorEvents",
6155 199u16 => "QosMap",
6156 200u16 => "MacHint",
6157 201u16 => "WiphyFreqHint",
6158 202u16 => "MaxApAssocSta",
6159 203u16 => "TdlsPeerCapability",
6160 204u16 => "SocketOwner",
6161 205u16 => "CsaCOffsetsTx",
6162 206u16 => "MaxCsaCounters",
6163 207u16 => "TdlsInitiator",
6164 208u16 => "UseRrm",
6165 209u16 => "WiphyDynAck",
6166 210u16 => "Tsid",
6167 211u16 => "UserPrio",
6168 212u16 => "AdmittedTime",
6169 213u16 => "SmpsMode",
6170 214u16 => "OperClass",
6171 215u16 => "MacMask",
6172 216u16 => "WiphySelfManagedReg",
6173 217u16 => "ExtFeatures",
6174 218u16 => "SurveyRadioStats",
6175 219u16 => "NetnsFd",
6176 220u16 => "SchedScanDelay",
6177 221u16 => "RegIndoor",
6178 222u16 => "MaxNumSchedScanPlans",
6179 223u16 => "MaxScanPlanInterval",
6180 224u16 => "MaxScanPlanIterations",
6181 225u16 => "SchedScanPlans",
6182 226u16 => "Pbss",
6183 227u16 => "BssSelect",
6184 228u16 => "StaSupportP2pPs",
6185 229u16 => "Pad",
6186 230u16 => "IftypeExtCapa",
6187 231u16 => "MuMimoGroupData",
6188 232u16 => "MuMimoFollowMacAddr",
6189 233u16 => "ScanStartTimeTsf",
6190 234u16 => "ScanStartTimeTsfBssid",
6191 235u16 => "MeasurementDuration",
6192 236u16 => "MeasurementDurationMandatory",
6193 237u16 => "MeshPeerAid",
6194 238u16 => "NanMasterPref",
6195 239u16 => "Bands",
6196 240u16 => "NanFunc",
6197 241u16 => "NanMatch",
6198 242u16 => "FilsKek",
6199 243u16 => "FilsNonces",
6200 244u16 => "MulticastToUnicastEnabled",
6201 245u16 => "Bssid",
6202 246u16 => "SchedScanRelativeRssi",
6203 247u16 => "SchedScanRssiAdjust",
6204 248u16 => "TimeoutReason",
6205 249u16 => "FilsErpUsername",
6206 250u16 => "FilsErpRealm",
6207 251u16 => "FilsErpNextSeqNum",
6208 252u16 => "FilsErpRrk",
6209 253u16 => "FilsCacheId",
6210 254u16 => "Pmk",
6211 255u16 => "SchedScanMulti",
6212 256u16 => "SchedScanMaxReqs",
6213 257u16 => "Want1x4wayHs",
6214 258u16 => "Pmkr0Name",
6215 259u16 => "PortAuthorized",
6216 260u16 => "ExternalAuthAction",
6217 261u16 => "ExternalAuthSupport",
6218 262u16 => "Nss",
6219 263u16 => "AckSignal",
6220 264u16 => "ControlPortOverNl80211",
6221 265u16 => "TxqStats",
6222 266u16 => "TxqLimit",
6223 267u16 => "TxqMemoryLimit",
6224 268u16 => "TxqQuantum",
6225 269u16 => "HeCapability",
6226 270u16 => "FtmResponder",
6227 271u16 => "FtmResponderStats",
6228 272u16 => "Timeout",
6229 273u16 => "PeerMeasurements",
6230 274u16 => "AirtimeWeight",
6231 275u16 => "StaTxPowerSetting",
6232 276u16 => "StaTxPower",
6233 277u16 => "SaePassword",
6234 278u16 => "TwtResponder",
6235 279u16 => "HeObssPd",
6236 280u16 => "WiphyEdmgChannels",
6237 281u16 => "WiphyEdmgBwConfig",
6238 282u16 => "VlanId",
6239 283u16 => "HeBssColor",
6240 284u16 => "IftypeAkmSuites",
6241 285u16 => "TidConfig",
6242 286u16 => "ControlPortNoPreauth",
6243 287u16 => "PmkLifetime",
6244 288u16 => "PmkReauthThreshold",
6245 289u16 => "ReceiveMulticast",
6246 290u16 => "WiphyFreqOffset",
6247 291u16 => "CenterFreq1Offset",
6248 292u16 => "ScanFreqKhz",
6249 293u16 => "He6ghzCapability",
6250 294u16 => "FilsDiscovery",
6251 295u16 => "UnsolBcastProbeResp",
6252 296u16 => "S1gCapability",
6253 297u16 => "S1gCapabilityMask",
6254 298u16 => "SaePwe",
6255 299u16 => "ReconnectRequested",
6256 300u16 => "SarSpec",
6257 301u16 => "DisableHe",
6258 302u16 => "ObssColorBitmap",
6259 303u16 => "ColorChangeCount",
6260 304u16 => "ColorChangeColor",
6261 305u16 => "ColorChangeElems",
6262 306u16 => "MbssidConfig",
6263 307u16 => "MbssidElems",
6264 308u16 => "RadarBackground",
6265 309u16 => "ApSettingsFlags",
6266 310u16 => "EhtCapability",
6267 311u16 => "DisableEht",
6268 312u16 => "MloLinks",
6269 313u16 => "MloLinkId",
6270 314u16 => "MldAddr",
6271 315u16 => "MloSupport",
6272 316u16 => "MaxNumAkmSuites",
6273 317u16 => "EmlCapability",
6274 318u16 => "MldCapaAndOps",
6275 319u16 => "TxHwTimestamp",
6276 320u16 => "RxHwTimestamp",
6277 321u16 => "TdBitmap",
6278 322u16 => "PunctBitmap",
6279 323u16 => "MaxHwTimestampPeers",
6280 324u16 => "HwTimestampEnabled",
6281 325u16 => "EmaRnrElems",
6282 326u16 => "MloLinkDisabled",
6283 327u16 => "BssDumpIncludeUseData",
6284 328u16 => "MloTtlmDlink",
6285 329u16 => "MloTtlmUlink",
6286 330u16 => "AssocSppAmsdu",
6287 331u16 => "WiphyRadios",
6288 332u16 => "WiphyInterfaceCombinations",
6289 333u16 => "VifRadioMask",
6290 _ => return None,
6291 };
6292 Some(res)
6293 }
6294}
6295#[derive(Clone, Copy, Default)]
6296pub struct IterableNl80211Attrs<'a> {
6297 buf: &'a [u8],
6298 pos: usize,
6299 orig_loc: usize,
6300}
6301impl<'a> IterableNl80211Attrs<'a> {
6302 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
6303 Self {
6304 buf,
6305 pos: 0,
6306 orig_loc,
6307 }
6308 }
6309 pub fn get_buf(&self) -> &'a [u8] {
6310 self.buf
6311 }
6312}
6313impl<'a> Iterator for IterableNl80211Attrs<'a> {
6314 type Item = Result<Nl80211Attrs<'a>, ErrorContext>;
6315 fn next(&mut self) -> Option<Self::Item> {
6316 let mut pos;
6317 let mut r#type;
6318 loop {
6319 pos = self.pos;
6320 r#type = None;
6321 if self.buf.len() == self.pos {
6322 return None;
6323 }
6324 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
6325 self.pos = self.buf.len();
6326 break;
6327 };
6328 r#type = Some(header.r#type);
6329 let res = match header.r#type {
6330 1u16 => Nl80211Attrs::Wiphy({
6331 let res = parse_u32(next);
6332 let Some(val) = res else { break };
6333 val
6334 }),
6335 2u16 => Nl80211Attrs::WiphyName({
6336 let res = CStr::from_bytes_with_nul(next).ok();
6337 let Some(val) = res else { break };
6338 val
6339 }),
6340 3u16 => Nl80211Attrs::Ifindex({
6341 let res = parse_u32(next);
6342 let Some(val) = res else { break };
6343 val
6344 }),
6345 4u16 => Nl80211Attrs::Ifname({
6346 let res = CStr::from_bytes_with_nul(next).ok();
6347 let Some(val) = res else { break };
6348 val
6349 }),
6350 5u16 => Nl80211Attrs::Iftype({
6351 let res = parse_u32(next);
6352 let Some(val) = res else { break };
6353 val
6354 }),
6355 6u16 => Nl80211Attrs::Mac({
6356 let res = Some(next);
6357 let Some(val) = res else { break };
6358 val
6359 }),
6360 7u16 => Nl80211Attrs::KeyData({
6361 let res = Some(next);
6362 let Some(val) = res else { break };
6363 val
6364 }),
6365 8u16 => Nl80211Attrs::KeyIdx({
6366 let res = parse_u8(next);
6367 let Some(val) = res else { break };
6368 val
6369 }),
6370 9u16 => Nl80211Attrs::KeyCipher({
6371 let res = parse_u32(next);
6372 let Some(val) = res else { break };
6373 val
6374 }),
6375 10u16 => Nl80211Attrs::KeySeq({
6376 let res = Some(next);
6377 let Some(val) = res else { break };
6378 val
6379 }),
6380 11u16 => Nl80211Attrs::KeyDefault(()),
6381 12u16 => Nl80211Attrs::BeaconInterval({
6382 let res = parse_u32(next);
6383 let Some(val) = res else { break };
6384 val
6385 }),
6386 13u16 => Nl80211Attrs::DtimPeriod({
6387 let res = parse_u32(next);
6388 let Some(val) = res else { break };
6389 val
6390 }),
6391 14u16 => Nl80211Attrs::BeaconHead({
6392 let res = Some(next);
6393 let Some(val) = res else { break };
6394 val
6395 }),
6396 15u16 => Nl80211Attrs::BeaconTail({
6397 let res = Some(next);
6398 let Some(val) = res else { break };
6399 val
6400 }),
6401 16u16 => Nl80211Attrs::StaAid({
6402 let res = parse_u16(next);
6403 let Some(val) = res else { break };
6404 val
6405 }),
6406 17u16 => Nl80211Attrs::StaFlags({
6407 let res = Some(next);
6408 let Some(val) = res else { break };
6409 val
6410 }),
6411 18u16 => Nl80211Attrs::StaListenInterval({
6412 let res = parse_u16(next);
6413 let Some(val) = res else { break };
6414 val
6415 }),
6416 19u16 => Nl80211Attrs::StaSupportedRates({
6417 let res = Some(next);
6418 let Some(val) = res else { break };
6419 val
6420 }),
6421 20u16 => Nl80211Attrs::StaVlan({
6422 let res = parse_u32(next);
6423 let Some(val) = res else { break };
6424 val
6425 }),
6426 21u16 => Nl80211Attrs::StaInfo({
6427 let res = Some(next);
6428 let Some(val) = res else { break };
6429 val
6430 }),
6431 22u16 => Nl80211Attrs::WiphyBands({
6432 let res = Some(IterableWiphyBands::with_loc(next, self.orig_loc));
6433 let Some(val) = res else { break };
6434 val
6435 }),
6436 23u16 => Nl80211Attrs::MntrFlags({
6437 let res = Some(next);
6438 let Some(val) = res else { break };
6439 val
6440 }),
6441 24u16 => Nl80211Attrs::MeshId({
6442 let res = Some(next);
6443 let Some(val) = res else { break };
6444 val
6445 }),
6446 25u16 => Nl80211Attrs::StaPlinkAction({
6447 let res = parse_u8(next);
6448 let Some(val) = res else { break };
6449 val
6450 }),
6451 26u16 => Nl80211Attrs::MpathNextHop({
6452 let res = Some(next);
6453 let Some(val) = res else { break };
6454 val
6455 }),
6456 27u16 => Nl80211Attrs::MpathInfo({
6457 let res = Some(next);
6458 let Some(val) = res else { break };
6459 val
6460 }),
6461 28u16 => Nl80211Attrs::BssCtsProt({
6462 let res = parse_u8(next);
6463 let Some(val) = res else { break };
6464 val
6465 }),
6466 29u16 => Nl80211Attrs::BssShortPreamble({
6467 let res = parse_u8(next);
6468 let Some(val) = res else { break };
6469 val
6470 }),
6471 30u16 => Nl80211Attrs::BssShortSlotTime({
6472 let res = parse_u8(next);
6473 let Some(val) = res else { break };
6474 val
6475 }),
6476 31u16 => Nl80211Attrs::HtCapability({
6477 let res = Some(next);
6478 let Some(val) = res else { break };
6479 val
6480 }),
6481 32u16 => Nl80211Attrs::SupportedIftypes({
6482 let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
6483 let Some(val) = res else { break };
6484 val
6485 }),
6486 33u16 => Nl80211Attrs::RegAlpha2({
6487 let res = Some(next);
6488 let Some(val) = res else { break };
6489 val
6490 }),
6491 34u16 => Nl80211Attrs::RegRules({
6492 let res = Some(next);
6493 let Some(val) = res else { break };
6494 val
6495 }),
6496 35u16 => Nl80211Attrs::MeshConfig({
6497 let res = Some(next);
6498 let Some(val) = res else { break };
6499 val
6500 }),
6501 36u16 => Nl80211Attrs::BssBasicRates({
6502 let res = Some(next);
6503 let Some(val) = res else { break };
6504 val
6505 }),
6506 37u16 => Nl80211Attrs::WiphyTxqParams({
6507 let res = Some(next);
6508 let Some(val) = res else { break };
6509 val
6510 }),
6511 38u16 => Nl80211Attrs::WiphyFreq({
6512 let res = parse_u32(next);
6513 let Some(val) = res else { break };
6514 val
6515 }),
6516 39u16 => Nl80211Attrs::WiphyChannelType({
6517 let res = parse_u32(next);
6518 let Some(val) = res else { break };
6519 val
6520 }),
6521 40u16 => Nl80211Attrs::KeyDefaultMgmt(()),
6522 41u16 => Nl80211Attrs::MgmtSubtype({
6523 let res = parse_u8(next);
6524 let Some(val) = res else { break };
6525 val
6526 }),
6527 42u16 => Nl80211Attrs::Ie({
6528 let res = Some(next);
6529 let Some(val) = res else { break };
6530 val
6531 }),
6532 43u16 => Nl80211Attrs::MaxNumScanSsids({
6533 let res = parse_u8(next);
6534 let Some(val) = res else { break };
6535 val
6536 }),
6537 44u16 => Nl80211Attrs::ScanFrequencies({
6538 let res = Some(next);
6539 let Some(val) = res else { break };
6540 val
6541 }),
6542 45u16 => Nl80211Attrs::ScanSsids({
6543 let res = Some(next);
6544 let Some(val) = res else { break };
6545 val
6546 }),
6547 46u16 => Nl80211Attrs::Generation({
6548 let res = parse_u32(next);
6549 let Some(val) = res else { break };
6550 val
6551 }),
6552 47u16 => Nl80211Attrs::Bss({
6553 let res = Some(next);
6554 let Some(val) = res else { break };
6555 val
6556 }),
6557 48u16 => Nl80211Attrs::RegInitiator({
6558 let res = parse_u8(next);
6559 let Some(val) = res else { break };
6560 val
6561 }),
6562 49u16 => Nl80211Attrs::RegType({
6563 let res = parse_u8(next);
6564 let Some(val) = res else { break };
6565 val
6566 }),
6567 50u16 => Nl80211Attrs::SupportedCommands({
6568 let res = Some(IterableArrayU32::with_loc(next, self.orig_loc));
6569 let Some(val) = res else { break };
6570 val
6571 }),
6572 51u16 => Nl80211Attrs::Frame({
6573 let res = Some(next);
6574 let Some(val) = res else { break };
6575 val
6576 }),
6577 52u16 => Nl80211Attrs::Ssid({
6578 let res = Some(next);
6579 let Some(val) = res else { break };
6580 val
6581 }),
6582 53u16 => Nl80211Attrs::AuthType({
6583 let res = parse_u32(next);
6584 let Some(val) = res else { break };
6585 val
6586 }),
6587 54u16 => Nl80211Attrs::ReasonCode({
6588 let res = parse_u16(next);
6589 let Some(val) = res else { break };
6590 val
6591 }),
6592 55u16 => Nl80211Attrs::KeyType({
6593 let res = parse_u32(next);
6594 let Some(val) = res else { break };
6595 val
6596 }),
6597 56u16 => Nl80211Attrs::MaxScanIeLen({
6598 let res = parse_u16(next);
6599 let Some(val) = res else { break };
6600 val
6601 }),
6602 57u16 => Nl80211Attrs::CipherSuites({
6603 let res = Some(next);
6604 let Some(val) = res else { break };
6605 val
6606 }),
6607 58u16 => Nl80211Attrs::FreqBefore({
6608 let res = Some(next);
6609 let Some(val) = res else { break };
6610 val
6611 }),
6612 59u16 => Nl80211Attrs::FreqAfter({
6613 let res = Some(next);
6614 let Some(val) = res else { break };
6615 val
6616 }),
6617 60u16 => Nl80211Attrs::FreqFixed(()),
6618 61u16 => Nl80211Attrs::WiphyRetryShort({
6619 let res = parse_u8(next);
6620 let Some(val) = res else { break };
6621 val
6622 }),
6623 62u16 => Nl80211Attrs::WiphyRetryLong({
6624 let res = parse_u8(next);
6625 let Some(val) = res else { break };
6626 val
6627 }),
6628 63u16 => Nl80211Attrs::WiphyFragThreshold({
6629 let res = parse_u32(next);
6630 let Some(val) = res else { break };
6631 val
6632 }),
6633 64u16 => Nl80211Attrs::WiphyRtsThreshold({
6634 let res = parse_u32(next);
6635 let Some(val) = res else { break };
6636 val
6637 }),
6638 65u16 => Nl80211Attrs::TimedOut(()),
6639 66u16 => Nl80211Attrs::UseMfp({
6640 let res = parse_u32(next);
6641 let Some(val) = res else { break };
6642 val
6643 }),
6644 67u16 => Nl80211Attrs::StaFlags2({
6645 let res = Some(StaFlagUpdate::new_from_zeroed(next));
6646 let Some(val) = res else { break };
6647 val
6648 }),
6649 68u16 => Nl80211Attrs::ControlPort(()),
6650 69u16 => Nl80211Attrs::Testdata({
6651 let res = Some(next);
6652 let Some(val) = res else { break };
6653 val
6654 }),
6655 70u16 => Nl80211Attrs::Privacy(()),
6656 71u16 => Nl80211Attrs::DisconnectedByAp(()),
6657 72u16 => Nl80211Attrs::StatusCode({
6658 let res = parse_u16(next);
6659 let Some(val) = res else { break };
6660 val
6661 }),
6662 73u16 => Nl80211Attrs::CipherSuitesPairwise({
6663 let res = Some(next);
6664 let Some(val) = res else { break };
6665 val
6666 }),
6667 74u16 => Nl80211Attrs::CipherSuiteGroup({
6668 let res = parse_u32(next);
6669 let Some(val) = res else { break };
6670 val
6671 }),
6672 75u16 => Nl80211Attrs::WpaVersions({
6673 let res = parse_u32(next);
6674 let Some(val) = res else { break };
6675 val
6676 }),
6677 76u16 => Nl80211Attrs::AkmSuites({
6678 let res = Some(next);
6679 let Some(val) = res else { break };
6680 val
6681 }),
6682 77u16 => Nl80211Attrs::ReqIe({
6683 let res = Some(next);
6684 let Some(val) = res else { break };
6685 val
6686 }),
6687 78u16 => Nl80211Attrs::RespIe({
6688 let res = Some(next);
6689 let Some(val) = res else { break };
6690 val
6691 }),
6692 79u16 => Nl80211Attrs::PrevBssid({
6693 let res = Some(next);
6694 let Some(val) = res else { break };
6695 val
6696 }),
6697 80u16 => Nl80211Attrs::Key({
6698 let res = Some(next);
6699 let Some(val) = res else { break };
6700 val
6701 }),
6702 81u16 => Nl80211Attrs::Keys({
6703 let res = Some(next);
6704 let Some(val) = res else { break };
6705 val
6706 }),
6707 82u16 => Nl80211Attrs::Pid({
6708 let res = parse_u32(next);
6709 let Some(val) = res else { break };
6710 val
6711 }),
6712 83u16 => Nl80211Attrs::_4addr({
6713 let res = parse_u8(next);
6714 let Some(val) = res else { break };
6715 val
6716 }),
6717 84u16 => Nl80211Attrs::SurveyInfo({
6718 let res = Some(next);
6719 let Some(val) = res else { break };
6720 val
6721 }),
6722 85u16 => Nl80211Attrs::Pmkid({
6723 let res = Some(next);
6724 let Some(val) = res else { break };
6725 val
6726 }),
6727 86u16 => Nl80211Attrs::MaxNumPmkids({
6728 let res = parse_u8(next);
6729 let Some(val) = res else { break };
6730 val
6731 }),
6732 87u16 => Nl80211Attrs::Duration({
6733 let res = parse_u32(next);
6734 let Some(val) = res else { break };
6735 val
6736 }),
6737 88u16 => Nl80211Attrs::Cookie({
6738 let res = parse_u64(next);
6739 let Some(val) = res else { break };
6740 val
6741 }),
6742 89u16 => Nl80211Attrs::WiphyCoverageClass({
6743 let res = parse_u8(next);
6744 let Some(val) = res else { break };
6745 val
6746 }),
6747 90u16 => Nl80211Attrs::TxRates({
6748 let res = Some(next);
6749 let Some(val) = res else { break };
6750 val
6751 }),
6752 91u16 => Nl80211Attrs::FrameMatch({
6753 let res = Some(next);
6754 let Some(val) = res else { break };
6755 val
6756 }),
6757 92u16 => Nl80211Attrs::Ack(()),
6758 93u16 => Nl80211Attrs::PsState({
6759 let res = parse_u32(next);
6760 let Some(val) = res else { break };
6761 val
6762 }),
6763 94u16 => Nl80211Attrs::Cqm({
6764 let res = Some(next);
6765 let Some(val) = res else { break };
6766 val
6767 }),
6768 95u16 => Nl80211Attrs::LocalStateChange(()),
6769 96u16 => Nl80211Attrs::ApIsolate({
6770 let res = parse_u8(next);
6771 let Some(val) = res else { break };
6772 val
6773 }),
6774 97u16 => Nl80211Attrs::WiphyTxPowerSetting({
6775 let res = parse_u32(next);
6776 let Some(val) = res else { break };
6777 val
6778 }),
6779 98u16 => Nl80211Attrs::WiphyTxPowerLevel({
6780 let res = parse_u32(next);
6781 let Some(val) = res else { break };
6782 val
6783 }),
6784 99u16 => Nl80211Attrs::TxFrameTypes({
6785 let res = Some(IterableIftypeAttrs::with_loc(next, self.orig_loc));
6786 let Some(val) = res else { break };
6787 val
6788 }),
6789 100u16 => Nl80211Attrs::RxFrameTypes({
6790 let res = Some(IterableIftypeAttrs::with_loc(next, self.orig_loc));
6791 let Some(val) = res else { break };
6792 val
6793 }),
6794 101u16 => Nl80211Attrs::FrameType({
6795 let res = parse_u16(next);
6796 let Some(val) = res else { break };
6797 val
6798 }),
6799 102u16 => Nl80211Attrs::ControlPortEthertype(()),
6800 103u16 => Nl80211Attrs::ControlPortNoEncrypt(()),
6801 104u16 => Nl80211Attrs::SupportIbssRsn(()),
6802 105u16 => Nl80211Attrs::WiphyAntennaTx({
6803 let res = parse_u32(next);
6804 let Some(val) = res else { break };
6805 val
6806 }),
6807 106u16 => Nl80211Attrs::WiphyAntennaRx({
6808 let res = parse_u32(next);
6809 let Some(val) = res else { break };
6810 val
6811 }),
6812 107u16 => Nl80211Attrs::McastRate({
6813 let res = parse_u32(next);
6814 let Some(val) = res else { break };
6815 val
6816 }),
6817 108u16 => Nl80211Attrs::OffchannelTxOk(()),
6818 109u16 => Nl80211Attrs::BssHtOpmode({
6819 let res = parse_u16(next);
6820 let Some(val) = res else { break };
6821 val
6822 }),
6823 110u16 => Nl80211Attrs::KeyDefaultTypes({
6824 let res = Some(next);
6825 let Some(val) = res else { break };
6826 val
6827 }),
6828 111u16 => Nl80211Attrs::MaxRemainOnChannelDuration({
6829 let res = parse_u32(next);
6830 let Some(val) = res else { break };
6831 val
6832 }),
6833 112u16 => Nl80211Attrs::MeshSetup({
6834 let res = Some(next);
6835 let Some(val) = res else { break };
6836 val
6837 }),
6838 113u16 => Nl80211Attrs::WiphyAntennaAvailTx({
6839 let res = parse_u32(next);
6840 let Some(val) = res else { break };
6841 val
6842 }),
6843 114u16 => Nl80211Attrs::WiphyAntennaAvailRx({
6844 let res = parse_u32(next);
6845 let Some(val) = res else { break };
6846 val
6847 }),
6848 115u16 => Nl80211Attrs::SupportMeshAuth(()),
6849 116u16 => Nl80211Attrs::StaPlinkState({
6850 let res = parse_u8(next);
6851 let Some(val) = res else { break };
6852 val
6853 }),
6854 117u16 => Nl80211Attrs::WowlanTriggers({
6855 let res = Some(next);
6856 let Some(val) = res else { break };
6857 val
6858 }),
6859 118u16 => Nl80211Attrs::WowlanTriggersSupported({
6860 let res = Some(IterableWowlanTriggersAttrs::with_loc(next, self.orig_loc));
6861 let Some(val) = res else { break };
6862 val
6863 }),
6864 119u16 => Nl80211Attrs::SchedScanInterval({
6865 let res = parse_u32(next);
6866 let Some(val) = res else { break };
6867 val
6868 }),
6869 120u16 => Nl80211Attrs::InterfaceCombinations({
6870 let res = Some(IterableArrayIfCombinationAttributes::with_loc(
6871 next,
6872 self.orig_loc,
6873 ));
6874 let Some(val) = res else { break };
6875 val
6876 }),
6877 121u16 => Nl80211Attrs::SoftwareIftypes({
6878 let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
6879 let Some(val) = res else { break };
6880 val
6881 }),
6882 122u16 => Nl80211Attrs::RekeyData({
6883 let res = Some(next);
6884 let Some(val) = res else { break };
6885 val
6886 }),
6887 123u16 => Nl80211Attrs::MaxNumSchedScanSsids({
6888 let res = parse_u8(next);
6889 let Some(val) = res else { break };
6890 val
6891 }),
6892 124u16 => Nl80211Attrs::MaxSchedScanIeLen({
6893 let res = parse_u16(next);
6894 let Some(val) = res else { break };
6895 val
6896 }),
6897 125u16 => Nl80211Attrs::ScanSuppRates({
6898 let res = Some(next);
6899 let Some(val) = res else { break };
6900 val
6901 }),
6902 126u16 => Nl80211Attrs::HiddenSsid({
6903 let res = parse_u32(next);
6904 let Some(val) = res else { break };
6905 val
6906 }),
6907 127u16 => Nl80211Attrs::IeProbeResp({
6908 let res = Some(next);
6909 let Some(val) = res else { break };
6910 val
6911 }),
6912 128u16 => Nl80211Attrs::IeAssocResp({
6913 let res = Some(next);
6914 let Some(val) = res else { break };
6915 val
6916 }),
6917 129u16 => Nl80211Attrs::StaWme({
6918 let res = Some(next);
6919 let Some(val) = res else { break };
6920 val
6921 }),
6922 130u16 => Nl80211Attrs::SupportApUapsd(()),
6923 131u16 => Nl80211Attrs::RoamSupport(()),
6924 132u16 => Nl80211Attrs::SchedScanMatch({
6925 let res = Some(next);
6926 let Some(val) = res else { break };
6927 val
6928 }),
6929 133u16 => Nl80211Attrs::MaxMatchSets({
6930 let res = parse_u8(next);
6931 let Some(val) = res else { break };
6932 val
6933 }),
6934 134u16 => Nl80211Attrs::PmksaCandidate({
6935 let res = Some(next);
6936 let Some(val) = res else { break };
6937 val
6938 }),
6939 135u16 => Nl80211Attrs::TxNoCckRate(()),
6940 136u16 => Nl80211Attrs::TdlsAction({
6941 let res = parse_u8(next);
6942 let Some(val) = res else { break };
6943 val
6944 }),
6945 137u16 => Nl80211Attrs::TdlsDialogToken({
6946 let res = parse_u8(next);
6947 let Some(val) = res else { break };
6948 val
6949 }),
6950 138u16 => Nl80211Attrs::TdlsOperation({
6951 let res = parse_u8(next);
6952 let Some(val) = res else { break };
6953 val
6954 }),
6955 139u16 => Nl80211Attrs::TdlsSupport(()),
6956 140u16 => Nl80211Attrs::TdlsExternalSetup(()),
6957 141u16 => Nl80211Attrs::DeviceApSme({
6958 let res = parse_u32(next);
6959 let Some(val) = res else { break };
6960 val
6961 }),
6962 142u16 => Nl80211Attrs::DontWaitForAck(()),
6963 143u16 => Nl80211Attrs::FeatureFlags({
6964 let res = parse_u32(next);
6965 let Some(val) = res else { break };
6966 val
6967 }),
6968 144u16 => Nl80211Attrs::ProbeRespOffload({
6969 let res = parse_u32(next);
6970 let Some(val) = res else { break };
6971 val
6972 }),
6973 145u16 => Nl80211Attrs::ProbeResp({
6974 let res = Some(next);
6975 let Some(val) = res else { break };
6976 val
6977 }),
6978 146u16 => Nl80211Attrs::DfsRegion({
6979 let res = parse_u8(next);
6980 let Some(val) = res else { break };
6981 val
6982 }),
6983 147u16 => Nl80211Attrs::DisableHt(()),
6984 148u16 => Nl80211Attrs::HtCapabilityMask({
6985 let res = Some(next);
6986 let Some(val) = res else { break };
6987 val
6988 }),
6989 149u16 => Nl80211Attrs::NoackMap({
6990 let res = parse_u16(next);
6991 let Some(val) = res else { break };
6992 val
6993 }),
6994 150u16 => Nl80211Attrs::InactivityTimeout({
6995 let res = parse_u16(next);
6996 let Some(val) = res else { break };
6997 val
6998 }),
6999 151u16 => Nl80211Attrs::RxSignalDbm({
7000 let res = parse_u32(next);
7001 let Some(val) = res else { break };
7002 val
7003 }),
7004 152u16 => Nl80211Attrs::BgScanPeriod({
7005 let res = parse_u16(next);
7006 let Some(val) = res else { break };
7007 val
7008 }),
7009 153u16 => Nl80211Attrs::Wdev({
7010 let res = parse_u64(next);
7011 let Some(val) = res else { break };
7012 val
7013 }),
7014 154u16 => Nl80211Attrs::UserRegHintType({
7015 let res = parse_u32(next);
7016 let Some(val) = res else { break };
7017 val
7018 }),
7019 155u16 => Nl80211Attrs::ConnFailedReason({
7020 let res = parse_u32(next);
7021 let Some(val) = res else { break };
7022 val
7023 }),
7024 156u16 => Nl80211Attrs::AuthData({
7025 let res = Some(next);
7026 let Some(val) = res else { break };
7027 val
7028 }),
7029 157u16 => Nl80211Attrs::VhtCapability({
7030 let res = Some(next);
7031 let Some(val) = res else { break };
7032 val
7033 }),
7034 158u16 => Nl80211Attrs::ScanFlags({
7035 let res = parse_u32(next);
7036 let Some(val) = res else { break };
7037 val
7038 }),
7039 159u16 => Nl80211Attrs::ChannelWidth({
7040 let res = parse_u32(next);
7041 let Some(val) = res else { break };
7042 val
7043 }),
7044 160u16 => Nl80211Attrs::CenterFreq1({
7045 let res = parse_u32(next);
7046 let Some(val) = res else { break };
7047 val
7048 }),
7049 161u16 => Nl80211Attrs::CenterFreq2({
7050 let res = parse_u32(next);
7051 let Some(val) = res else { break };
7052 val
7053 }),
7054 162u16 => Nl80211Attrs::P2pCtwindow({
7055 let res = parse_u8(next);
7056 let Some(val) = res else { break };
7057 val
7058 }),
7059 163u16 => Nl80211Attrs::P2pOppps({
7060 let res = parse_u8(next);
7061 let Some(val) = res else { break };
7062 val
7063 }),
7064 164u16 => Nl80211Attrs::LocalMeshPowerMode({
7065 let res = parse_u32(next);
7066 let Some(val) = res else { break };
7067 val
7068 }),
7069 165u16 => Nl80211Attrs::AclPolicy({
7070 let res = parse_u32(next);
7071 let Some(val) = res else { break };
7072 val
7073 }),
7074 166u16 => Nl80211Attrs::MacAddrs({
7075 let res = Some(next);
7076 let Some(val) = res else { break };
7077 val
7078 }),
7079 167u16 => Nl80211Attrs::MacAclMax({
7080 let res = parse_u32(next);
7081 let Some(val) = res else { break };
7082 val
7083 }),
7084 168u16 => Nl80211Attrs::RadarEvent({
7085 let res = parse_u32(next);
7086 let Some(val) = res else { break };
7087 val
7088 }),
7089 169u16 => Nl80211Attrs::ExtCapa({
7090 let res = Some(next);
7091 let Some(val) = res else { break };
7092 val
7093 }),
7094 170u16 => Nl80211Attrs::ExtCapaMask({
7095 let res = Some(next);
7096 let Some(val) = res else { break };
7097 val
7098 }),
7099 171u16 => Nl80211Attrs::StaCapability({
7100 let res = parse_u16(next);
7101 let Some(val) = res else { break };
7102 val
7103 }),
7104 172u16 => Nl80211Attrs::StaExtCapability({
7105 let res = Some(next);
7106 let Some(val) = res else { break };
7107 val
7108 }),
7109 173u16 => Nl80211Attrs::ProtocolFeatures({
7110 let res = parse_u32(next);
7111 let Some(val) = res else { break };
7112 val
7113 }),
7114 174u16 => Nl80211Attrs::SplitWiphyDump(()),
7115 175u16 => Nl80211Attrs::DisableVht(()),
7116 176u16 => Nl80211Attrs::VhtCapabilityMask({
7117 let res = Some(next);
7118 let Some(val) = res else { break };
7119 val
7120 }),
7121 177u16 => Nl80211Attrs::Mdid({
7122 let res = parse_u16(next);
7123 let Some(val) = res else { break };
7124 val
7125 }),
7126 178u16 => Nl80211Attrs::IeRic({
7127 let res = Some(next);
7128 let Some(val) = res else { break };
7129 val
7130 }),
7131 179u16 => Nl80211Attrs::CritProtId({
7132 let res = parse_u16(next);
7133 let Some(val) = res else { break };
7134 val
7135 }),
7136 180u16 => Nl80211Attrs::MaxCritProtDuration({
7137 let res = parse_u16(next);
7138 let Some(val) = res else { break };
7139 val
7140 }),
7141 181u16 => Nl80211Attrs::PeerAid({
7142 let res = parse_u16(next);
7143 let Some(val) = res else { break };
7144 val
7145 }),
7146 182u16 => Nl80211Attrs::CoalesceRule({
7147 let res = Some(next);
7148 let Some(val) = res else { break };
7149 val
7150 }),
7151 183u16 => Nl80211Attrs::ChSwitchCount({
7152 let res = parse_u32(next);
7153 let Some(val) = res else { break };
7154 val
7155 }),
7156 184u16 => Nl80211Attrs::ChSwitchBlockTx(()),
7157 185u16 => Nl80211Attrs::CsaIes({
7158 let res = Some(next);
7159 let Some(val) = res else { break };
7160 val
7161 }),
7162 186u16 => Nl80211Attrs::CntdwnOffsBeacon({
7163 let res = Some(next);
7164 let Some(val) = res else { break };
7165 val
7166 }),
7167 187u16 => Nl80211Attrs::CntdwnOffsPresp({
7168 let res = Some(next);
7169 let Some(val) = res else { break };
7170 val
7171 }),
7172 188u16 => Nl80211Attrs::RxmgmtFlags({
7173 let res = Some(next);
7174 let Some(val) = res else { break };
7175 val
7176 }),
7177 189u16 => Nl80211Attrs::StaSupportedChannels({
7178 let res = Some(next);
7179 let Some(val) = res else { break };
7180 val
7181 }),
7182 190u16 => Nl80211Attrs::StaSupportedOperClasses({
7183 let res = Some(next);
7184 let Some(val) = res else { break };
7185 val
7186 }),
7187 191u16 => Nl80211Attrs::HandleDfs(()),
7188 192u16 => Nl80211Attrs::Support5Mhz(()),
7189 193u16 => Nl80211Attrs::Support10Mhz(()),
7190 194u16 => Nl80211Attrs::OpmodeNotif({
7191 let res = parse_u8(next);
7192 let Some(val) = res else { break };
7193 val
7194 }),
7195 195u16 => Nl80211Attrs::VendorId({
7196 let res = parse_u32(next);
7197 let Some(val) = res else { break };
7198 val
7199 }),
7200 196u16 => Nl80211Attrs::VendorSubcmd({
7201 let res = parse_u32(next);
7202 let Some(val) = res else { break };
7203 val
7204 }),
7205 197u16 => Nl80211Attrs::VendorData({
7206 let res = Some(next);
7207 let Some(val) = res else { break };
7208 val
7209 }),
7210 198u16 => Nl80211Attrs::VendorEvents({
7211 let res = Some(next);
7212 let Some(val) = res else { break };
7213 val
7214 }),
7215 199u16 => Nl80211Attrs::QosMap({
7216 let res = Some(next);
7217 let Some(val) = res else { break };
7218 val
7219 }),
7220 200u16 => Nl80211Attrs::MacHint({
7221 let res = Some(next);
7222 let Some(val) = res else { break };
7223 val
7224 }),
7225 201u16 => Nl80211Attrs::WiphyFreqHint({
7226 let res = parse_u32(next);
7227 let Some(val) = res else { break };
7228 val
7229 }),
7230 202u16 => Nl80211Attrs::MaxApAssocSta({
7231 let res = parse_u32(next);
7232 let Some(val) = res else { break };
7233 val
7234 }),
7235 203u16 => Nl80211Attrs::TdlsPeerCapability({
7236 let res = parse_u32(next);
7237 let Some(val) = res else { break };
7238 val
7239 }),
7240 204u16 => Nl80211Attrs::SocketOwner(()),
7241 205u16 => Nl80211Attrs::CsaCOffsetsTx({
7242 let res = Some(next);
7243 let Some(val) = res else { break };
7244 val
7245 }),
7246 206u16 => Nl80211Attrs::MaxCsaCounters({
7247 let res = parse_u8(next);
7248 let Some(val) = res else { break };
7249 val
7250 }),
7251 207u16 => Nl80211Attrs::TdlsInitiator(()),
7252 208u16 => Nl80211Attrs::UseRrm(()),
7253 209u16 => Nl80211Attrs::WiphyDynAck(()),
7254 210u16 => Nl80211Attrs::Tsid({
7255 let res = parse_u8(next);
7256 let Some(val) = res else { break };
7257 val
7258 }),
7259 211u16 => Nl80211Attrs::UserPrio({
7260 let res = parse_u8(next);
7261 let Some(val) = res else { break };
7262 val
7263 }),
7264 212u16 => Nl80211Attrs::AdmittedTime({
7265 let res = parse_u16(next);
7266 let Some(val) = res else { break };
7267 val
7268 }),
7269 213u16 => Nl80211Attrs::SmpsMode({
7270 let res = parse_u8(next);
7271 let Some(val) = res else { break };
7272 val
7273 }),
7274 214u16 => Nl80211Attrs::OperClass({
7275 let res = parse_u8(next);
7276 let Some(val) = res else { break };
7277 val
7278 }),
7279 215u16 => Nl80211Attrs::MacMask({
7280 let res = Some(next);
7281 let Some(val) = res else { break };
7282 val
7283 }),
7284 216u16 => Nl80211Attrs::WiphySelfManagedReg(()),
7285 217u16 => Nl80211Attrs::ExtFeatures({
7286 let res = Some(next);
7287 let Some(val) = res else { break };
7288 val
7289 }),
7290 218u16 => Nl80211Attrs::SurveyRadioStats({
7291 let res = Some(next);
7292 let Some(val) = res else { break };
7293 val
7294 }),
7295 219u16 => Nl80211Attrs::NetnsFd({
7296 let res = parse_u32(next);
7297 let Some(val) = res else { break };
7298 val
7299 }),
7300 220u16 => Nl80211Attrs::SchedScanDelay({
7301 let res = parse_u32(next);
7302 let Some(val) = res else { break };
7303 val
7304 }),
7305 221u16 => Nl80211Attrs::RegIndoor(()),
7306 222u16 => Nl80211Attrs::MaxNumSchedScanPlans({
7307 let res = parse_u32(next);
7308 let Some(val) = res else { break };
7309 val
7310 }),
7311 223u16 => Nl80211Attrs::MaxScanPlanInterval({
7312 let res = parse_u32(next);
7313 let Some(val) = res else { break };
7314 val
7315 }),
7316 224u16 => Nl80211Attrs::MaxScanPlanIterations({
7317 let res = parse_u32(next);
7318 let Some(val) = res else { break };
7319 val
7320 }),
7321 225u16 => Nl80211Attrs::SchedScanPlans({
7322 let res = Some(next);
7323 let Some(val) = res else { break };
7324 val
7325 }),
7326 226u16 => Nl80211Attrs::Pbss(()),
7327 227u16 => Nl80211Attrs::BssSelect({
7328 let res = Some(next);
7329 let Some(val) = res else { break };
7330 val
7331 }),
7332 228u16 => Nl80211Attrs::StaSupportP2pPs({
7333 let res = parse_u8(next);
7334 let Some(val) = res else { break };
7335 val
7336 }),
7337 229u16 => Nl80211Attrs::Pad({
7338 let res = Some(next);
7339 let Some(val) = res else { break };
7340 val
7341 }),
7342 230u16 => Nl80211Attrs::IftypeExtCapa({
7343 let res = Some(next);
7344 let Some(val) = res else { break };
7345 val
7346 }),
7347 231u16 => Nl80211Attrs::MuMimoGroupData({
7348 let res = Some(next);
7349 let Some(val) = res else { break };
7350 val
7351 }),
7352 232u16 => Nl80211Attrs::MuMimoFollowMacAddr({
7353 let res = Some(next);
7354 let Some(val) = res else { break };
7355 val
7356 }),
7357 233u16 => Nl80211Attrs::ScanStartTimeTsf({
7358 let res = parse_u64(next);
7359 let Some(val) = res else { break };
7360 val
7361 }),
7362 234u16 => Nl80211Attrs::ScanStartTimeTsfBssid({
7363 let res = Some(next);
7364 let Some(val) = res else { break };
7365 val
7366 }),
7367 235u16 => Nl80211Attrs::MeasurementDuration({
7368 let res = parse_u16(next);
7369 let Some(val) = res else { break };
7370 val
7371 }),
7372 236u16 => Nl80211Attrs::MeasurementDurationMandatory(()),
7373 237u16 => Nl80211Attrs::MeshPeerAid({
7374 let res = parse_u16(next);
7375 let Some(val) = res else { break };
7376 val
7377 }),
7378 238u16 => Nl80211Attrs::NanMasterPref({
7379 let res = parse_u8(next);
7380 let Some(val) = res else { break };
7381 val
7382 }),
7383 239u16 => Nl80211Attrs::Bands({
7384 let res = parse_u32(next);
7385 let Some(val) = res else { break };
7386 val
7387 }),
7388 240u16 => Nl80211Attrs::NanFunc({
7389 let res = Some(next);
7390 let Some(val) = res else { break };
7391 val
7392 }),
7393 241u16 => Nl80211Attrs::NanMatch({
7394 let res = Some(next);
7395 let Some(val) = res else { break };
7396 val
7397 }),
7398 242u16 => Nl80211Attrs::FilsKek({
7399 let res = Some(next);
7400 let Some(val) = res else { break };
7401 val
7402 }),
7403 243u16 => Nl80211Attrs::FilsNonces({
7404 let res = Some(next);
7405 let Some(val) = res else { break };
7406 val
7407 }),
7408 244u16 => Nl80211Attrs::MulticastToUnicastEnabled(()),
7409 245u16 => Nl80211Attrs::Bssid({
7410 let res = Some(next);
7411 let Some(val) = res else { break };
7412 val
7413 }),
7414 246u16 => Nl80211Attrs::SchedScanRelativeRssi({
7415 let res = parse_i8(next);
7416 let Some(val) = res else { break };
7417 val
7418 }),
7419 247u16 => Nl80211Attrs::SchedScanRssiAdjust({
7420 let res = Some(next);
7421 let Some(val) = res else { break };
7422 val
7423 }),
7424 248u16 => Nl80211Attrs::TimeoutReason({
7425 let res = parse_u32(next);
7426 let Some(val) = res else { break };
7427 val
7428 }),
7429 249u16 => Nl80211Attrs::FilsErpUsername({
7430 let res = Some(next);
7431 let Some(val) = res else { break };
7432 val
7433 }),
7434 250u16 => Nl80211Attrs::FilsErpRealm({
7435 let res = Some(next);
7436 let Some(val) = res else { break };
7437 val
7438 }),
7439 251u16 => Nl80211Attrs::FilsErpNextSeqNum({
7440 let res = parse_u16(next);
7441 let Some(val) = res else { break };
7442 val
7443 }),
7444 252u16 => Nl80211Attrs::FilsErpRrk({
7445 let res = Some(next);
7446 let Some(val) = res else { break };
7447 val
7448 }),
7449 253u16 => Nl80211Attrs::FilsCacheId({
7450 let res = Some(next);
7451 let Some(val) = res else { break };
7452 val
7453 }),
7454 254u16 => Nl80211Attrs::Pmk({
7455 let res = Some(next);
7456 let Some(val) = res else { break };
7457 val
7458 }),
7459 255u16 => Nl80211Attrs::SchedScanMulti(()),
7460 256u16 => Nl80211Attrs::SchedScanMaxReqs({
7461 let res = parse_u32(next);
7462 let Some(val) = res else { break };
7463 val
7464 }),
7465 257u16 => Nl80211Attrs::Want1x4wayHs(()),
7466 258u16 => Nl80211Attrs::Pmkr0Name({
7467 let res = Some(next);
7468 let Some(val) = res else { break };
7469 val
7470 }),
7471 259u16 => Nl80211Attrs::PortAuthorized({
7472 let res = Some(next);
7473 let Some(val) = res else { break };
7474 val
7475 }),
7476 260u16 => Nl80211Attrs::ExternalAuthAction({
7477 let res = parse_u32(next);
7478 let Some(val) = res else { break };
7479 val
7480 }),
7481 261u16 => Nl80211Attrs::ExternalAuthSupport(()),
7482 262u16 => Nl80211Attrs::Nss({
7483 let res = parse_u8(next);
7484 let Some(val) = res else { break };
7485 val
7486 }),
7487 263u16 => Nl80211Attrs::AckSignal({
7488 let res = parse_i32(next);
7489 let Some(val) = res else { break };
7490 val
7491 }),
7492 264u16 => Nl80211Attrs::ControlPortOverNl80211(()),
7493 265u16 => Nl80211Attrs::TxqStats({
7494 let res = Some(IterableTxqStatsAttrs::with_loc(next, self.orig_loc));
7495 let Some(val) = res else { break };
7496 val
7497 }),
7498 266u16 => Nl80211Attrs::TxqLimit({
7499 let res = parse_u32(next);
7500 let Some(val) = res else { break };
7501 val
7502 }),
7503 267u16 => Nl80211Attrs::TxqMemoryLimit({
7504 let res = parse_u32(next);
7505 let Some(val) = res else { break };
7506 val
7507 }),
7508 268u16 => Nl80211Attrs::TxqQuantum({
7509 let res = parse_u32(next);
7510 let Some(val) = res else { break };
7511 val
7512 }),
7513 269u16 => Nl80211Attrs::HeCapability({
7514 let res = Some(next);
7515 let Some(val) = res else { break };
7516 val
7517 }),
7518 270u16 => Nl80211Attrs::FtmResponder({
7519 let res = Some(next);
7520 let Some(val) = res else { break };
7521 val
7522 }),
7523 271u16 => Nl80211Attrs::FtmResponderStats({
7524 let res = Some(next);
7525 let Some(val) = res else { break };
7526 val
7527 }),
7528 272u16 => Nl80211Attrs::Timeout({
7529 let res = parse_u32(next);
7530 let Some(val) = res else { break };
7531 val
7532 }),
7533 273u16 => Nl80211Attrs::PeerMeasurements({
7534 let res = Some(next);
7535 let Some(val) = res else { break };
7536 val
7537 }),
7538 274u16 => Nl80211Attrs::AirtimeWeight({
7539 let res = parse_u16(next);
7540 let Some(val) = res else { break };
7541 val
7542 }),
7543 275u16 => Nl80211Attrs::StaTxPowerSetting({
7544 let res = parse_u8(next);
7545 let Some(val) = res else { break };
7546 val
7547 }),
7548 276u16 => Nl80211Attrs::StaTxPower({
7549 let res = parse_i16(next);
7550 let Some(val) = res else { break };
7551 val
7552 }),
7553 277u16 => Nl80211Attrs::SaePassword({
7554 let res = Some(next);
7555 let Some(val) = res else { break };
7556 val
7557 }),
7558 278u16 => Nl80211Attrs::TwtResponder(()),
7559 279u16 => Nl80211Attrs::HeObssPd({
7560 let res = Some(next);
7561 let Some(val) = res else { break };
7562 val
7563 }),
7564 280u16 => Nl80211Attrs::WiphyEdmgChannels({
7565 let res = parse_u8(next);
7566 let Some(val) = res else { break };
7567 val
7568 }),
7569 281u16 => Nl80211Attrs::WiphyEdmgBwConfig({
7570 let res = parse_u8(next);
7571 let Some(val) = res else { break };
7572 val
7573 }),
7574 282u16 => Nl80211Attrs::VlanId({
7575 let res = parse_u16(next);
7576 let Some(val) = res else { break };
7577 val
7578 }),
7579 283u16 => Nl80211Attrs::HeBssColor({
7580 let res = Some(next);
7581 let Some(val) = res else { break };
7582 val
7583 }),
7584 284u16 => Nl80211Attrs::IftypeAkmSuites({
7585 let res = Some(next);
7586 let Some(val) = res else { break };
7587 val
7588 }),
7589 285u16 => Nl80211Attrs::TidConfig({
7590 let res = Some(next);
7591 let Some(val) = res else { break };
7592 val
7593 }),
7594 286u16 => Nl80211Attrs::ControlPortNoPreauth(()),
7595 287u16 => Nl80211Attrs::PmkLifetime({
7596 let res = parse_u32(next);
7597 let Some(val) = res else { break };
7598 val
7599 }),
7600 288u16 => Nl80211Attrs::PmkReauthThreshold({
7601 let res = parse_u8(next);
7602 let Some(val) = res else { break };
7603 val
7604 }),
7605 289u16 => Nl80211Attrs::ReceiveMulticast(()),
7606 290u16 => Nl80211Attrs::WiphyFreqOffset({
7607 let res = parse_u32(next);
7608 let Some(val) = res else { break };
7609 val
7610 }),
7611 291u16 => Nl80211Attrs::CenterFreq1Offset({
7612 let res = parse_u32(next);
7613 let Some(val) = res else { break };
7614 val
7615 }),
7616 292u16 => Nl80211Attrs::ScanFreqKhz({
7617 let res = Some(next);
7618 let Some(val) = res else { break };
7619 val
7620 }),
7621 293u16 => Nl80211Attrs::He6ghzCapability({
7622 let res = Some(next);
7623 let Some(val) = res else { break };
7624 val
7625 }),
7626 294u16 => Nl80211Attrs::FilsDiscovery({
7627 let res = Some(next);
7628 let Some(val) = res else { break };
7629 val
7630 }),
7631 295u16 => Nl80211Attrs::UnsolBcastProbeResp({
7632 let res = Some(next);
7633 let Some(val) = res else { break };
7634 val
7635 }),
7636 296u16 => Nl80211Attrs::S1gCapability({
7637 let res = Some(next);
7638 let Some(val) = res else { break };
7639 val
7640 }),
7641 297u16 => Nl80211Attrs::S1gCapabilityMask({
7642 let res = Some(next);
7643 let Some(val) = res else { break };
7644 val
7645 }),
7646 298u16 => Nl80211Attrs::SaePwe({
7647 let res = parse_u8(next);
7648 let Some(val) = res else { break };
7649 val
7650 }),
7651 299u16 => Nl80211Attrs::ReconnectRequested({
7652 let res = Some(next);
7653 let Some(val) = res else { break };
7654 val
7655 }),
7656 300u16 => Nl80211Attrs::SarSpec({
7657 let res = Some(IterableSarAttributes::with_loc(next, self.orig_loc));
7658 let Some(val) = res else { break };
7659 val
7660 }),
7661 301u16 => Nl80211Attrs::DisableHe(()),
7662 302u16 => Nl80211Attrs::ObssColorBitmap({
7663 let res = parse_u64(next);
7664 let Some(val) = res else { break };
7665 val
7666 }),
7667 303u16 => Nl80211Attrs::ColorChangeCount({
7668 let res = parse_u8(next);
7669 let Some(val) = res else { break };
7670 val
7671 }),
7672 304u16 => Nl80211Attrs::ColorChangeColor({
7673 let res = parse_u8(next);
7674 let Some(val) = res else { break };
7675 val
7676 }),
7677 305u16 => Nl80211Attrs::ColorChangeElems({
7678 let res = Some(next);
7679 let Some(val) = res else { break };
7680 val
7681 }),
7682 306u16 => Nl80211Attrs::MbssidConfig({
7683 let res = Some(next);
7684 let Some(val) = res else { break };
7685 val
7686 }),
7687 307u16 => Nl80211Attrs::MbssidElems({
7688 let res = Some(next);
7689 let Some(val) = res else { break };
7690 val
7691 }),
7692 308u16 => Nl80211Attrs::RadarBackground(()),
7693 309u16 => Nl80211Attrs::ApSettingsFlags({
7694 let res = parse_u32(next);
7695 let Some(val) = res else { break };
7696 val
7697 }),
7698 310u16 => Nl80211Attrs::EhtCapability({
7699 let res = Some(next);
7700 let Some(val) = res else { break };
7701 val
7702 }),
7703 311u16 => Nl80211Attrs::DisableEht(()),
7704 312u16 => Nl80211Attrs::MloLinks({
7705 let res = Some(next);
7706 let Some(val) = res else { break };
7707 val
7708 }),
7709 313u16 => Nl80211Attrs::MloLinkId({
7710 let res = parse_u8(next);
7711 let Some(val) = res else { break };
7712 val
7713 }),
7714 314u16 => Nl80211Attrs::MldAddr({
7715 let res = Some(next);
7716 let Some(val) = res else { break };
7717 val
7718 }),
7719 315u16 => Nl80211Attrs::MloSupport(()),
7720 316u16 => Nl80211Attrs::MaxNumAkmSuites({
7721 let res = Some(next);
7722 let Some(val) = res else { break };
7723 val
7724 }),
7725 317u16 => Nl80211Attrs::EmlCapability({
7726 let res = parse_u16(next);
7727 let Some(val) = res else { break };
7728 val
7729 }),
7730 318u16 => Nl80211Attrs::MldCapaAndOps({
7731 let res = parse_u16(next);
7732 let Some(val) = res else { break };
7733 val
7734 }),
7735 319u16 => Nl80211Attrs::TxHwTimestamp({
7736 let res = parse_u64(next);
7737 let Some(val) = res else { break };
7738 val
7739 }),
7740 320u16 => Nl80211Attrs::RxHwTimestamp({
7741 let res = parse_u64(next);
7742 let Some(val) = res else { break };
7743 val
7744 }),
7745 321u16 => Nl80211Attrs::TdBitmap({
7746 let res = Some(next);
7747 let Some(val) = res else { break };
7748 val
7749 }),
7750 322u16 => Nl80211Attrs::PunctBitmap({
7751 let res = parse_u32(next);
7752 let Some(val) = res else { break };
7753 val
7754 }),
7755 323u16 => Nl80211Attrs::MaxHwTimestampPeers({
7756 let res = parse_u16(next);
7757 let Some(val) = res else { break };
7758 val
7759 }),
7760 324u16 => Nl80211Attrs::HwTimestampEnabled(()),
7761 325u16 => Nl80211Attrs::EmaRnrElems({
7762 let res = Some(next);
7763 let Some(val) = res else { break };
7764 val
7765 }),
7766 326u16 => Nl80211Attrs::MloLinkDisabled(()),
7767 327u16 => Nl80211Attrs::BssDumpIncludeUseData(()),
7768 328u16 => Nl80211Attrs::MloTtlmDlink({
7769 let res = parse_u16(next);
7770 let Some(val) = res else { break };
7771 val
7772 }),
7773 329u16 => Nl80211Attrs::MloTtlmUlink({
7774 let res = parse_u16(next);
7775 let Some(val) = res else { break };
7776 val
7777 }),
7778 330u16 => Nl80211Attrs::AssocSppAmsdu(()),
7779 331u16 => Nl80211Attrs::WiphyRadios({
7780 let res = Some(next);
7781 let Some(val) = res else { break };
7782 val
7783 }),
7784 332u16 => Nl80211Attrs::WiphyInterfaceCombinations({
7785 let res = Some(next);
7786 let Some(val) = res else { break };
7787 val
7788 }),
7789 333u16 => Nl80211Attrs::VifRadioMask({
7790 let res = parse_u32(next);
7791 let Some(val) = res else { break };
7792 val
7793 }),
7794 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
7795 n => continue,
7796 };
7797 return Some(Ok(res));
7798 }
7799 Some(Err(ErrorContext::new(
7800 "Nl80211Attrs",
7801 r#type.and_then(|t| Nl80211Attrs::attr_from_type(t)),
7802 self.orig_loc,
7803 self.buf.as_ptr().wrapping_add(pos) as usize,
7804 )))
7805 }
7806}
7807impl std::fmt::Debug for IterableArrayU32<'_> {
7808 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7809 fmt.debug_list()
7810 .entries(self.clone().map(FlattenErrorContext))
7811 .finish()
7812 }
7813}
7814impl std::fmt::Debug for IterableArrayIfCombinationAttributes<'_> {
7815 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7816 fmt.debug_list()
7817 .entries(self.clone().map(FlattenErrorContext))
7818 .finish()
7819 }
7820}
7821impl<'a> std::fmt::Debug for IterableNl80211Attrs<'_> {
7822 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7823 let mut fmt = f.debug_struct("Nl80211Attrs");
7824 for attr in self.clone() {
7825 let attr = match attr {
7826 Ok(a) => a,
7827 Err(err) => {
7828 fmt.finish()?;
7829 f.write_str("Err(")?;
7830 err.fmt(f)?;
7831 return f.write_str(")");
7832 }
7833 };
7834 match attr {
7835 Nl80211Attrs::Wiphy(val) => fmt.field("Wiphy", &val),
7836 Nl80211Attrs::WiphyName(val) => fmt.field("WiphyName", &val),
7837 Nl80211Attrs::Ifindex(val) => fmt.field("Ifindex", &val),
7838 Nl80211Attrs::Ifname(val) => fmt.field("Ifname", &val),
7839 Nl80211Attrs::Iftype(val) => fmt.field("Iftype", &val),
7840 Nl80211Attrs::Mac(val) => fmt.field("Mac", &FormatMac(val)),
7841 Nl80211Attrs::KeyData(val) => fmt.field("KeyData", &val),
7842 Nl80211Attrs::KeyIdx(val) => fmt.field("KeyIdx", &val),
7843 Nl80211Attrs::KeyCipher(val) => fmt.field("KeyCipher", &val),
7844 Nl80211Attrs::KeySeq(val) => fmt.field("KeySeq", &val),
7845 Nl80211Attrs::KeyDefault(val) => fmt.field("KeyDefault", &val),
7846 Nl80211Attrs::BeaconInterval(val) => fmt.field("BeaconInterval", &val),
7847 Nl80211Attrs::DtimPeriod(val) => fmt.field("DtimPeriod", &val),
7848 Nl80211Attrs::BeaconHead(val) => fmt.field("BeaconHead", &val),
7849 Nl80211Attrs::BeaconTail(val) => fmt.field("BeaconTail", &val),
7850 Nl80211Attrs::StaAid(val) => fmt.field("StaAid", &val),
7851 Nl80211Attrs::StaFlags(val) => fmt.field("StaFlags", &val),
7852 Nl80211Attrs::StaListenInterval(val) => fmt.field("StaListenInterval", &val),
7853 Nl80211Attrs::StaSupportedRates(val) => fmt.field("StaSupportedRates", &val),
7854 Nl80211Attrs::StaVlan(val) => fmt.field("StaVlan", &val),
7855 Nl80211Attrs::StaInfo(val) => fmt.field("StaInfo", &val),
7856 Nl80211Attrs::WiphyBands(val) => fmt.field("WiphyBands", &val),
7857 Nl80211Attrs::MntrFlags(val) => fmt.field("MntrFlags", &val),
7858 Nl80211Attrs::MeshId(val) => fmt.field("MeshId", &val),
7859 Nl80211Attrs::StaPlinkAction(val) => fmt.field("StaPlinkAction", &val),
7860 Nl80211Attrs::MpathNextHop(val) => fmt.field("MpathNextHop", &FormatMac(val)),
7861 Nl80211Attrs::MpathInfo(val) => fmt.field("MpathInfo", &val),
7862 Nl80211Attrs::BssCtsProt(val) => fmt.field("BssCtsProt", &val),
7863 Nl80211Attrs::BssShortPreamble(val) => fmt.field("BssShortPreamble", &val),
7864 Nl80211Attrs::BssShortSlotTime(val) => fmt.field("BssShortSlotTime", &val),
7865 Nl80211Attrs::HtCapability(val) => fmt.field("HtCapability", &val),
7866 Nl80211Attrs::SupportedIftypes(val) => fmt.field("SupportedIftypes", &val),
7867 Nl80211Attrs::RegAlpha2(val) => fmt.field("RegAlpha2", &val),
7868 Nl80211Attrs::RegRules(val) => fmt.field("RegRules", &val),
7869 Nl80211Attrs::MeshConfig(val) => fmt.field("MeshConfig", &val),
7870 Nl80211Attrs::BssBasicRates(val) => fmt.field("BssBasicRates", &val),
7871 Nl80211Attrs::WiphyTxqParams(val) => fmt.field("WiphyTxqParams", &val),
7872 Nl80211Attrs::WiphyFreq(val) => fmt.field("WiphyFreq", &val),
7873 Nl80211Attrs::WiphyChannelType(val) => fmt.field(
7874 "WiphyChannelType",
7875 &FormatEnum(val.into(), ChannelType::from_value),
7876 ),
7877 Nl80211Attrs::KeyDefaultMgmt(val) => fmt.field("KeyDefaultMgmt", &val),
7878 Nl80211Attrs::MgmtSubtype(val) => fmt.field("MgmtSubtype", &val),
7879 Nl80211Attrs::Ie(val) => fmt.field("Ie", &val),
7880 Nl80211Attrs::MaxNumScanSsids(val) => fmt.field("MaxNumScanSsids", &val),
7881 Nl80211Attrs::ScanFrequencies(val) => fmt.field("ScanFrequencies", &val),
7882 Nl80211Attrs::ScanSsids(val) => fmt.field("ScanSsids", &val),
7883 Nl80211Attrs::Generation(val) => fmt.field("Generation", &val),
7884 Nl80211Attrs::Bss(val) => fmt.field("Bss", &val),
7885 Nl80211Attrs::RegInitiator(val) => fmt.field("RegInitiator", &val),
7886 Nl80211Attrs::RegType(val) => fmt.field("RegType", &val),
7887 Nl80211Attrs::SupportedCommands(val) => fmt.field(
7888 "SupportedCommands",
7889 &MapFormatArray(val, |v| FormatEnum(v.into(), Commands::from_value)),
7890 ),
7891 Nl80211Attrs::Frame(val) => fmt.field("Frame", &val),
7892 Nl80211Attrs::Ssid(val) => fmt.field("Ssid", &val),
7893 Nl80211Attrs::AuthType(val) => fmt.field("AuthType", &val),
7894 Nl80211Attrs::ReasonCode(val) => fmt.field("ReasonCode", &val),
7895 Nl80211Attrs::KeyType(val) => fmt.field("KeyType", &val),
7896 Nl80211Attrs::MaxScanIeLen(val) => fmt.field("MaxScanIeLen", &val),
7897 Nl80211Attrs::CipherSuites(val) => fmt.field("CipherSuites", &FormatHex(val)),
7898 Nl80211Attrs::FreqBefore(val) => fmt.field("FreqBefore", &val),
7899 Nl80211Attrs::FreqAfter(val) => fmt.field("FreqAfter", &val),
7900 Nl80211Attrs::FreqFixed(val) => fmt.field("FreqFixed", &val),
7901 Nl80211Attrs::WiphyRetryShort(val) => fmt.field("WiphyRetryShort", &val),
7902 Nl80211Attrs::WiphyRetryLong(val) => fmt.field("WiphyRetryLong", &val),
7903 Nl80211Attrs::WiphyFragThreshold(val) => fmt.field("WiphyFragThreshold", &val),
7904 Nl80211Attrs::WiphyRtsThreshold(val) => fmt.field("WiphyRtsThreshold", &val),
7905 Nl80211Attrs::TimedOut(val) => fmt.field("TimedOut", &val),
7906 Nl80211Attrs::UseMfp(val) => fmt.field("UseMfp", &val),
7907 Nl80211Attrs::StaFlags2(val) => fmt.field("StaFlags2", &val),
7908 Nl80211Attrs::ControlPort(val) => fmt.field("ControlPort", &val),
7909 Nl80211Attrs::Testdata(val) => fmt.field("Testdata", &val),
7910 Nl80211Attrs::Privacy(val) => fmt.field("Privacy", &val),
7911 Nl80211Attrs::DisconnectedByAp(val) => fmt.field("DisconnectedByAp", &val),
7912 Nl80211Attrs::StatusCode(val) => fmt.field("StatusCode", &val),
7913 Nl80211Attrs::CipherSuitesPairwise(val) => fmt.field("CipherSuitesPairwise", &val),
7914 Nl80211Attrs::CipherSuiteGroup(val) => fmt.field("CipherSuiteGroup", &val),
7915 Nl80211Attrs::WpaVersions(val) => fmt.field("WpaVersions", &val),
7916 Nl80211Attrs::AkmSuites(val) => fmt.field("AkmSuites", &val),
7917 Nl80211Attrs::ReqIe(val) => fmt.field("ReqIe", &val),
7918 Nl80211Attrs::RespIe(val) => fmt.field("RespIe", &val),
7919 Nl80211Attrs::PrevBssid(val) => fmt.field("PrevBssid", &val),
7920 Nl80211Attrs::Key(val) => fmt.field("Key", &val),
7921 Nl80211Attrs::Keys(val) => fmt.field("Keys", &val),
7922 Nl80211Attrs::Pid(val) => fmt.field("Pid", &val),
7923 Nl80211Attrs::_4addr(val) => fmt.field("_4addr", &val),
7924 Nl80211Attrs::SurveyInfo(val) => fmt.field("SurveyInfo", &val),
7925 Nl80211Attrs::Pmkid(val) => fmt.field("Pmkid", &val),
7926 Nl80211Attrs::MaxNumPmkids(val) => fmt.field("MaxNumPmkids", &val),
7927 Nl80211Attrs::Duration(val) => fmt.field("Duration", &val),
7928 Nl80211Attrs::Cookie(val) => fmt.field("Cookie", &val),
7929 Nl80211Attrs::WiphyCoverageClass(val) => fmt.field("WiphyCoverageClass", &val),
7930 Nl80211Attrs::TxRates(val) => fmt.field("TxRates", &val),
7931 Nl80211Attrs::FrameMatch(val) => fmt.field("FrameMatch", &val),
7932 Nl80211Attrs::Ack(val) => fmt.field("Ack", &val),
7933 Nl80211Attrs::PsState(val) => fmt.field("PsState", &val),
7934 Nl80211Attrs::Cqm(val) => fmt.field("Cqm", &val),
7935 Nl80211Attrs::LocalStateChange(val) => fmt.field("LocalStateChange", &val),
7936 Nl80211Attrs::ApIsolate(val) => fmt.field("ApIsolate", &val),
7937 Nl80211Attrs::WiphyTxPowerSetting(val) => fmt.field("WiphyTxPowerSetting", &val),
7938 Nl80211Attrs::WiphyTxPowerLevel(val) => fmt.field("WiphyTxPowerLevel", &val),
7939 Nl80211Attrs::TxFrameTypes(val) => fmt.field("TxFrameTypes", &val),
7940 Nl80211Attrs::RxFrameTypes(val) => fmt.field("RxFrameTypes", &val),
7941 Nl80211Attrs::FrameType(val) => fmt.field("FrameType", &val),
7942 Nl80211Attrs::ControlPortEthertype(val) => fmt.field("ControlPortEthertype", &val),
7943 Nl80211Attrs::ControlPortNoEncrypt(val) => fmt.field("ControlPortNoEncrypt", &val),
7944 Nl80211Attrs::SupportIbssRsn(val) => fmt.field("SupportIbssRsn", &val),
7945 Nl80211Attrs::WiphyAntennaTx(val) => fmt.field("WiphyAntennaTx", &val),
7946 Nl80211Attrs::WiphyAntennaRx(val) => fmt.field("WiphyAntennaRx", &val),
7947 Nl80211Attrs::McastRate(val) => fmt.field("McastRate", &val),
7948 Nl80211Attrs::OffchannelTxOk(val) => fmt.field("OffchannelTxOk", &val),
7949 Nl80211Attrs::BssHtOpmode(val) => fmt.field("BssHtOpmode", &val),
7950 Nl80211Attrs::KeyDefaultTypes(val) => fmt.field("KeyDefaultTypes", &val),
7951 Nl80211Attrs::MaxRemainOnChannelDuration(val) => {
7952 fmt.field("MaxRemainOnChannelDuration", &val)
7953 }
7954 Nl80211Attrs::MeshSetup(val) => fmt.field("MeshSetup", &val),
7955 Nl80211Attrs::WiphyAntennaAvailTx(val) => fmt.field("WiphyAntennaAvailTx", &val),
7956 Nl80211Attrs::WiphyAntennaAvailRx(val) => fmt.field("WiphyAntennaAvailRx", &val),
7957 Nl80211Attrs::SupportMeshAuth(val) => fmt.field("SupportMeshAuth", &val),
7958 Nl80211Attrs::StaPlinkState(val) => fmt.field("StaPlinkState", &val),
7959 Nl80211Attrs::WowlanTriggers(val) => fmt.field("WowlanTriggers", &val),
7960 Nl80211Attrs::WowlanTriggersSupported(val) => {
7961 fmt.field("WowlanTriggersSupported", &val)
7962 }
7963 Nl80211Attrs::SchedScanInterval(val) => fmt.field("SchedScanInterval", &val),
7964 Nl80211Attrs::InterfaceCombinations(val) => {
7965 fmt.field("InterfaceCombinations", &val)
7966 }
7967 Nl80211Attrs::SoftwareIftypes(val) => fmt.field("SoftwareIftypes", &val),
7968 Nl80211Attrs::RekeyData(val) => fmt.field("RekeyData", &val),
7969 Nl80211Attrs::MaxNumSchedScanSsids(val) => fmt.field("MaxNumSchedScanSsids", &val),
7970 Nl80211Attrs::MaxSchedScanIeLen(val) => fmt.field("MaxSchedScanIeLen", &val),
7971 Nl80211Attrs::ScanSuppRates(val) => fmt.field("ScanSuppRates", &val),
7972 Nl80211Attrs::HiddenSsid(val) => fmt.field("HiddenSsid", &val),
7973 Nl80211Attrs::IeProbeResp(val) => fmt.field("IeProbeResp", &val),
7974 Nl80211Attrs::IeAssocResp(val) => fmt.field("IeAssocResp", &val),
7975 Nl80211Attrs::StaWme(val) => fmt.field("StaWme", &val),
7976 Nl80211Attrs::SupportApUapsd(val) => fmt.field("SupportApUapsd", &val),
7977 Nl80211Attrs::RoamSupport(val) => fmt.field("RoamSupport", &val),
7978 Nl80211Attrs::SchedScanMatch(val) => fmt.field("SchedScanMatch", &val),
7979 Nl80211Attrs::MaxMatchSets(val) => fmt.field("MaxMatchSets", &val),
7980 Nl80211Attrs::PmksaCandidate(val) => fmt.field("PmksaCandidate", &val),
7981 Nl80211Attrs::TxNoCckRate(val) => fmt.field("TxNoCckRate", &val),
7982 Nl80211Attrs::TdlsAction(val) => fmt.field("TdlsAction", &val),
7983 Nl80211Attrs::TdlsDialogToken(val) => fmt.field("TdlsDialogToken", &val),
7984 Nl80211Attrs::TdlsOperation(val) => fmt.field("TdlsOperation", &val),
7985 Nl80211Attrs::TdlsSupport(val) => fmt.field("TdlsSupport", &val),
7986 Nl80211Attrs::TdlsExternalSetup(val) => fmt.field("TdlsExternalSetup", &val),
7987 Nl80211Attrs::DeviceApSme(val) => fmt.field("DeviceApSme", &val),
7988 Nl80211Attrs::DontWaitForAck(val) => fmt.field("DontWaitForAck", &val),
7989 Nl80211Attrs::FeatureFlags(val) => fmt.field(
7990 "FeatureFlags",
7991 &FormatFlags(val.into(), FeatureFlags::from_value),
7992 ),
7993 Nl80211Attrs::ProbeRespOffload(val) => fmt.field("ProbeRespOffload", &val),
7994 Nl80211Attrs::ProbeResp(val) => fmt.field("ProbeResp", &val),
7995 Nl80211Attrs::DfsRegion(val) => fmt.field("DfsRegion", &val),
7996 Nl80211Attrs::DisableHt(val) => fmt.field("DisableHt", &val),
7997 Nl80211Attrs::HtCapabilityMask(val) => fmt.field("HtCapabilityMask", &val),
7998 Nl80211Attrs::NoackMap(val) => fmt.field("NoackMap", &val),
7999 Nl80211Attrs::InactivityTimeout(val) => fmt.field("InactivityTimeout", &val),
8000 Nl80211Attrs::RxSignalDbm(val) => fmt.field("RxSignalDbm", &val),
8001 Nl80211Attrs::BgScanPeriod(val) => fmt.field("BgScanPeriod", &val),
8002 Nl80211Attrs::Wdev(val) => fmt.field("Wdev", &val),
8003 Nl80211Attrs::UserRegHintType(val) => fmt.field("UserRegHintType", &val),
8004 Nl80211Attrs::ConnFailedReason(val) => fmt.field("ConnFailedReason", &val),
8005 Nl80211Attrs::AuthData(val) => fmt.field("AuthData", &val),
8006 Nl80211Attrs::VhtCapability(val) => fmt.field("VhtCapability", &val),
8007 Nl80211Attrs::ScanFlags(val) => fmt.field("ScanFlags", &val),
8008 Nl80211Attrs::ChannelWidth(val) => fmt.field("ChannelWidth", &val),
8009 Nl80211Attrs::CenterFreq1(val) => fmt.field("CenterFreq1", &val),
8010 Nl80211Attrs::CenterFreq2(val) => fmt.field("CenterFreq2", &val),
8011 Nl80211Attrs::P2pCtwindow(val) => fmt.field("P2pCtwindow", &val),
8012 Nl80211Attrs::P2pOppps(val) => fmt.field("P2pOppps", &val),
8013 Nl80211Attrs::LocalMeshPowerMode(val) => fmt.field("LocalMeshPowerMode", &val),
8014 Nl80211Attrs::AclPolicy(val) => fmt.field("AclPolicy", &val),
8015 Nl80211Attrs::MacAddrs(val) => fmt.field("MacAddrs", &val),
8016 Nl80211Attrs::MacAclMax(val) => fmt.field("MacAclMax", &val),
8017 Nl80211Attrs::RadarEvent(val) => fmt.field("RadarEvent", &val),
8018 Nl80211Attrs::ExtCapa(val) => fmt.field("ExtCapa", &val),
8019 Nl80211Attrs::ExtCapaMask(val) => fmt.field("ExtCapaMask", &val),
8020 Nl80211Attrs::StaCapability(val) => fmt.field("StaCapability", &val),
8021 Nl80211Attrs::StaExtCapability(val) => fmt.field("StaExtCapability", &val),
8022 Nl80211Attrs::ProtocolFeatures(val) => fmt.field(
8023 "ProtocolFeatures",
8024 &FormatFlags(val.into(), ProtocolFeatures::from_value),
8025 ),
8026 Nl80211Attrs::SplitWiphyDump(val) => fmt.field("SplitWiphyDump", &val),
8027 Nl80211Attrs::DisableVht(val) => fmt.field("DisableVht", &val),
8028 Nl80211Attrs::VhtCapabilityMask(val) => fmt.field("VhtCapabilityMask", &val),
8029 Nl80211Attrs::Mdid(val) => fmt.field("Mdid", &val),
8030 Nl80211Attrs::IeRic(val) => fmt.field("IeRic", &val),
8031 Nl80211Attrs::CritProtId(val) => fmt.field("CritProtId", &val),
8032 Nl80211Attrs::MaxCritProtDuration(val) => fmt.field("MaxCritProtDuration", &val),
8033 Nl80211Attrs::PeerAid(val) => fmt.field("PeerAid", &val),
8034 Nl80211Attrs::CoalesceRule(val) => fmt.field("CoalesceRule", &val),
8035 Nl80211Attrs::ChSwitchCount(val) => fmt.field("ChSwitchCount", &val),
8036 Nl80211Attrs::ChSwitchBlockTx(val) => fmt.field("ChSwitchBlockTx", &val),
8037 Nl80211Attrs::CsaIes(val) => fmt.field("CsaIes", &val),
8038 Nl80211Attrs::CntdwnOffsBeacon(val) => fmt.field("CntdwnOffsBeacon", &val),
8039 Nl80211Attrs::CntdwnOffsPresp(val) => fmt.field("CntdwnOffsPresp", &val),
8040 Nl80211Attrs::RxmgmtFlags(val) => fmt.field("RxmgmtFlags", &val),
8041 Nl80211Attrs::StaSupportedChannels(val) => fmt.field("StaSupportedChannels", &val),
8042 Nl80211Attrs::StaSupportedOperClasses(val) => {
8043 fmt.field("StaSupportedOperClasses", &val)
8044 }
8045 Nl80211Attrs::HandleDfs(val) => fmt.field("HandleDfs", &val),
8046 Nl80211Attrs::Support5Mhz(val) => fmt.field("Support5Mhz", &val),
8047 Nl80211Attrs::Support10Mhz(val) => fmt.field("Support10Mhz", &val),
8048 Nl80211Attrs::OpmodeNotif(val) => fmt.field("OpmodeNotif", &val),
8049 Nl80211Attrs::VendorId(val) => fmt.field("VendorId", &val),
8050 Nl80211Attrs::VendorSubcmd(val) => fmt.field("VendorSubcmd", &val),
8051 Nl80211Attrs::VendorData(val) => fmt.field("VendorData", &val),
8052 Nl80211Attrs::VendorEvents(val) => fmt.field("VendorEvents", &val),
8053 Nl80211Attrs::QosMap(val) => fmt.field("QosMap", &val),
8054 Nl80211Attrs::MacHint(val) => fmt.field("MacHint", &FormatMac(val)),
8055 Nl80211Attrs::WiphyFreqHint(val) => fmt.field("WiphyFreqHint", &val),
8056 Nl80211Attrs::MaxApAssocSta(val) => fmt.field("MaxApAssocSta", &val),
8057 Nl80211Attrs::TdlsPeerCapability(val) => fmt.field("TdlsPeerCapability", &val),
8058 Nl80211Attrs::SocketOwner(val) => fmt.field("SocketOwner", &val),
8059 Nl80211Attrs::CsaCOffsetsTx(val) => fmt.field("CsaCOffsetsTx", &val),
8060 Nl80211Attrs::MaxCsaCounters(val) => fmt.field("MaxCsaCounters", &val),
8061 Nl80211Attrs::TdlsInitiator(val) => fmt.field("TdlsInitiator", &val),
8062 Nl80211Attrs::UseRrm(val) => fmt.field("UseRrm", &val),
8063 Nl80211Attrs::WiphyDynAck(val) => fmt.field("WiphyDynAck", &val),
8064 Nl80211Attrs::Tsid(val) => fmt.field("Tsid", &val),
8065 Nl80211Attrs::UserPrio(val) => fmt.field("UserPrio", &val),
8066 Nl80211Attrs::AdmittedTime(val) => fmt.field("AdmittedTime", &val),
8067 Nl80211Attrs::SmpsMode(val) => fmt.field("SmpsMode", &val),
8068 Nl80211Attrs::OperClass(val) => fmt.field("OperClass", &val),
8069 Nl80211Attrs::MacMask(val) => fmt.field("MacMask", &FormatMac(val)),
8070 Nl80211Attrs::WiphySelfManagedReg(val) => fmt.field("WiphySelfManagedReg", &val),
8071 Nl80211Attrs::ExtFeatures(val) => fmt.field("ExtFeatures", &val),
8072 Nl80211Attrs::SurveyRadioStats(val) => fmt.field("SurveyRadioStats", &val),
8073 Nl80211Attrs::NetnsFd(val) => fmt.field("NetnsFd", &val),
8074 Nl80211Attrs::SchedScanDelay(val) => fmt.field("SchedScanDelay", &val),
8075 Nl80211Attrs::RegIndoor(val) => fmt.field("RegIndoor", &val),
8076 Nl80211Attrs::MaxNumSchedScanPlans(val) => fmt.field("MaxNumSchedScanPlans", &val),
8077 Nl80211Attrs::MaxScanPlanInterval(val) => fmt.field("MaxScanPlanInterval", &val),
8078 Nl80211Attrs::MaxScanPlanIterations(val) => {
8079 fmt.field("MaxScanPlanIterations", &val)
8080 }
8081 Nl80211Attrs::SchedScanPlans(val) => fmt.field("SchedScanPlans", &val),
8082 Nl80211Attrs::Pbss(val) => fmt.field("Pbss", &val),
8083 Nl80211Attrs::BssSelect(val) => fmt.field("BssSelect", &val),
8084 Nl80211Attrs::StaSupportP2pPs(val) => fmt.field("StaSupportP2pPs", &val),
8085 Nl80211Attrs::Pad(val) => fmt.field("Pad", &val),
8086 Nl80211Attrs::IftypeExtCapa(val) => fmt.field("IftypeExtCapa", &val),
8087 Nl80211Attrs::MuMimoGroupData(val) => fmt.field("MuMimoGroupData", &val),
8088 Nl80211Attrs::MuMimoFollowMacAddr(val) => {
8089 fmt.field("MuMimoFollowMacAddr", &FormatMac(val))
8090 }
8091 Nl80211Attrs::ScanStartTimeTsf(val) => fmt.field("ScanStartTimeTsf", &val),
8092 Nl80211Attrs::ScanStartTimeTsfBssid(val) => {
8093 fmt.field("ScanStartTimeTsfBssid", &val)
8094 }
8095 Nl80211Attrs::MeasurementDuration(val) => fmt.field("MeasurementDuration", &val),
8096 Nl80211Attrs::MeasurementDurationMandatory(val) => {
8097 fmt.field("MeasurementDurationMandatory", &val)
8098 }
8099 Nl80211Attrs::MeshPeerAid(val) => fmt.field("MeshPeerAid", &val),
8100 Nl80211Attrs::NanMasterPref(val) => fmt.field("NanMasterPref", &val),
8101 Nl80211Attrs::Bands(val) => fmt.field("Bands", &val),
8102 Nl80211Attrs::NanFunc(val) => fmt.field("NanFunc", &val),
8103 Nl80211Attrs::NanMatch(val) => fmt.field("NanMatch", &val),
8104 Nl80211Attrs::FilsKek(val) => fmt.field("FilsKek", &val),
8105 Nl80211Attrs::FilsNonces(val) => fmt.field("FilsNonces", &val),
8106 Nl80211Attrs::MulticastToUnicastEnabled(val) => {
8107 fmt.field("MulticastToUnicastEnabled", &val)
8108 }
8109 Nl80211Attrs::Bssid(val) => fmt.field("Bssid", &FormatMac(val)),
8110 Nl80211Attrs::SchedScanRelativeRssi(val) => {
8111 fmt.field("SchedScanRelativeRssi", &val)
8112 }
8113 Nl80211Attrs::SchedScanRssiAdjust(val) => fmt.field("SchedScanRssiAdjust", &val),
8114 Nl80211Attrs::TimeoutReason(val) => fmt.field("TimeoutReason", &val),
8115 Nl80211Attrs::FilsErpUsername(val) => fmt.field("FilsErpUsername", &val),
8116 Nl80211Attrs::FilsErpRealm(val) => fmt.field("FilsErpRealm", &val),
8117 Nl80211Attrs::FilsErpNextSeqNum(val) => fmt.field("FilsErpNextSeqNum", &val),
8118 Nl80211Attrs::FilsErpRrk(val) => fmt.field("FilsErpRrk", &val),
8119 Nl80211Attrs::FilsCacheId(val) => fmt.field("FilsCacheId", &val),
8120 Nl80211Attrs::Pmk(val) => fmt.field("Pmk", &val),
8121 Nl80211Attrs::SchedScanMulti(val) => fmt.field("SchedScanMulti", &val),
8122 Nl80211Attrs::SchedScanMaxReqs(val) => fmt.field("SchedScanMaxReqs", &val),
8123 Nl80211Attrs::Want1x4wayHs(val) => fmt.field("Want1x4wayHs", &val),
8124 Nl80211Attrs::Pmkr0Name(val) => fmt.field("Pmkr0Name", &val),
8125 Nl80211Attrs::PortAuthorized(val) => fmt.field("PortAuthorized", &val),
8126 Nl80211Attrs::ExternalAuthAction(val) => fmt.field("ExternalAuthAction", &val),
8127 Nl80211Attrs::ExternalAuthSupport(val) => fmt.field("ExternalAuthSupport", &val),
8128 Nl80211Attrs::Nss(val) => fmt.field("Nss", &val),
8129 Nl80211Attrs::AckSignal(val) => fmt.field("AckSignal", &val),
8130 Nl80211Attrs::ControlPortOverNl80211(val) => {
8131 fmt.field("ControlPortOverNl80211", &val)
8132 }
8133 Nl80211Attrs::TxqStats(val) => fmt.field("TxqStats", &val),
8134 Nl80211Attrs::TxqLimit(val) => fmt.field("TxqLimit", &val),
8135 Nl80211Attrs::TxqMemoryLimit(val) => fmt.field("TxqMemoryLimit", &val),
8136 Nl80211Attrs::TxqQuantum(val) => fmt.field("TxqQuantum", &val),
8137 Nl80211Attrs::HeCapability(val) => fmt.field("HeCapability", &val),
8138 Nl80211Attrs::FtmResponder(val) => fmt.field("FtmResponder", &val),
8139 Nl80211Attrs::FtmResponderStats(val) => fmt.field("FtmResponderStats", &val),
8140 Nl80211Attrs::Timeout(val) => fmt.field("Timeout", &val),
8141 Nl80211Attrs::PeerMeasurements(val) => fmt.field("PeerMeasurements", &val),
8142 Nl80211Attrs::AirtimeWeight(val) => fmt.field("AirtimeWeight", &val),
8143 Nl80211Attrs::StaTxPowerSetting(val) => fmt.field("StaTxPowerSetting", &val),
8144 Nl80211Attrs::StaTxPower(val) => fmt.field("StaTxPower", &val),
8145 Nl80211Attrs::SaePassword(val) => fmt.field("SaePassword", &val),
8146 Nl80211Attrs::TwtResponder(val) => fmt.field("TwtResponder", &val),
8147 Nl80211Attrs::HeObssPd(val) => fmt.field("HeObssPd", &val),
8148 Nl80211Attrs::WiphyEdmgChannels(val) => fmt.field("WiphyEdmgChannels", &val),
8149 Nl80211Attrs::WiphyEdmgBwConfig(val) => fmt.field("WiphyEdmgBwConfig", &val),
8150 Nl80211Attrs::VlanId(val) => fmt.field("VlanId", &val),
8151 Nl80211Attrs::HeBssColor(val) => fmt.field("HeBssColor", &val),
8152 Nl80211Attrs::IftypeAkmSuites(val) => fmt.field("IftypeAkmSuites", &val),
8153 Nl80211Attrs::TidConfig(val) => fmt.field("TidConfig", &val),
8154 Nl80211Attrs::ControlPortNoPreauth(val) => fmt.field("ControlPortNoPreauth", &val),
8155 Nl80211Attrs::PmkLifetime(val) => fmt.field("PmkLifetime", &val),
8156 Nl80211Attrs::PmkReauthThreshold(val) => fmt.field("PmkReauthThreshold", &val),
8157 Nl80211Attrs::ReceiveMulticast(val) => fmt.field("ReceiveMulticast", &val),
8158 Nl80211Attrs::WiphyFreqOffset(val) => fmt.field("WiphyFreqOffset", &val),
8159 Nl80211Attrs::CenterFreq1Offset(val) => fmt.field("CenterFreq1Offset", &val),
8160 Nl80211Attrs::ScanFreqKhz(val) => fmt.field("ScanFreqKhz", &val),
8161 Nl80211Attrs::He6ghzCapability(val) => fmt.field("He6ghzCapability", &val),
8162 Nl80211Attrs::FilsDiscovery(val) => fmt.field("FilsDiscovery", &val),
8163 Nl80211Attrs::UnsolBcastProbeResp(val) => fmt.field("UnsolBcastProbeResp", &val),
8164 Nl80211Attrs::S1gCapability(val) => fmt.field("S1gCapability", &val),
8165 Nl80211Attrs::S1gCapabilityMask(val) => fmt.field("S1gCapabilityMask", &val),
8166 Nl80211Attrs::SaePwe(val) => fmt.field("SaePwe", &val),
8167 Nl80211Attrs::ReconnectRequested(val) => fmt.field("ReconnectRequested", &val),
8168 Nl80211Attrs::SarSpec(val) => fmt.field("SarSpec", &val),
8169 Nl80211Attrs::DisableHe(val) => fmt.field("DisableHe", &val),
8170 Nl80211Attrs::ObssColorBitmap(val) => fmt.field("ObssColorBitmap", &val),
8171 Nl80211Attrs::ColorChangeCount(val) => fmt.field("ColorChangeCount", &val),
8172 Nl80211Attrs::ColorChangeColor(val) => fmt.field("ColorChangeColor", &val),
8173 Nl80211Attrs::ColorChangeElems(val) => fmt.field("ColorChangeElems", &val),
8174 Nl80211Attrs::MbssidConfig(val) => fmt.field("MbssidConfig", &val),
8175 Nl80211Attrs::MbssidElems(val) => fmt.field("MbssidElems", &val),
8176 Nl80211Attrs::RadarBackground(val) => fmt.field("RadarBackground", &val),
8177 Nl80211Attrs::ApSettingsFlags(val) => fmt.field("ApSettingsFlags", &val),
8178 Nl80211Attrs::EhtCapability(val) => fmt.field("EhtCapability", &val),
8179 Nl80211Attrs::DisableEht(val) => fmt.field("DisableEht", &val),
8180 Nl80211Attrs::MloLinks(val) => fmt.field("MloLinks", &val),
8181 Nl80211Attrs::MloLinkId(val) => fmt.field("MloLinkId", &val),
8182 Nl80211Attrs::MldAddr(val) => fmt.field("MldAddr", &FormatMac(val)),
8183 Nl80211Attrs::MloSupport(val) => fmt.field("MloSupport", &val),
8184 Nl80211Attrs::MaxNumAkmSuites(val) => fmt.field("MaxNumAkmSuites", &val),
8185 Nl80211Attrs::EmlCapability(val) => fmt.field("EmlCapability", &val),
8186 Nl80211Attrs::MldCapaAndOps(val) => fmt.field("MldCapaAndOps", &val),
8187 Nl80211Attrs::TxHwTimestamp(val) => fmt.field("TxHwTimestamp", &val),
8188 Nl80211Attrs::RxHwTimestamp(val) => fmt.field("RxHwTimestamp", &val),
8189 Nl80211Attrs::TdBitmap(val) => fmt.field("TdBitmap", &val),
8190 Nl80211Attrs::PunctBitmap(val) => fmt.field("PunctBitmap", &val),
8191 Nl80211Attrs::MaxHwTimestampPeers(val) => fmt.field("MaxHwTimestampPeers", &val),
8192 Nl80211Attrs::HwTimestampEnabled(val) => fmt.field("HwTimestampEnabled", &val),
8193 Nl80211Attrs::EmaRnrElems(val) => fmt.field("EmaRnrElems", &val),
8194 Nl80211Attrs::MloLinkDisabled(val) => fmt.field("MloLinkDisabled", &val),
8195 Nl80211Attrs::BssDumpIncludeUseData(val) => {
8196 fmt.field("BssDumpIncludeUseData", &val)
8197 }
8198 Nl80211Attrs::MloTtlmDlink(val) => fmt.field("MloTtlmDlink", &val),
8199 Nl80211Attrs::MloTtlmUlink(val) => fmt.field("MloTtlmUlink", &val),
8200 Nl80211Attrs::AssocSppAmsdu(val) => fmt.field("AssocSppAmsdu", &val),
8201 Nl80211Attrs::WiphyRadios(val) => fmt.field("WiphyRadios", &val),
8202 Nl80211Attrs::WiphyInterfaceCombinations(val) => {
8203 fmt.field("WiphyInterfaceCombinations", &val)
8204 }
8205 Nl80211Attrs::VifRadioMask(val) => fmt.field("VifRadioMask", &val),
8206 };
8207 }
8208 fmt.finish()
8209 }
8210}
8211impl IterableNl80211Attrs<'_> {
8212 pub fn lookup_attr(
8213 &self,
8214 offset: usize,
8215 missing_type: Option<u16>,
8216 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
8217 let mut stack = Vec::new();
8218 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
8219 if missing_type.is_some() && cur == offset {
8220 stack.push(("Nl80211Attrs", offset));
8221 return (
8222 stack,
8223 missing_type.and_then(|t| Nl80211Attrs::attr_from_type(t)),
8224 );
8225 }
8226 if cur > offset || cur + self.buf.len() < offset {
8227 return (stack, None);
8228 }
8229 let mut attrs = self.clone();
8230 let mut last_off = cur + attrs.pos;
8231 let mut missing = None;
8232 while let Some(attr) = attrs.next() {
8233 let Ok(attr) = attr else { break };
8234 match attr {
8235 Nl80211Attrs::Wiphy(val) => {
8236 if last_off == offset {
8237 stack.push(("Wiphy", last_off));
8238 break;
8239 }
8240 }
8241 Nl80211Attrs::WiphyName(val) => {
8242 if last_off == offset {
8243 stack.push(("WiphyName", last_off));
8244 break;
8245 }
8246 }
8247 Nl80211Attrs::Ifindex(val) => {
8248 if last_off == offset {
8249 stack.push(("Ifindex", last_off));
8250 break;
8251 }
8252 }
8253 Nl80211Attrs::Ifname(val) => {
8254 if last_off == offset {
8255 stack.push(("Ifname", last_off));
8256 break;
8257 }
8258 }
8259 Nl80211Attrs::Iftype(val) => {
8260 if last_off == offset {
8261 stack.push(("Iftype", last_off));
8262 break;
8263 }
8264 }
8265 Nl80211Attrs::Mac(val) => {
8266 if last_off == offset {
8267 stack.push(("Mac", last_off));
8268 break;
8269 }
8270 }
8271 Nl80211Attrs::KeyData(val) => {
8272 if last_off == offset {
8273 stack.push(("KeyData", last_off));
8274 break;
8275 }
8276 }
8277 Nl80211Attrs::KeyIdx(val) => {
8278 if last_off == offset {
8279 stack.push(("KeyIdx", last_off));
8280 break;
8281 }
8282 }
8283 Nl80211Attrs::KeyCipher(val) => {
8284 if last_off == offset {
8285 stack.push(("KeyCipher", last_off));
8286 break;
8287 }
8288 }
8289 Nl80211Attrs::KeySeq(val) => {
8290 if last_off == offset {
8291 stack.push(("KeySeq", last_off));
8292 break;
8293 }
8294 }
8295 Nl80211Attrs::KeyDefault(val) => {
8296 if last_off == offset {
8297 stack.push(("KeyDefault", last_off));
8298 break;
8299 }
8300 }
8301 Nl80211Attrs::BeaconInterval(val) => {
8302 if last_off == offset {
8303 stack.push(("BeaconInterval", last_off));
8304 break;
8305 }
8306 }
8307 Nl80211Attrs::DtimPeriod(val) => {
8308 if last_off == offset {
8309 stack.push(("DtimPeriod", last_off));
8310 break;
8311 }
8312 }
8313 Nl80211Attrs::BeaconHead(val) => {
8314 if last_off == offset {
8315 stack.push(("BeaconHead", last_off));
8316 break;
8317 }
8318 }
8319 Nl80211Attrs::BeaconTail(val) => {
8320 if last_off == offset {
8321 stack.push(("BeaconTail", last_off));
8322 break;
8323 }
8324 }
8325 Nl80211Attrs::StaAid(val) => {
8326 if last_off == offset {
8327 stack.push(("StaAid", last_off));
8328 break;
8329 }
8330 }
8331 Nl80211Attrs::StaFlags(val) => {
8332 if last_off == offset {
8333 stack.push(("StaFlags", last_off));
8334 break;
8335 }
8336 }
8337 Nl80211Attrs::StaListenInterval(val) => {
8338 if last_off == offset {
8339 stack.push(("StaListenInterval", last_off));
8340 break;
8341 }
8342 }
8343 Nl80211Attrs::StaSupportedRates(val) => {
8344 if last_off == offset {
8345 stack.push(("StaSupportedRates", last_off));
8346 break;
8347 }
8348 }
8349 Nl80211Attrs::StaVlan(val) => {
8350 if last_off == offset {
8351 stack.push(("StaVlan", last_off));
8352 break;
8353 }
8354 }
8355 Nl80211Attrs::StaInfo(val) => {
8356 if last_off == offset {
8357 stack.push(("StaInfo", last_off));
8358 break;
8359 }
8360 }
8361 Nl80211Attrs::WiphyBands(val) => {
8362 (stack, missing) = val.lookup_attr(offset, missing_type);
8363 if !stack.is_empty() {
8364 break;
8365 }
8366 }
8367 Nl80211Attrs::MntrFlags(val) => {
8368 if last_off == offset {
8369 stack.push(("MntrFlags", last_off));
8370 break;
8371 }
8372 }
8373 Nl80211Attrs::MeshId(val) => {
8374 if last_off == offset {
8375 stack.push(("MeshId", last_off));
8376 break;
8377 }
8378 }
8379 Nl80211Attrs::StaPlinkAction(val) => {
8380 if last_off == offset {
8381 stack.push(("StaPlinkAction", last_off));
8382 break;
8383 }
8384 }
8385 Nl80211Attrs::MpathNextHop(val) => {
8386 if last_off == offset {
8387 stack.push(("MpathNextHop", last_off));
8388 break;
8389 }
8390 }
8391 Nl80211Attrs::MpathInfo(val) => {
8392 if last_off == offset {
8393 stack.push(("MpathInfo", last_off));
8394 break;
8395 }
8396 }
8397 Nl80211Attrs::BssCtsProt(val) => {
8398 if last_off == offset {
8399 stack.push(("BssCtsProt", last_off));
8400 break;
8401 }
8402 }
8403 Nl80211Attrs::BssShortPreamble(val) => {
8404 if last_off == offset {
8405 stack.push(("BssShortPreamble", last_off));
8406 break;
8407 }
8408 }
8409 Nl80211Attrs::BssShortSlotTime(val) => {
8410 if last_off == offset {
8411 stack.push(("BssShortSlotTime", last_off));
8412 break;
8413 }
8414 }
8415 Nl80211Attrs::HtCapability(val) => {
8416 if last_off == offset {
8417 stack.push(("HtCapability", last_off));
8418 break;
8419 }
8420 }
8421 Nl80211Attrs::SupportedIftypes(val) => {
8422 (stack, missing) = val.lookup_attr(offset, missing_type);
8423 if !stack.is_empty() {
8424 break;
8425 }
8426 }
8427 Nl80211Attrs::RegAlpha2(val) => {
8428 if last_off == offset {
8429 stack.push(("RegAlpha2", last_off));
8430 break;
8431 }
8432 }
8433 Nl80211Attrs::RegRules(val) => {
8434 if last_off == offset {
8435 stack.push(("RegRules", last_off));
8436 break;
8437 }
8438 }
8439 Nl80211Attrs::MeshConfig(val) => {
8440 if last_off == offset {
8441 stack.push(("MeshConfig", last_off));
8442 break;
8443 }
8444 }
8445 Nl80211Attrs::BssBasicRates(val) => {
8446 if last_off == offset {
8447 stack.push(("BssBasicRates", last_off));
8448 break;
8449 }
8450 }
8451 Nl80211Attrs::WiphyTxqParams(val) => {
8452 if last_off == offset {
8453 stack.push(("WiphyTxqParams", last_off));
8454 break;
8455 }
8456 }
8457 Nl80211Attrs::WiphyFreq(val) => {
8458 if last_off == offset {
8459 stack.push(("WiphyFreq", last_off));
8460 break;
8461 }
8462 }
8463 Nl80211Attrs::WiphyChannelType(val) => {
8464 if last_off == offset {
8465 stack.push(("WiphyChannelType", last_off));
8466 break;
8467 }
8468 }
8469 Nl80211Attrs::KeyDefaultMgmt(val) => {
8470 if last_off == offset {
8471 stack.push(("KeyDefaultMgmt", last_off));
8472 break;
8473 }
8474 }
8475 Nl80211Attrs::MgmtSubtype(val) => {
8476 if last_off == offset {
8477 stack.push(("MgmtSubtype", last_off));
8478 break;
8479 }
8480 }
8481 Nl80211Attrs::Ie(val) => {
8482 if last_off == offset {
8483 stack.push(("Ie", last_off));
8484 break;
8485 }
8486 }
8487 Nl80211Attrs::MaxNumScanSsids(val) => {
8488 if last_off == offset {
8489 stack.push(("MaxNumScanSsids", last_off));
8490 break;
8491 }
8492 }
8493 Nl80211Attrs::ScanFrequencies(val) => {
8494 if last_off == offset {
8495 stack.push(("ScanFrequencies", last_off));
8496 break;
8497 }
8498 }
8499 Nl80211Attrs::ScanSsids(val) => {
8500 if last_off == offset {
8501 stack.push(("ScanSsids", last_off));
8502 break;
8503 }
8504 }
8505 Nl80211Attrs::Generation(val) => {
8506 if last_off == offset {
8507 stack.push(("Generation", last_off));
8508 break;
8509 }
8510 }
8511 Nl80211Attrs::Bss(val) => {
8512 if last_off == offset {
8513 stack.push(("Bss", last_off));
8514 break;
8515 }
8516 }
8517 Nl80211Attrs::RegInitiator(val) => {
8518 if last_off == offset {
8519 stack.push(("RegInitiator", last_off));
8520 break;
8521 }
8522 }
8523 Nl80211Attrs::RegType(val) => {
8524 if last_off == offset {
8525 stack.push(("RegType", last_off));
8526 break;
8527 }
8528 }
8529 Nl80211Attrs::SupportedCommands(val) => {
8530 if last_off == offset {
8531 stack.push(("SupportedCommands", last_off));
8532 break;
8533 }
8534 }
8535 Nl80211Attrs::Frame(val) => {
8536 if last_off == offset {
8537 stack.push(("Frame", last_off));
8538 break;
8539 }
8540 }
8541 Nl80211Attrs::Ssid(val) => {
8542 if last_off == offset {
8543 stack.push(("Ssid", last_off));
8544 break;
8545 }
8546 }
8547 Nl80211Attrs::AuthType(val) => {
8548 if last_off == offset {
8549 stack.push(("AuthType", last_off));
8550 break;
8551 }
8552 }
8553 Nl80211Attrs::ReasonCode(val) => {
8554 if last_off == offset {
8555 stack.push(("ReasonCode", last_off));
8556 break;
8557 }
8558 }
8559 Nl80211Attrs::KeyType(val) => {
8560 if last_off == offset {
8561 stack.push(("KeyType", last_off));
8562 break;
8563 }
8564 }
8565 Nl80211Attrs::MaxScanIeLen(val) => {
8566 if last_off == offset {
8567 stack.push(("MaxScanIeLen", last_off));
8568 break;
8569 }
8570 }
8571 Nl80211Attrs::CipherSuites(val) => {
8572 if last_off == offset {
8573 stack.push(("CipherSuites", last_off));
8574 break;
8575 }
8576 }
8577 Nl80211Attrs::FreqBefore(val) => {
8578 if last_off == offset {
8579 stack.push(("FreqBefore", last_off));
8580 break;
8581 }
8582 }
8583 Nl80211Attrs::FreqAfter(val) => {
8584 if last_off == offset {
8585 stack.push(("FreqAfter", last_off));
8586 break;
8587 }
8588 }
8589 Nl80211Attrs::FreqFixed(val) => {
8590 if last_off == offset {
8591 stack.push(("FreqFixed", last_off));
8592 break;
8593 }
8594 }
8595 Nl80211Attrs::WiphyRetryShort(val) => {
8596 if last_off == offset {
8597 stack.push(("WiphyRetryShort", last_off));
8598 break;
8599 }
8600 }
8601 Nl80211Attrs::WiphyRetryLong(val) => {
8602 if last_off == offset {
8603 stack.push(("WiphyRetryLong", last_off));
8604 break;
8605 }
8606 }
8607 Nl80211Attrs::WiphyFragThreshold(val) => {
8608 if last_off == offset {
8609 stack.push(("WiphyFragThreshold", last_off));
8610 break;
8611 }
8612 }
8613 Nl80211Attrs::WiphyRtsThreshold(val) => {
8614 if last_off == offset {
8615 stack.push(("WiphyRtsThreshold", last_off));
8616 break;
8617 }
8618 }
8619 Nl80211Attrs::TimedOut(val) => {
8620 if last_off == offset {
8621 stack.push(("TimedOut", last_off));
8622 break;
8623 }
8624 }
8625 Nl80211Attrs::UseMfp(val) => {
8626 if last_off == offset {
8627 stack.push(("UseMfp", last_off));
8628 break;
8629 }
8630 }
8631 Nl80211Attrs::StaFlags2(val) => {
8632 if last_off == offset {
8633 stack.push(("StaFlags2", last_off));
8634 break;
8635 }
8636 }
8637 Nl80211Attrs::ControlPort(val) => {
8638 if last_off == offset {
8639 stack.push(("ControlPort", last_off));
8640 break;
8641 }
8642 }
8643 Nl80211Attrs::Testdata(val) => {
8644 if last_off == offset {
8645 stack.push(("Testdata", last_off));
8646 break;
8647 }
8648 }
8649 Nl80211Attrs::Privacy(val) => {
8650 if last_off == offset {
8651 stack.push(("Privacy", last_off));
8652 break;
8653 }
8654 }
8655 Nl80211Attrs::DisconnectedByAp(val) => {
8656 if last_off == offset {
8657 stack.push(("DisconnectedByAp", last_off));
8658 break;
8659 }
8660 }
8661 Nl80211Attrs::StatusCode(val) => {
8662 if last_off == offset {
8663 stack.push(("StatusCode", last_off));
8664 break;
8665 }
8666 }
8667 Nl80211Attrs::CipherSuitesPairwise(val) => {
8668 if last_off == offset {
8669 stack.push(("CipherSuitesPairwise", last_off));
8670 break;
8671 }
8672 }
8673 Nl80211Attrs::CipherSuiteGroup(val) => {
8674 if last_off == offset {
8675 stack.push(("CipherSuiteGroup", last_off));
8676 break;
8677 }
8678 }
8679 Nl80211Attrs::WpaVersions(val) => {
8680 if last_off == offset {
8681 stack.push(("WpaVersions", last_off));
8682 break;
8683 }
8684 }
8685 Nl80211Attrs::AkmSuites(val) => {
8686 if last_off == offset {
8687 stack.push(("AkmSuites", last_off));
8688 break;
8689 }
8690 }
8691 Nl80211Attrs::ReqIe(val) => {
8692 if last_off == offset {
8693 stack.push(("ReqIe", last_off));
8694 break;
8695 }
8696 }
8697 Nl80211Attrs::RespIe(val) => {
8698 if last_off == offset {
8699 stack.push(("RespIe", last_off));
8700 break;
8701 }
8702 }
8703 Nl80211Attrs::PrevBssid(val) => {
8704 if last_off == offset {
8705 stack.push(("PrevBssid", last_off));
8706 break;
8707 }
8708 }
8709 Nl80211Attrs::Key(val) => {
8710 if last_off == offset {
8711 stack.push(("Key", last_off));
8712 break;
8713 }
8714 }
8715 Nl80211Attrs::Keys(val) => {
8716 if last_off == offset {
8717 stack.push(("Keys", last_off));
8718 break;
8719 }
8720 }
8721 Nl80211Attrs::Pid(val) => {
8722 if last_off == offset {
8723 stack.push(("Pid", last_off));
8724 break;
8725 }
8726 }
8727 Nl80211Attrs::_4addr(val) => {
8728 if last_off == offset {
8729 stack.push(("4addr", last_off));
8730 break;
8731 }
8732 }
8733 Nl80211Attrs::SurveyInfo(val) => {
8734 if last_off == offset {
8735 stack.push(("SurveyInfo", last_off));
8736 break;
8737 }
8738 }
8739 Nl80211Attrs::Pmkid(val) => {
8740 if last_off == offset {
8741 stack.push(("Pmkid", last_off));
8742 break;
8743 }
8744 }
8745 Nl80211Attrs::MaxNumPmkids(val) => {
8746 if last_off == offset {
8747 stack.push(("MaxNumPmkids", last_off));
8748 break;
8749 }
8750 }
8751 Nl80211Attrs::Duration(val) => {
8752 if last_off == offset {
8753 stack.push(("Duration", last_off));
8754 break;
8755 }
8756 }
8757 Nl80211Attrs::Cookie(val) => {
8758 if last_off == offset {
8759 stack.push(("Cookie", last_off));
8760 break;
8761 }
8762 }
8763 Nl80211Attrs::WiphyCoverageClass(val) => {
8764 if last_off == offset {
8765 stack.push(("WiphyCoverageClass", last_off));
8766 break;
8767 }
8768 }
8769 Nl80211Attrs::TxRates(val) => {
8770 if last_off == offset {
8771 stack.push(("TxRates", last_off));
8772 break;
8773 }
8774 }
8775 Nl80211Attrs::FrameMatch(val) => {
8776 if last_off == offset {
8777 stack.push(("FrameMatch", last_off));
8778 break;
8779 }
8780 }
8781 Nl80211Attrs::Ack(val) => {
8782 if last_off == offset {
8783 stack.push(("Ack", last_off));
8784 break;
8785 }
8786 }
8787 Nl80211Attrs::PsState(val) => {
8788 if last_off == offset {
8789 stack.push(("PsState", last_off));
8790 break;
8791 }
8792 }
8793 Nl80211Attrs::Cqm(val) => {
8794 if last_off == offset {
8795 stack.push(("Cqm", last_off));
8796 break;
8797 }
8798 }
8799 Nl80211Attrs::LocalStateChange(val) => {
8800 if last_off == offset {
8801 stack.push(("LocalStateChange", last_off));
8802 break;
8803 }
8804 }
8805 Nl80211Attrs::ApIsolate(val) => {
8806 if last_off == offset {
8807 stack.push(("ApIsolate", last_off));
8808 break;
8809 }
8810 }
8811 Nl80211Attrs::WiphyTxPowerSetting(val) => {
8812 if last_off == offset {
8813 stack.push(("WiphyTxPowerSetting", last_off));
8814 break;
8815 }
8816 }
8817 Nl80211Attrs::WiphyTxPowerLevel(val) => {
8818 if last_off == offset {
8819 stack.push(("WiphyTxPowerLevel", last_off));
8820 break;
8821 }
8822 }
8823 Nl80211Attrs::TxFrameTypes(val) => {
8824 (stack, missing) = val.lookup_attr(offset, missing_type);
8825 if !stack.is_empty() {
8826 break;
8827 }
8828 }
8829 Nl80211Attrs::RxFrameTypes(val) => {
8830 (stack, missing) = val.lookup_attr(offset, missing_type);
8831 if !stack.is_empty() {
8832 break;
8833 }
8834 }
8835 Nl80211Attrs::FrameType(val) => {
8836 if last_off == offset {
8837 stack.push(("FrameType", last_off));
8838 break;
8839 }
8840 }
8841 Nl80211Attrs::ControlPortEthertype(val) => {
8842 if last_off == offset {
8843 stack.push(("ControlPortEthertype", last_off));
8844 break;
8845 }
8846 }
8847 Nl80211Attrs::ControlPortNoEncrypt(val) => {
8848 if last_off == offset {
8849 stack.push(("ControlPortNoEncrypt", last_off));
8850 break;
8851 }
8852 }
8853 Nl80211Attrs::SupportIbssRsn(val) => {
8854 if last_off == offset {
8855 stack.push(("SupportIbssRsn", last_off));
8856 break;
8857 }
8858 }
8859 Nl80211Attrs::WiphyAntennaTx(val) => {
8860 if last_off == offset {
8861 stack.push(("WiphyAntennaTx", last_off));
8862 break;
8863 }
8864 }
8865 Nl80211Attrs::WiphyAntennaRx(val) => {
8866 if last_off == offset {
8867 stack.push(("WiphyAntennaRx", last_off));
8868 break;
8869 }
8870 }
8871 Nl80211Attrs::McastRate(val) => {
8872 if last_off == offset {
8873 stack.push(("McastRate", last_off));
8874 break;
8875 }
8876 }
8877 Nl80211Attrs::OffchannelTxOk(val) => {
8878 if last_off == offset {
8879 stack.push(("OffchannelTxOk", last_off));
8880 break;
8881 }
8882 }
8883 Nl80211Attrs::BssHtOpmode(val) => {
8884 if last_off == offset {
8885 stack.push(("BssHtOpmode", last_off));
8886 break;
8887 }
8888 }
8889 Nl80211Attrs::KeyDefaultTypes(val) => {
8890 if last_off == offset {
8891 stack.push(("KeyDefaultTypes", last_off));
8892 break;
8893 }
8894 }
8895 Nl80211Attrs::MaxRemainOnChannelDuration(val) => {
8896 if last_off == offset {
8897 stack.push(("MaxRemainOnChannelDuration", last_off));
8898 break;
8899 }
8900 }
8901 Nl80211Attrs::MeshSetup(val) => {
8902 if last_off == offset {
8903 stack.push(("MeshSetup", last_off));
8904 break;
8905 }
8906 }
8907 Nl80211Attrs::WiphyAntennaAvailTx(val) => {
8908 if last_off == offset {
8909 stack.push(("WiphyAntennaAvailTx", last_off));
8910 break;
8911 }
8912 }
8913 Nl80211Attrs::WiphyAntennaAvailRx(val) => {
8914 if last_off == offset {
8915 stack.push(("WiphyAntennaAvailRx", last_off));
8916 break;
8917 }
8918 }
8919 Nl80211Attrs::SupportMeshAuth(val) => {
8920 if last_off == offset {
8921 stack.push(("SupportMeshAuth", last_off));
8922 break;
8923 }
8924 }
8925 Nl80211Attrs::StaPlinkState(val) => {
8926 if last_off == offset {
8927 stack.push(("StaPlinkState", last_off));
8928 break;
8929 }
8930 }
8931 Nl80211Attrs::WowlanTriggers(val) => {
8932 if last_off == offset {
8933 stack.push(("WowlanTriggers", last_off));
8934 break;
8935 }
8936 }
8937 Nl80211Attrs::WowlanTriggersSupported(val) => {
8938 (stack, missing) = val.lookup_attr(offset, missing_type);
8939 if !stack.is_empty() {
8940 break;
8941 }
8942 }
8943 Nl80211Attrs::SchedScanInterval(val) => {
8944 if last_off == offset {
8945 stack.push(("SchedScanInterval", last_off));
8946 break;
8947 }
8948 }
8949 Nl80211Attrs::InterfaceCombinations(val) => {
8950 for entry in val {
8951 let Ok(attr) = entry else { break };
8952 (stack, missing) = attr.lookup_attr(offset, missing_type);
8953 if !stack.is_empty() {
8954 break;
8955 }
8956 }
8957 if !stack.is_empty() {
8958 stack.push(("InterfaceCombinations", last_off));
8959 break;
8960 }
8961 }
8962 Nl80211Attrs::SoftwareIftypes(val) => {
8963 (stack, missing) = val.lookup_attr(offset, missing_type);
8964 if !stack.is_empty() {
8965 break;
8966 }
8967 }
8968 Nl80211Attrs::RekeyData(val) => {
8969 if last_off == offset {
8970 stack.push(("RekeyData", last_off));
8971 break;
8972 }
8973 }
8974 Nl80211Attrs::MaxNumSchedScanSsids(val) => {
8975 if last_off == offset {
8976 stack.push(("MaxNumSchedScanSsids", last_off));
8977 break;
8978 }
8979 }
8980 Nl80211Attrs::MaxSchedScanIeLen(val) => {
8981 if last_off == offset {
8982 stack.push(("MaxSchedScanIeLen", last_off));
8983 break;
8984 }
8985 }
8986 Nl80211Attrs::ScanSuppRates(val) => {
8987 if last_off == offset {
8988 stack.push(("ScanSuppRates", last_off));
8989 break;
8990 }
8991 }
8992 Nl80211Attrs::HiddenSsid(val) => {
8993 if last_off == offset {
8994 stack.push(("HiddenSsid", last_off));
8995 break;
8996 }
8997 }
8998 Nl80211Attrs::IeProbeResp(val) => {
8999 if last_off == offset {
9000 stack.push(("IeProbeResp", last_off));
9001 break;
9002 }
9003 }
9004 Nl80211Attrs::IeAssocResp(val) => {
9005 if last_off == offset {
9006 stack.push(("IeAssocResp", last_off));
9007 break;
9008 }
9009 }
9010 Nl80211Attrs::StaWme(val) => {
9011 if last_off == offset {
9012 stack.push(("StaWme", last_off));
9013 break;
9014 }
9015 }
9016 Nl80211Attrs::SupportApUapsd(val) => {
9017 if last_off == offset {
9018 stack.push(("SupportApUapsd", last_off));
9019 break;
9020 }
9021 }
9022 Nl80211Attrs::RoamSupport(val) => {
9023 if last_off == offset {
9024 stack.push(("RoamSupport", last_off));
9025 break;
9026 }
9027 }
9028 Nl80211Attrs::SchedScanMatch(val) => {
9029 if last_off == offset {
9030 stack.push(("SchedScanMatch", last_off));
9031 break;
9032 }
9033 }
9034 Nl80211Attrs::MaxMatchSets(val) => {
9035 if last_off == offset {
9036 stack.push(("MaxMatchSets", last_off));
9037 break;
9038 }
9039 }
9040 Nl80211Attrs::PmksaCandidate(val) => {
9041 if last_off == offset {
9042 stack.push(("PmksaCandidate", last_off));
9043 break;
9044 }
9045 }
9046 Nl80211Attrs::TxNoCckRate(val) => {
9047 if last_off == offset {
9048 stack.push(("TxNoCckRate", last_off));
9049 break;
9050 }
9051 }
9052 Nl80211Attrs::TdlsAction(val) => {
9053 if last_off == offset {
9054 stack.push(("TdlsAction", last_off));
9055 break;
9056 }
9057 }
9058 Nl80211Attrs::TdlsDialogToken(val) => {
9059 if last_off == offset {
9060 stack.push(("TdlsDialogToken", last_off));
9061 break;
9062 }
9063 }
9064 Nl80211Attrs::TdlsOperation(val) => {
9065 if last_off == offset {
9066 stack.push(("TdlsOperation", last_off));
9067 break;
9068 }
9069 }
9070 Nl80211Attrs::TdlsSupport(val) => {
9071 if last_off == offset {
9072 stack.push(("TdlsSupport", last_off));
9073 break;
9074 }
9075 }
9076 Nl80211Attrs::TdlsExternalSetup(val) => {
9077 if last_off == offset {
9078 stack.push(("TdlsExternalSetup", last_off));
9079 break;
9080 }
9081 }
9082 Nl80211Attrs::DeviceApSme(val) => {
9083 if last_off == offset {
9084 stack.push(("DeviceApSme", last_off));
9085 break;
9086 }
9087 }
9088 Nl80211Attrs::DontWaitForAck(val) => {
9089 if last_off == offset {
9090 stack.push(("DontWaitForAck", last_off));
9091 break;
9092 }
9093 }
9094 Nl80211Attrs::FeatureFlags(val) => {
9095 if last_off == offset {
9096 stack.push(("FeatureFlags", last_off));
9097 break;
9098 }
9099 }
9100 Nl80211Attrs::ProbeRespOffload(val) => {
9101 if last_off == offset {
9102 stack.push(("ProbeRespOffload", last_off));
9103 break;
9104 }
9105 }
9106 Nl80211Attrs::ProbeResp(val) => {
9107 if last_off == offset {
9108 stack.push(("ProbeResp", last_off));
9109 break;
9110 }
9111 }
9112 Nl80211Attrs::DfsRegion(val) => {
9113 if last_off == offset {
9114 stack.push(("DfsRegion", last_off));
9115 break;
9116 }
9117 }
9118 Nl80211Attrs::DisableHt(val) => {
9119 if last_off == offset {
9120 stack.push(("DisableHt", last_off));
9121 break;
9122 }
9123 }
9124 Nl80211Attrs::HtCapabilityMask(val) => {
9125 if last_off == offset {
9126 stack.push(("HtCapabilityMask", last_off));
9127 break;
9128 }
9129 }
9130 Nl80211Attrs::NoackMap(val) => {
9131 if last_off == offset {
9132 stack.push(("NoackMap", last_off));
9133 break;
9134 }
9135 }
9136 Nl80211Attrs::InactivityTimeout(val) => {
9137 if last_off == offset {
9138 stack.push(("InactivityTimeout", last_off));
9139 break;
9140 }
9141 }
9142 Nl80211Attrs::RxSignalDbm(val) => {
9143 if last_off == offset {
9144 stack.push(("RxSignalDbm", last_off));
9145 break;
9146 }
9147 }
9148 Nl80211Attrs::BgScanPeriod(val) => {
9149 if last_off == offset {
9150 stack.push(("BgScanPeriod", last_off));
9151 break;
9152 }
9153 }
9154 Nl80211Attrs::Wdev(val) => {
9155 if last_off == offset {
9156 stack.push(("Wdev", last_off));
9157 break;
9158 }
9159 }
9160 Nl80211Attrs::UserRegHintType(val) => {
9161 if last_off == offset {
9162 stack.push(("UserRegHintType", last_off));
9163 break;
9164 }
9165 }
9166 Nl80211Attrs::ConnFailedReason(val) => {
9167 if last_off == offset {
9168 stack.push(("ConnFailedReason", last_off));
9169 break;
9170 }
9171 }
9172 Nl80211Attrs::AuthData(val) => {
9173 if last_off == offset {
9174 stack.push(("AuthData", last_off));
9175 break;
9176 }
9177 }
9178 Nl80211Attrs::VhtCapability(val) => {
9179 if last_off == offset {
9180 stack.push(("VhtCapability", last_off));
9181 break;
9182 }
9183 }
9184 Nl80211Attrs::ScanFlags(val) => {
9185 if last_off == offset {
9186 stack.push(("ScanFlags", last_off));
9187 break;
9188 }
9189 }
9190 Nl80211Attrs::ChannelWidth(val) => {
9191 if last_off == offset {
9192 stack.push(("ChannelWidth", last_off));
9193 break;
9194 }
9195 }
9196 Nl80211Attrs::CenterFreq1(val) => {
9197 if last_off == offset {
9198 stack.push(("CenterFreq1", last_off));
9199 break;
9200 }
9201 }
9202 Nl80211Attrs::CenterFreq2(val) => {
9203 if last_off == offset {
9204 stack.push(("CenterFreq2", last_off));
9205 break;
9206 }
9207 }
9208 Nl80211Attrs::P2pCtwindow(val) => {
9209 if last_off == offset {
9210 stack.push(("P2pCtwindow", last_off));
9211 break;
9212 }
9213 }
9214 Nl80211Attrs::P2pOppps(val) => {
9215 if last_off == offset {
9216 stack.push(("P2pOppps", last_off));
9217 break;
9218 }
9219 }
9220 Nl80211Attrs::LocalMeshPowerMode(val) => {
9221 if last_off == offset {
9222 stack.push(("LocalMeshPowerMode", last_off));
9223 break;
9224 }
9225 }
9226 Nl80211Attrs::AclPolicy(val) => {
9227 if last_off == offset {
9228 stack.push(("AclPolicy", last_off));
9229 break;
9230 }
9231 }
9232 Nl80211Attrs::MacAddrs(val) => {
9233 if last_off == offset {
9234 stack.push(("MacAddrs", last_off));
9235 break;
9236 }
9237 }
9238 Nl80211Attrs::MacAclMax(val) => {
9239 if last_off == offset {
9240 stack.push(("MacAclMax", last_off));
9241 break;
9242 }
9243 }
9244 Nl80211Attrs::RadarEvent(val) => {
9245 if last_off == offset {
9246 stack.push(("RadarEvent", last_off));
9247 break;
9248 }
9249 }
9250 Nl80211Attrs::ExtCapa(val) => {
9251 if last_off == offset {
9252 stack.push(("ExtCapa", last_off));
9253 break;
9254 }
9255 }
9256 Nl80211Attrs::ExtCapaMask(val) => {
9257 if last_off == offset {
9258 stack.push(("ExtCapaMask", last_off));
9259 break;
9260 }
9261 }
9262 Nl80211Attrs::StaCapability(val) => {
9263 if last_off == offset {
9264 stack.push(("StaCapability", last_off));
9265 break;
9266 }
9267 }
9268 Nl80211Attrs::StaExtCapability(val) => {
9269 if last_off == offset {
9270 stack.push(("StaExtCapability", last_off));
9271 break;
9272 }
9273 }
9274 Nl80211Attrs::ProtocolFeatures(val) => {
9275 if last_off == offset {
9276 stack.push(("ProtocolFeatures", last_off));
9277 break;
9278 }
9279 }
9280 Nl80211Attrs::SplitWiphyDump(val) => {
9281 if last_off == offset {
9282 stack.push(("SplitWiphyDump", last_off));
9283 break;
9284 }
9285 }
9286 Nl80211Attrs::DisableVht(val) => {
9287 if last_off == offset {
9288 stack.push(("DisableVht", last_off));
9289 break;
9290 }
9291 }
9292 Nl80211Attrs::VhtCapabilityMask(val) => {
9293 if last_off == offset {
9294 stack.push(("VhtCapabilityMask", last_off));
9295 break;
9296 }
9297 }
9298 Nl80211Attrs::Mdid(val) => {
9299 if last_off == offset {
9300 stack.push(("Mdid", last_off));
9301 break;
9302 }
9303 }
9304 Nl80211Attrs::IeRic(val) => {
9305 if last_off == offset {
9306 stack.push(("IeRic", last_off));
9307 break;
9308 }
9309 }
9310 Nl80211Attrs::CritProtId(val) => {
9311 if last_off == offset {
9312 stack.push(("CritProtId", last_off));
9313 break;
9314 }
9315 }
9316 Nl80211Attrs::MaxCritProtDuration(val) => {
9317 if last_off == offset {
9318 stack.push(("MaxCritProtDuration", last_off));
9319 break;
9320 }
9321 }
9322 Nl80211Attrs::PeerAid(val) => {
9323 if last_off == offset {
9324 stack.push(("PeerAid", last_off));
9325 break;
9326 }
9327 }
9328 Nl80211Attrs::CoalesceRule(val) => {
9329 if last_off == offset {
9330 stack.push(("CoalesceRule", last_off));
9331 break;
9332 }
9333 }
9334 Nl80211Attrs::ChSwitchCount(val) => {
9335 if last_off == offset {
9336 stack.push(("ChSwitchCount", last_off));
9337 break;
9338 }
9339 }
9340 Nl80211Attrs::ChSwitchBlockTx(val) => {
9341 if last_off == offset {
9342 stack.push(("ChSwitchBlockTx", last_off));
9343 break;
9344 }
9345 }
9346 Nl80211Attrs::CsaIes(val) => {
9347 if last_off == offset {
9348 stack.push(("CsaIes", last_off));
9349 break;
9350 }
9351 }
9352 Nl80211Attrs::CntdwnOffsBeacon(val) => {
9353 if last_off == offset {
9354 stack.push(("CntdwnOffsBeacon", last_off));
9355 break;
9356 }
9357 }
9358 Nl80211Attrs::CntdwnOffsPresp(val) => {
9359 if last_off == offset {
9360 stack.push(("CntdwnOffsPresp", last_off));
9361 break;
9362 }
9363 }
9364 Nl80211Attrs::RxmgmtFlags(val) => {
9365 if last_off == offset {
9366 stack.push(("RxmgmtFlags", last_off));
9367 break;
9368 }
9369 }
9370 Nl80211Attrs::StaSupportedChannels(val) => {
9371 if last_off == offset {
9372 stack.push(("StaSupportedChannels", last_off));
9373 break;
9374 }
9375 }
9376 Nl80211Attrs::StaSupportedOperClasses(val) => {
9377 if last_off == offset {
9378 stack.push(("StaSupportedOperClasses", last_off));
9379 break;
9380 }
9381 }
9382 Nl80211Attrs::HandleDfs(val) => {
9383 if last_off == offset {
9384 stack.push(("HandleDfs", last_off));
9385 break;
9386 }
9387 }
9388 Nl80211Attrs::Support5Mhz(val) => {
9389 if last_off == offset {
9390 stack.push(("Support5Mhz", last_off));
9391 break;
9392 }
9393 }
9394 Nl80211Attrs::Support10Mhz(val) => {
9395 if last_off == offset {
9396 stack.push(("Support10Mhz", last_off));
9397 break;
9398 }
9399 }
9400 Nl80211Attrs::OpmodeNotif(val) => {
9401 if last_off == offset {
9402 stack.push(("OpmodeNotif", last_off));
9403 break;
9404 }
9405 }
9406 Nl80211Attrs::VendorId(val) => {
9407 if last_off == offset {
9408 stack.push(("VendorId", last_off));
9409 break;
9410 }
9411 }
9412 Nl80211Attrs::VendorSubcmd(val) => {
9413 if last_off == offset {
9414 stack.push(("VendorSubcmd", last_off));
9415 break;
9416 }
9417 }
9418 Nl80211Attrs::VendorData(val) => {
9419 if last_off == offset {
9420 stack.push(("VendorData", last_off));
9421 break;
9422 }
9423 }
9424 Nl80211Attrs::VendorEvents(val) => {
9425 if last_off == offset {
9426 stack.push(("VendorEvents", last_off));
9427 break;
9428 }
9429 }
9430 Nl80211Attrs::QosMap(val) => {
9431 if last_off == offset {
9432 stack.push(("QosMap", last_off));
9433 break;
9434 }
9435 }
9436 Nl80211Attrs::MacHint(val) => {
9437 if last_off == offset {
9438 stack.push(("MacHint", last_off));
9439 break;
9440 }
9441 }
9442 Nl80211Attrs::WiphyFreqHint(val) => {
9443 if last_off == offset {
9444 stack.push(("WiphyFreqHint", last_off));
9445 break;
9446 }
9447 }
9448 Nl80211Attrs::MaxApAssocSta(val) => {
9449 if last_off == offset {
9450 stack.push(("MaxApAssocSta", last_off));
9451 break;
9452 }
9453 }
9454 Nl80211Attrs::TdlsPeerCapability(val) => {
9455 if last_off == offset {
9456 stack.push(("TdlsPeerCapability", last_off));
9457 break;
9458 }
9459 }
9460 Nl80211Attrs::SocketOwner(val) => {
9461 if last_off == offset {
9462 stack.push(("SocketOwner", last_off));
9463 break;
9464 }
9465 }
9466 Nl80211Attrs::CsaCOffsetsTx(val) => {
9467 if last_off == offset {
9468 stack.push(("CsaCOffsetsTx", last_off));
9469 break;
9470 }
9471 }
9472 Nl80211Attrs::MaxCsaCounters(val) => {
9473 if last_off == offset {
9474 stack.push(("MaxCsaCounters", last_off));
9475 break;
9476 }
9477 }
9478 Nl80211Attrs::TdlsInitiator(val) => {
9479 if last_off == offset {
9480 stack.push(("TdlsInitiator", last_off));
9481 break;
9482 }
9483 }
9484 Nl80211Attrs::UseRrm(val) => {
9485 if last_off == offset {
9486 stack.push(("UseRrm", last_off));
9487 break;
9488 }
9489 }
9490 Nl80211Attrs::WiphyDynAck(val) => {
9491 if last_off == offset {
9492 stack.push(("WiphyDynAck", last_off));
9493 break;
9494 }
9495 }
9496 Nl80211Attrs::Tsid(val) => {
9497 if last_off == offset {
9498 stack.push(("Tsid", last_off));
9499 break;
9500 }
9501 }
9502 Nl80211Attrs::UserPrio(val) => {
9503 if last_off == offset {
9504 stack.push(("UserPrio", last_off));
9505 break;
9506 }
9507 }
9508 Nl80211Attrs::AdmittedTime(val) => {
9509 if last_off == offset {
9510 stack.push(("AdmittedTime", last_off));
9511 break;
9512 }
9513 }
9514 Nl80211Attrs::SmpsMode(val) => {
9515 if last_off == offset {
9516 stack.push(("SmpsMode", last_off));
9517 break;
9518 }
9519 }
9520 Nl80211Attrs::OperClass(val) => {
9521 if last_off == offset {
9522 stack.push(("OperClass", last_off));
9523 break;
9524 }
9525 }
9526 Nl80211Attrs::MacMask(val) => {
9527 if last_off == offset {
9528 stack.push(("MacMask", last_off));
9529 break;
9530 }
9531 }
9532 Nl80211Attrs::WiphySelfManagedReg(val) => {
9533 if last_off == offset {
9534 stack.push(("WiphySelfManagedReg", last_off));
9535 break;
9536 }
9537 }
9538 Nl80211Attrs::ExtFeatures(val) => {
9539 if last_off == offset {
9540 stack.push(("ExtFeatures", last_off));
9541 break;
9542 }
9543 }
9544 Nl80211Attrs::SurveyRadioStats(val) => {
9545 if last_off == offset {
9546 stack.push(("SurveyRadioStats", last_off));
9547 break;
9548 }
9549 }
9550 Nl80211Attrs::NetnsFd(val) => {
9551 if last_off == offset {
9552 stack.push(("NetnsFd", last_off));
9553 break;
9554 }
9555 }
9556 Nl80211Attrs::SchedScanDelay(val) => {
9557 if last_off == offset {
9558 stack.push(("SchedScanDelay", last_off));
9559 break;
9560 }
9561 }
9562 Nl80211Attrs::RegIndoor(val) => {
9563 if last_off == offset {
9564 stack.push(("RegIndoor", last_off));
9565 break;
9566 }
9567 }
9568 Nl80211Attrs::MaxNumSchedScanPlans(val) => {
9569 if last_off == offset {
9570 stack.push(("MaxNumSchedScanPlans", last_off));
9571 break;
9572 }
9573 }
9574 Nl80211Attrs::MaxScanPlanInterval(val) => {
9575 if last_off == offset {
9576 stack.push(("MaxScanPlanInterval", last_off));
9577 break;
9578 }
9579 }
9580 Nl80211Attrs::MaxScanPlanIterations(val) => {
9581 if last_off == offset {
9582 stack.push(("MaxScanPlanIterations", last_off));
9583 break;
9584 }
9585 }
9586 Nl80211Attrs::SchedScanPlans(val) => {
9587 if last_off == offset {
9588 stack.push(("SchedScanPlans", last_off));
9589 break;
9590 }
9591 }
9592 Nl80211Attrs::Pbss(val) => {
9593 if last_off == offset {
9594 stack.push(("Pbss", last_off));
9595 break;
9596 }
9597 }
9598 Nl80211Attrs::BssSelect(val) => {
9599 if last_off == offset {
9600 stack.push(("BssSelect", last_off));
9601 break;
9602 }
9603 }
9604 Nl80211Attrs::StaSupportP2pPs(val) => {
9605 if last_off == offset {
9606 stack.push(("StaSupportP2pPs", last_off));
9607 break;
9608 }
9609 }
9610 Nl80211Attrs::Pad(val) => {
9611 if last_off == offset {
9612 stack.push(("Pad", last_off));
9613 break;
9614 }
9615 }
9616 Nl80211Attrs::IftypeExtCapa(val) => {
9617 if last_off == offset {
9618 stack.push(("IftypeExtCapa", last_off));
9619 break;
9620 }
9621 }
9622 Nl80211Attrs::MuMimoGroupData(val) => {
9623 if last_off == offset {
9624 stack.push(("MuMimoGroupData", last_off));
9625 break;
9626 }
9627 }
9628 Nl80211Attrs::MuMimoFollowMacAddr(val) => {
9629 if last_off == offset {
9630 stack.push(("MuMimoFollowMacAddr", last_off));
9631 break;
9632 }
9633 }
9634 Nl80211Attrs::ScanStartTimeTsf(val) => {
9635 if last_off == offset {
9636 stack.push(("ScanStartTimeTsf", last_off));
9637 break;
9638 }
9639 }
9640 Nl80211Attrs::ScanStartTimeTsfBssid(val) => {
9641 if last_off == offset {
9642 stack.push(("ScanStartTimeTsfBssid", last_off));
9643 break;
9644 }
9645 }
9646 Nl80211Attrs::MeasurementDuration(val) => {
9647 if last_off == offset {
9648 stack.push(("MeasurementDuration", last_off));
9649 break;
9650 }
9651 }
9652 Nl80211Attrs::MeasurementDurationMandatory(val) => {
9653 if last_off == offset {
9654 stack.push(("MeasurementDurationMandatory", last_off));
9655 break;
9656 }
9657 }
9658 Nl80211Attrs::MeshPeerAid(val) => {
9659 if last_off == offset {
9660 stack.push(("MeshPeerAid", last_off));
9661 break;
9662 }
9663 }
9664 Nl80211Attrs::NanMasterPref(val) => {
9665 if last_off == offset {
9666 stack.push(("NanMasterPref", last_off));
9667 break;
9668 }
9669 }
9670 Nl80211Attrs::Bands(val) => {
9671 if last_off == offset {
9672 stack.push(("Bands", last_off));
9673 break;
9674 }
9675 }
9676 Nl80211Attrs::NanFunc(val) => {
9677 if last_off == offset {
9678 stack.push(("NanFunc", last_off));
9679 break;
9680 }
9681 }
9682 Nl80211Attrs::NanMatch(val) => {
9683 if last_off == offset {
9684 stack.push(("NanMatch", last_off));
9685 break;
9686 }
9687 }
9688 Nl80211Attrs::FilsKek(val) => {
9689 if last_off == offset {
9690 stack.push(("FilsKek", last_off));
9691 break;
9692 }
9693 }
9694 Nl80211Attrs::FilsNonces(val) => {
9695 if last_off == offset {
9696 stack.push(("FilsNonces", last_off));
9697 break;
9698 }
9699 }
9700 Nl80211Attrs::MulticastToUnicastEnabled(val) => {
9701 if last_off == offset {
9702 stack.push(("MulticastToUnicastEnabled", last_off));
9703 break;
9704 }
9705 }
9706 Nl80211Attrs::Bssid(val) => {
9707 if last_off == offset {
9708 stack.push(("Bssid", last_off));
9709 break;
9710 }
9711 }
9712 Nl80211Attrs::SchedScanRelativeRssi(val) => {
9713 if last_off == offset {
9714 stack.push(("SchedScanRelativeRssi", last_off));
9715 break;
9716 }
9717 }
9718 Nl80211Attrs::SchedScanRssiAdjust(val) => {
9719 if last_off == offset {
9720 stack.push(("SchedScanRssiAdjust", last_off));
9721 break;
9722 }
9723 }
9724 Nl80211Attrs::TimeoutReason(val) => {
9725 if last_off == offset {
9726 stack.push(("TimeoutReason", last_off));
9727 break;
9728 }
9729 }
9730 Nl80211Attrs::FilsErpUsername(val) => {
9731 if last_off == offset {
9732 stack.push(("FilsErpUsername", last_off));
9733 break;
9734 }
9735 }
9736 Nl80211Attrs::FilsErpRealm(val) => {
9737 if last_off == offset {
9738 stack.push(("FilsErpRealm", last_off));
9739 break;
9740 }
9741 }
9742 Nl80211Attrs::FilsErpNextSeqNum(val) => {
9743 if last_off == offset {
9744 stack.push(("FilsErpNextSeqNum", last_off));
9745 break;
9746 }
9747 }
9748 Nl80211Attrs::FilsErpRrk(val) => {
9749 if last_off == offset {
9750 stack.push(("FilsErpRrk", last_off));
9751 break;
9752 }
9753 }
9754 Nl80211Attrs::FilsCacheId(val) => {
9755 if last_off == offset {
9756 stack.push(("FilsCacheId", last_off));
9757 break;
9758 }
9759 }
9760 Nl80211Attrs::Pmk(val) => {
9761 if last_off == offset {
9762 stack.push(("Pmk", last_off));
9763 break;
9764 }
9765 }
9766 Nl80211Attrs::SchedScanMulti(val) => {
9767 if last_off == offset {
9768 stack.push(("SchedScanMulti", last_off));
9769 break;
9770 }
9771 }
9772 Nl80211Attrs::SchedScanMaxReqs(val) => {
9773 if last_off == offset {
9774 stack.push(("SchedScanMaxReqs", last_off));
9775 break;
9776 }
9777 }
9778 Nl80211Attrs::Want1x4wayHs(val) => {
9779 if last_off == offset {
9780 stack.push(("Want1x4wayHs", last_off));
9781 break;
9782 }
9783 }
9784 Nl80211Attrs::Pmkr0Name(val) => {
9785 if last_off == offset {
9786 stack.push(("Pmkr0Name", last_off));
9787 break;
9788 }
9789 }
9790 Nl80211Attrs::PortAuthorized(val) => {
9791 if last_off == offset {
9792 stack.push(("PortAuthorized", last_off));
9793 break;
9794 }
9795 }
9796 Nl80211Attrs::ExternalAuthAction(val) => {
9797 if last_off == offset {
9798 stack.push(("ExternalAuthAction", last_off));
9799 break;
9800 }
9801 }
9802 Nl80211Attrs::ExternalAuthSupport(val) => {
9803 if last_off == offset {
9804 stack.push(("ExternalAuthSupport", last_off));
9805 break;
9806 }
9807 }
9808 Nl80211Attrs::Nss(val) => {
9809 if last_off == offset {
9810 stack.push(("Nss", last_off));
9811 break;
9812 }
9813 }
9814 Nl80211Attrs::AckSignal(val) => {
9815 if last_off == offset {
9816 stack.push(("AckSignal", last_off));
9817 break;
9818 }
9819 }
9820 Nl80211Attrs::ControlPortOverNl80211(val) => {
9821 if last_off == offset {
9822 stack.push(("ControlPortOverNl80211", last_off));
9823 break;
9824 }
9825 }
9826 Nl80211Attrs::TxqStats(val) => {
9827 (stack, missing) = val.lookup_attr(offset, missing_type);
9828 if !stack.is_empty() {
9829 break;
9830 }
9831 }
9832 Nl80211Attrs::TxqLimit(val) => {
9833 if last_off == offset {
9834 stack.push(("TxqLimit", last_off));
9835 break;
9836 }
9837 }
9838 Nl80211Attrs::TxqMemoryLimit(val) => {
9839 if last_off == offset {
9840 stack.push(("TxqMemoryLimit", last_off));
9841 break;
9842 }
9843 }
9844 Nl80211Attrs::TxqQuantum(val) => {
9845 if last_off == offset {
9846 stack.push(("TxqQuantum", last_off));
9847 break;
9848 }
9849 }
9850 Nl80211Attrs::HeCapability(val) => {
9851 if last_off == offset {
9852 stack.push(("HeCapability", last_off));
9853 break;
9854 }
9855 }
9856 Nl80211Attrs::FtmResponder(val) => {
9857 if last_off == offset {
9858 stack.push(("FtmResponder", last_off));
9859 break;
9860 }
9861 }
9862 Nl80211Attrs::FtmResponderStats(val) => {
9863 if last_off == offset {
9864 stack.push(("FtmResponderStats", last_off));
9865 break;
9866 }
9867 }
9868 Nl80211Attrs::Timeout(val) => {
9869 if last_off == offset {
9870 stack.push(("Timeout", last_off));
9871 break;
9872 }
9873 }
9874 Nl80211Attrs::PeerMeasurements(val) => {
9875 if last_off == offset {
9876 stack.push(("PeerMeasurements", last_off));
9877 break;
9878 }
9879 }
9880 Nl80211Attrs::AirtimeWeight(val) => {
9881 if last_off == offset {
9882 stack.push(("AirtimeWeight", last_off));
9883 break;
9884 }
9885 }
9886 Nl80211Attrs::StaTxPowerSetting(val) => {
9887 if last_off == offset {
9888 stack.push(("StaTxPowerSetting", last_off));
9889 break;
9890 }
9891 }
9892 Nl80211Attrs::StaTxPower(val) => {
9893 if last_off == offset {
9894 stack.push(("StaTxPower", last_off));
9895 break;
9896 }
9897 }
9898 Nl80211Attrs::SaePassword(val) => {
9899 if last_off == offset {
9900 stack.push(("SaePassword", last_off));
9901 break;
9902 }
9903 }
9904 Nl80211Attrs::TwtResponder(val) => {
9905 if last_off == offset {
9906 stack.push(("TwtResponder", last_off));
9907 break;
9908 }
9909 }
9910 Nl80211Attrs::HeObssPd(val) => {
9911 if last_off == offset {
9912 stack.push(("HeObssPd", last_off));
9913 break;
9914 }
9915 }
9916 Nl80211Attrs::WiphyEdmgChannels(val) => {
9917 if last_off == offset {
9918 stack.push(("WiphyEdmgChannels", last_off));
9919 break;
9920 }
9921 }
9922 Nl80211Attrs::WiphyEdmgBwConfig(val) => {
9923 if last_off == offset {
9924 stack.push(("WiphyEdmgBwConfig", last_off));
9925 break;
9926 }
9927 }
9928 Nl80211Attrs::VlanId(val) => {
9929 if last_off == offset {
9930 stack.push(("VlanId", last_off));
9931 break;
9932 }
9933 }
9934 Nl80211Attrs::HeBssColor(val) => {
9935 if last_off == offset {
9936 stack.push(("HeBssColor", last_off));
9937 break;
9938 }
9939 }
9940 Nl80211Attrs::IftypeAkmSuites(val) => {
9941 if last_off == offset {
9942 stack.push(("IftypeAkmSuites", last_off));
9943 break;
9944 }
9945 }
9946 Nl80211Attrs::TidConfig(val) => {
9947 if last_off == offset {
9948 stack.push(("TidConfig", last_off));
9949 break;
9950 }
9951 }
9952 Nl80211Attrs::ControlPortNoPreauth(val) => {
9953 if last_off == offset {
9954 stack.push(("ControlPortNoPreauth", last_off));
9955 break;
9956 }
9957 }
9958 Nl80211Attrs::PmkLifetime(val) => {
9959 if last_off == offset {
9960 stack.push(("PmkLifetime", last_off));
9961 break;
9962 }
9963 }
9964 Nl80211Attrs::PmkReauthThreshold(val) => {
9965 if last_off == offset {
9966 stack.push(("PmkReauthThreshold", last_off));
9967 break;
9968 }
9969 }
9970 Nl80211Attrs::ReceiveMulticast(val) => {
9971 if last_off == offset {
9972 stack.push(("ReceiveMulticast", last_off));
9973 break;
9974 }
9975 }
9976 Nl80211Attrs::WiphyFreqOffset(val) => {
9977 if last_off == offset {
9978 stack.push(("WiphyFreqOffset", last_off));
9979 break;
9980 }
9981 }
9982 Nl80211Attrs::CenterFreq1Offset(val) => {
9983 if last_off == offset {
9984 stack.push(("CenterFreq1Offset", last_off));
9985 break;
9986 }
9987 }
9988 Nl80211Attrs::ScanFreqKhz(val) => {
9989 if last_off == offset {
9990 stack.push(("ScanFreqKhz", last_off));
9991 break;
9992 }
9993 }
9994 Nl80211Attrs::He6ghzCapability(val) => {
9995 if last_off == offset {
9996 stack.push(("He6ghzCapability", last_off));
9997 break;
9998 }
9999 }
10000 Nl80211Attrs::FilsDiscovery(val) => {
10001 if last_off == offset {
10002 stack.push(("FilsDiscovery", last_off));
10003 break;
10004 }
10005 }
10006 Nl80211Attrs::UnsolBcastProbeResp(val) => {
10007 if last_off == offset {
10008 stack.push(("UnsolBcastProbeResp", last_off));
10009 break;
10010 }
10011 }
10012 Nl80211Attrs::S1gCapability(val) => {
10013 if last_off == offset {
10014 stack.push(("S1gCapability", last_off));
10015 break;
10016 }
10017 }
10018 Nl80211Attrs::S1gCapabilityMask(val) => {
10019 if last_off == offset {
10020 stack.push(("S1gCapabilityMask", last_off));
10021 break;
10022 }
10023 }
10024 Nl80211Attrs::SaePwe(val) => {
10025 if last_off == offset {
10026 stack.push(("SaePwe", last_off));
10027 break;
10028 }
10029 }
10030 Nl80211Attrs::ReconnectRequested(val) => {
10031 if last_off == offset {
10032 stack.push(("ReconnectRequested", last_off));
10033 break;
10034 }
10035 }
10036 Nl80211Attrs::SarSpec(val) => {
10037 (stack, missing) = val.lookup_attr(offset, missing_type);
10038 if !stack.is_empty() {
10039 break;
10040 }
10041 }
10042 Nl80211Attrs::DisableHe(val) => {
10043 if last_off == offset {
10044 stack.push(("DisableHe", last_off));
10045 break;
10046 }
10047 }
10048 Nl80211Attrs::ObssColorBitmap(val) => {
10049 if last_off == offset {
10050 stack.push(("ObssColorBitmap", last_off));
10051 break;
10052 }
10053 }
10054 Nl80211Attrs::ColorChangeCount(val) => {
10055 if last_off == offset {
10056 stack.push(("ColorChangeCount", last_off));
10057 break;
10058 }
10059 }
10060 Nl80211Attrs::ColorChangeColor(val) => {
10061 if last_off == offset {
10062 stack.push(("ColorChangeColor", last_off));
10063 break;
10064 }
10065 }
10066 Nl80211Attrs::ColorChangeElems(val) => {
10067 if last_off == offset {
10068 stack.push(("ColorChangeElems", last_off));
10069 break;
10070 }
10071 }
10072 Nl80211Attrs::MbssidConfig(val) => {
10073 if last_off == offset {
10074 stack.push(("MbssidConfig", last_off));
10075 break;
10076 }
10077 }
10078 Nl80211Attrs::MbssidElems(val) => {
10079 if last_off == offset {
10080 stack.push(("MbssidElems", last_off));
10081 break;
10082 }
10083 }
10084 Nl80211Attrs::RadarBackground(val) => {
10085 if last_off == offset {
10086 stack.push(("RadarBackground", last_off));
10087 break;
10088 }
10089 }
10090 Nl80211Attrs::ApSettingsFlags(val) => {
10091 if last_off == offset {
10092 stack.push(("ApSettingsFlags", last_off));
10093 break;
10094 }
10095 }
10096 Nl80211Attrs::EhtCapability(val) => {
10097 if last_off == offset {
10098 stack.push(("EhtCapability", last_off));
10099 break;
10100 }
10101 }
10102 Nl80211Attrs::DisableEht(val) => {
10103 if last_off == offset {
10104 stack.push(("DisableEht", last_off));
10105 break;
10106 }
10107 }
10108 Nl80211Attrs::MloLinks(val) => {
10109 if last_off == offset {
10110 stack.push(("MloLinks", last_off));
10111 break;
10112 }
10113 }
10114 Nl80211Attrs::MloLinkId(val) => {
10115 if last_off == offset {
10116 stack.push(("MloLinkId", last_off));
10117 break;
10118 }
10119 }
10120 Nl80211Attrs::MldAddr(val) => {
10121 if last_off == offset {
10122 stack.push(("MldAddr", last_off));
10123 break;
10124 }
10125 }
10126 Nl80211Attrs::MloSupport(val) => {
10127 if last_off == offset {
10128 stack.push(("MloSupport", last_off));
10129 break;
10130 }
10131 }
10132 Nl80211Attrs::MaxNumAkmSuites(val) => {
10133 if last_off == offset {
10134 stack.push(("MaxNumAkmSuites", last_off));
10135 break;
10136 }
10137 }
10138 Nl80211Attrs::EmlCapability(val) => {
10139 if last_off == offset {
10140 stack.push(("EmlCapability", last_off));
10141 break;
10142 }
10143 }
10144 Nl80211Attrs::MldCapaAndOps(val) => {
10145 if last_off == offset {
10146 stack.push(("MldCapaAndOps", last_off));
10147 break;
10148 }
10149 }
10150 Nl80211Attrs::TxHwTimestamp(val) => {
10151 if last_off == offset {
10152 stack.push(("TxHwTimestamp", last_off));
10153 break;
10154 }
10155 }
10156 Nl80211Attrs::RxHwTimestamp(val) => {
10157 if last_off == offset {
10158 stack.push(("RxHwTimestamp", last_off));
10159 break;
10160 }
10161 }
10162 Nl80211Attrs::TdBitmap(val) => {
10163 if last_off == offset {
10164 stack.push(("TdBitmap", last_off));
10165 break;
10166 }
10167 }
10168 Nl80211Attrs::PunctBitmap(val) => {
10169 if last_off == offset {
10170 stack.push(("PunctBitmap", last_off));
10171 break;
10172 }
10173 }
10174 Nl80211Attrs::MaxHwTimestampPeers(val) => {
10175 if last_off == offset {
10176 stack.push(("MaxHwTimestampPeers", last_off));
10177 break;
10178 }
10179 }
10180 Nl80211Attrs::HwTimestampEnabled(val) => {
10181 if last_off == offset {
10182 stack.push(("HwTimestampEnabled", last_off));
10183 break;
10184 }
10185 }
10186 Nl80211Attrs::EmaRnrElems(val) => {
10187 if last_off == offset {
10188 stack.push(("EmaRnrElems", last_off));
10189 break;
10190 }
10191 }
10192 Nl80211Attrs::MloLinkDisabled(val) => {
10193 if last_off == offset {
10194 stack.push(("MloLinkDisabled", last_off));
10195 break;
10196 }
10197 }
10198 Nl80211Attrs::BssDumpIncludeUseData(val) => {
10199 if last_off == offset {
10200 stack.push(("BssDumpIncludeUseData", last_off));
10201 break;
10202 }
10203 }
10204 Nl80211Attrs::MloTtlmDlink(val) => {
10205 if last_off == offset {
10206 stack.push(("MloTtlmDlink", last_off));
10207 break;
10208 }
10209 }
10210 Nl80211Attrs::MloTtlmUlink(val) => {
10211 if last_off == offset {
10212 stack.push(("MloTtlmUlink", last_off));
10213 break;
10214 }
10215 }
10216 Nl80211Attrs::AssocSppAmsdu(val) => {
10217 if last_off == offset {
10218 stack.push(("AssocSppAmsdu", last_off));
10219 break;
10220 }
10221 }
10222 Nl80211Attrs::WiphyRadios(val) => {
10223 if last_off == offset {
10224 stack.push(("WiphyRadios", last_off));
10225 break;
10226 }
10227 }
10228 Nl80211Attrs::WiphyInterfaceCombinations(val) => {
10229 if last_off == offset {
10230 stack.push(("WiphyInterfaceCombinations", last_off));
10231 break;
10232 }
10233 }
10234 Nl80211Attrs::VifRadioMask(val) => {
10235 if last_off == offset {
10236 stack.push(("VifRadioMask", last_off));
10237 break;
10238 }
10239 }
10240 _ => {}
10241 };
10242 last_off = cur + attrs.pos;
10243 }
10244 if !stack.is_empty() {
10245 stack.push(("Nl80211Attrs", cur));
10246 }
10247 (stack, missing)
10248 }
10249}
10250#[derive(Clone)]
10251pub enum FrameTypeAttrs {
10252 FrameType(u16),
10253}
10254impl<'a> IterableFrameTypeAttrs<'a> {
10255 pub fn get_frame_type(&self) -> Result<u16, ErrorContext> {
10256 let mut iter = self.clone();
10257 iter.pos = 0;
10258 for attr in iter {
10259 if let Ok(FrameTypeAttrs::FrameType(val)) = attr {
10260 return Ok(val);
10261 }
10262 }
10263 Err(ErrorContext::new_missing(
10264 "FrameTypeAttrs",
10265 "FrameType",
10266 self.orig_loc,
10267 self.buf.as_ptr() as usize,
10268 ))
10269 }
10270}
10271impl FrameTypeAttrs {
10272 pub fn new<'a>(buf: &'a [u8]) -> IterableFrameTypeAttrs<'a> {
10273 IterableFrameTypeAttrs::with_loc(buf, buf.as_ptr() as usize)
10274 }
10275 fn attr_from_type(r#type: u16) -> Option<&'static str> {
10276 Nl80211Attrs::attr_from_type(r#type)
10277 }
10278}
10279#[derive(Clone, Copy, Default)]
10280pub struct IterableFrameTypeAttrs<'a> {
10281 buf: &'a [u8],
10282 pos: usize,
10283 orig_loc: usize,
10284}
10285impl<'a> IterableFrameTypeAttrs<'a> {
10286 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10287 Self {
10288 buf,
10289 pos: 0,
10290 orig_loc,
10291 }
10292 }
10293 pub fn get_buf(&self) -> &'a [u8] {
10294 self.buf
10295 }
10296}
10297impl<'a> Iterator for IterableFrameTypeAttrs<'a> {
10298 type Item = Result<FrameTypeAttrs, ErrorContext>;
10299 fn next(&mut self) -> Option<Self::Item> {
10300 let mut pos;
10301 let mut r#type;
10302 loop {
10303 pos = self.pos;
10304 r#type = None;
10305 if self.buf.len() == self.pos {
10306 return None;
10307 }
10308 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
10309 self.pos = self.buf.len();
10310 break;
10311 };
10312 r#type = Some(header.r#type);
10313 let res = match header.r#type {
10314 101u16 => FrameTypeAttrs::FrameType({
10315 let res = parse_u16(next);
10316 let Some(val) = res else { break };
10317 val
10318 }),
10319 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
10320 n => continue,
10321 };
10322 return Some(Ok(res));
10323 }
10324 Some(Err(ErrorContext::new(
10325 "FrameTypeAttrs",
10326 r#type.and_then(|t| FrameTypeAttrs::attr_from_type(t)),
10327 self.orig_loc,
10328 self.buf.as_ptr().wrapping_add(pos) as usize,
10329 )))
10330 }
10331}
10332impl std::fmt::Debug for IterableFrameTypeAttrs<'_> {
10333 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10334 let mut fmt = f.debug_struct("FrameTypeAttrs");
10335 for attr in self.clone() {
10336 let attr = match attr {
10337 Ok(a) => a,
10338 Err(err) => {
10339 fmt.finish()?;
10340 f.write_str("Err(")?;
10341 err.fmt(f)?;
10342 return f.write_str(")");
10343 }
10344 };
10345 match attr {
10346 FrameTypeAttrs::FrameType(val) => fmt.field("FrameType", &val),
10347 };
10348 }
10349 fmt.finish()
10350 }
10351}
10352impl IterableFrameTypeAttrs<'_> {
10353 pub fn lookup_attr(
10354 &self,
10355 offset: usize,
10356 missing_type: Option<u16>,
10357 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
10358 let mut stack = Vec::new();
10359 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
10360 if missing_type.is_some() && cur == offset {
10361 stack.push(("FrameTypeAttrs", offset));
10362 return (
10363 stack,
10364 missing_type.and_then(|t| FrameTypeAttrs::attr_from_type(t)),
10365 );
10366 }
10367 if cur > offset || cur + self.buf.len() < offset {
10368 return (stack, None);
10369 }
10370 let mut attrs = self.clone();
10371 let mut last_off = cur + attrs.pos;
10372 while let Some(attr) = attrs.next() {
10373 let Ok(attr) = attr else { break };
10374 match attr {
10375 FrameTypeAttrs::FrameType(val) => {
10376 if last_off == offset {
10377 stack.push(("FrameType", last_off));
10378 break;
10379 }
10380 }
10381 _ => {}
10382 };
10383 last_off = cur + attrs.pos;
10384 }
10385 if !stack.is_empty() {
10386 stack.push(("FrameTypeAttrs", cur));
10387 }
10388 (stack, None)
10389 }
10390}
10391#[derive(Clone)]
10392pub enum WiphyBands<'a> {
10393 #[doc = "2.4 GHz ISM band\n"]
10394 _2ghz(IterableBandAttrs<'a>),
10395 #[doc = "around 5 GHz band (4.9 - 5.7 GHz)\n"]
10396 _5ghz(IterableBandAttrs<'a>),
10397 #[doc = "around 60 GHz band (58.32 - 69.12 GHz)\n"]
10398 _60ghz(IterableBandAttrs<'a>),
10399 _6ghz(IterableBandAttrs<'a>),
10400 S1ghz(IterableBandAttrs<'a>),
10401 Lc(IterableBandAttrs<'a>),
10402}
10403impl<'a> IterableWiphyBands<'a> {
10404 #[doc = "2.4 GHz ISM band\n"]
10405 pub fn get_2ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10406 let mut iter = self.clone();
10407 iter.pos = 0;
10408 for attr in iter {
10409 if let Ok(WiphyBands::_2ghz(val)) = attr {
10410 return Ok(val);
10411 }
10412 }
10413 Err(ErrorContext::new_missing(
10414 "WiphyBands",
10415 "2ghz",
10416 self.orig_loc,
10417 self.buf.as_ptr() as usize,
10418 ))
10419 }
10420 #[doc = "around 5 GHz band (4.9 - 5.7 GHz)\n"]
10421 pub fn get_5ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10422 let mut iter = self.clone();
10423 iter.pos = 0;
10424 for attr in iter {
10425 if let Ok(WiphyBands::_5ghz(val)) = attr {
10426 return Ok(val);
10427 }
10428 }
10429 Err(ErrorContext::new_missing(
10430 "WiphyBands",
10431 "5ghz",
10432 self.orig_loc,
10433 self.buf.as_ptr() as usize,
10434 ))
10435 }
10436 #[doc = "around 60 GHz band (58.32 - 69.12 GHz)\n"]
10437 pub fn get_60ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10438 let mut iter = self.clone();
10439 iter.pos = 0;
10440 for attr in iter {
10441 if let Ok(WiphyBands::_60ghz(val)) = attr {
10442 return Ok(val);
10443 }
10444 }
10445 Err(ErrorContext::new_missing(
10446 "WiphyBands",
10447 "60ghz",
10448 self.orig_loc,
10449 self.buf.as_ptr() as usize,
10450 ))
10451 }
10452 pub fn get_6ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10453 let mut iter = self.clone();
10454 iter.pos = 0;
10455 for attr in iter {
10456 if let Ok(WiphyBands::_6ghz(val)) = attr {
10457 return Ok(val);
10458 }
10459 }
10460 Err(ErrorContext::new_missing(
10461 "WiphyBands",
10462 "6ghz",
10463 self.orig_loc,
10464 self.buf.as_ptr() as usize,
10465 ))
10466 }
10467 pub fn get_s1ghz(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10468 let mut iter = self.clone();
10469 iter.pos = 0;
10470 for attr in iter {
10471 if let Ok(WiphyBands::S1ghz(val)) = attr {
10472 return Ok(val);
10473 }
10474 }
10475 Err(ErrorContext::new_missing(
10476 "WiphyBands",
10477 "S1ghz",
10478 self.orig_loc,
10479 self.buf.as_ptr() as usize,
10480 ))
10481 }
10482 pub fn get_lc(&self) -> Result<IterableBandAttrs<'a>, ErrorContext> {
10483 let mut iter = self.clone();
10484 iter.pos = 0;
10485 for attr in iter {
10486 if let Ok(WiphyBands::Lc(val)) = attr {
10487 return Ok(val);
10488 }
10489 }
10490 Err(ErrorContext::new_missing(
10491 "WiphyBands",
10492 "Lc",
10493 self.orig_loc,
10494 self.buf.as_ptr() as usize,
10495 ))
10496 }
10497}
10498impl WiphyBands<'_> {
10499 pub fn new<'a>(buf: &'a [u8]) -> IterableWiphyBands<'a> {
10500 IterableWiphyBands::with_loc(buf, buf.as_ptr() as usize)
10501 }
10502 fn attr_from_type(r#type: u16) -> Option<&'static str> {
10503 let res = match r#type {
10504 0u16 => "2ghz",
10505 1u16 => "5ghz",
10506 2u16 => "60ghz",
10507 3u16 => "6ghz",
10508 4u16 => "S1ghz",
10509 5u16 => "Lc",
10510 _ => return None,
10511 };
10512 Some(res)
10513 }
10514}
10515#[derive(Clone, Copy, Default)]
10516pub struct IterableWiphyBands<'a> {
10517 buf: &'a [u8],
10518 pos: usize,
10519 orig_loc: usize,
10520}
10521impl<'a> IterableWiphyBands<'a> {
10522 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10523 Self {
10524 buf,
10525 pos: 0,
10526 orig_loc,
10527 }
10528 }
10529 pub fn get_buf(&self) -> &'a [u8] {
10530 self.buf
10531 }
10532}
10533impl<'a> Iterator for IterableWiphyBands<'a> {
10534 type Item = Result<WiphyBands<'a>, ErrorContext>;
10535 fn next(&mut self) -> Option<Self::Item> {
10536 let mut pos;
10537 let mut r#type;
10538 loop {
10539 pos = self.pos;
10540 r#type = None;
10541 if self.buf.len() == self.pos {
10542 return None;
10543 }
10544 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
10545 self.pos = self.buf.len();
10546 break;
10547 };
10548 r#type = Some(header.r#type);
10549 let res = match header.r#type {
10550 0u16 => WiphyBands::_2ghz({
10551 let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10552 let Some(val) = res else { break };
10553 val
10554 }),
10555 1u16 => WiphyBands::_5ghz({
10556 let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10557 let Some(val) = res else { break };
10558 val
10559 }),
10560 2u16 => WiphyBands::_60ghz({
10561 let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10562 let Some(val) = res else { break };
10563 val
10564 }),
10565 3u16 => WiphyBands::_6ghz({
10566 let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10567 let Some(val) = res else { break };
10568 val
10569 }),
10570 4u16 => WiphyBands::S1ghz({
10571 let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10572 let Some(val) = res else { break };
10573 val
10574 }),
10575 5u16 => WiphyBands::Lc({
10576 let res = Some(IterableBandAttrs::with_loc(next, self.orig_loc));
10577 let Some(val) = res else { break };
10578 val
10579 }),
10580 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
10581 n => continue,
10582 };
10583 return Some(Ok(res));
10584 }
10585 Some(Err(ErrorContext::new(
10586 "WiphyBands",
10587 r#type.and_then(|t| WiphyBands::attr_from_type(t)),
10588 self.orig_loc,
10589 self.buf.as_ptr().wrapping_add(pos) as usize,
10590 )))
10591 }
10592}
10593impl<'a> std::fmt::Debug for IterableWiphyBands<'_> {
10594 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10595 let mut fmt = f.debug_struct("WiphyBands");
10596 for attr in self.clone() {
10597 let attr = match attr {
10598 Ok(a) => a,
10599 Err(err) => {
10600 fmt.finish()?;
10601 f.write_str("Err(")?;
10602 err.fmt(f)?;
10603 return f.write_str(")");
10604 }
10605 };
10606 match attr {
10607 WiphyBands::_2ghz(val) => fmt.field("_2ghz", &val),
10608 WiphyBands::_5ghz(val) => fmt.field("_5ghz", &val),
10609 WiphyBands::_60ghz(val) => fmt.field("_60ghz", &val),
10610 WiphyBands::_6ghz(val) => fmt.field("_6ghz", &val),
10611 WiphyBands::S1ghz(val) => fmt.field("S1ghz", &val),
10612 WiphyBands::Lc(val) => fmt.field("Lc", &val),
10613 };
10614 }
10615 fmt.finish()
10616 }
10617}
10618impl IterableWiphyBands<'_> {
10619 pub fn lookup_attr(
10620 &self,
10621 offset: usize,
10622 missing_type: Option<u16>,
10623 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
10624 let mut stack = Vec::new();
10625 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
10626 if missing_type.is_some() && cur == offset {
10627 stack.push(("WiphyBands", offset));
10628 return (
10629 stack,
10630 missing_type.and_then(|t| WiphyBands::attr_from_type(t)),
10631 );
10632 }
10633 if cur > offset || cur + self.buf.len() < offset {
10634 return (stack, None);
10635 }
10636 let mut attrs = self.clone();
10637 let mut last_off = cur + attrs.pos;
10638 let mut missing = None;
10639 while let Some(attr) = attrs.next() {
10640 let Ok(attr) = attr else { break };
10641 match attr {
10642 WiphyBands::_2ghz(val) => {
10643 (stack, missing) = val.lookup_attr(offset, missing_type);
10644 if !stack.is_empty() {
10645 break;
10646 }
10647 }
10648 WiphyBands::_5ghz(val) => {
10649 (stack, missing) = val.lookup_attr(offset, missing_type);
10650 if !stack.is_empty() {
10651 break;
10652 }
10653 }
10654 WiphyBands::_60ghz(val) => {
10655 (stack, missing) = val.lookup_attr(offset, missing_type);
10656 if !stack.is_empty() {
10657 break;
10658 }
10659 }
10660 WiphyBands::_6ghz(val) => {
10661 (stack, missing) = val.lookup_attr(offset, missing_type);
10662 if !stack.is_empty() {
10663 break;
10664 }
10665 }
10666 WiphyBands::S1ghz(val) => {
10667 (stack, missing) = val.lookup_attr(offset, missing_type);
10668 if !stack.is_empty() {
10669 break;
10670 }
10671 }
10672 WiphyBands::Lc(val) => {
10673 (stack, missing) = val.lookup_attr(offset, missing_type);
10674 if !stack.is_empty() {
10675 break;
10676 }
10677 }
10678 _ => {}
10679 };
10680 last_off = cur + attrs.pos;
10681 }
10682 if !stack.is_empty() {
10683 stack.push(("WiphyBands", cur));
10684 }
10685 (stack, missing)
10686 }
10687}
10688#[derive(Clone)]
10689pub enum BandAttrs<'a> {
10690 Freqs(IterableArrayFrequencyAttrs<'a>),
10691 Rates(IterableArrayBitrateAttrs<'a>),
10692 HtMcsSet(&'a [u8]),
10693 HtCapa(u16),
10694 HtAmpduFactor(u8),
10695 HtAmpduDensity(u8),
10696 VhtMcsSet(&'a [u8]),
10697 VhtCapa(u32),
10698 IftypeData(IterableArrayIftypeDataAttrs<'a>),
10699 EdmgChannels(&'a [u8]),
10700 EdmgBwConfig(&'a [u8]),
10701 S1gMcsNssSet(&'a [u8]),
10702 S1gCapa(&'a [u8]),
10703}
10704impl<'a> IterableBandAttrs<'a> {
10705 pub fn get_freqs(
10706 &self,
10707 ) -> Result<
10708 ArrayIterable<IterableArrayFrequencyAttrs<'a>, IterableFrequencyAttrs<'a>>,
10709 ErrorContext,
10710 > {
10711 for attr in self.clone() {
10712 if let Ok(BandAttrs::Freqs(val)) = attr {
10713 return Ok(ArrayIterable::new(val));
10714 }
10715 }
10716 Err(ErrorContext::new_missing(
10717 "BandAttrs",
10718 "Freqs",
10719 self.orig_loc,
10720 self.buf.as_ptr() as usize,
10721 ))
10722 }
10723 pub fn get_rates(
10724 &self,
10725 ) -> Result<ArrayIterable<IterableArrayBitrateAttrs<'a>, IterableBitrateAttrs<'a>>, ErrorContext>
10726 {
10727 for attr in self.clone() {
10728 if let Ok(BandAttrs::Rates(val)) = attr {
10729 return Ok(ArrayIterable::new(val));
10730 }
10731 }
10732 Err(ErrorContext::new_missing(
10733 "BandAttrs",
10734 "Rates",
10735 self.orig_loc,
10736 self.buf.as_ptr() as usize,
10737 ))
10738 }
10739 pub fn get_ht_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
10740 let mut iter = self.clone();
10741 iter.pos = 0;
10742 for attr in iter {
10743 if let Ok(BandAttrs::HtMcsSet(val)) = attr {
10744 return Ok(val);
10745 }
10746 }
10747 Err(ErrorContext::new_missing(
10748 "BandAttrs",
10749 "HtMcsSet",
10750 self.orig_loc,
10751 self.buf.as_ptr() as usize,
10752 ))
10753 }
10754 pub fn get_ht_capa(&self) -> Result<u16, ErrorContext> {
10755 let mut iter = self.clone();
10756 iter.pos = 0;
10757 for attr in iter {
10758 if let Ok(BandAttrs::HtCapa(val)) = attr {
10759 return Ok(val);
10760 }
10761 }
10762 Err(ErrorContext::new_missing(
10763 "BandAttrs",
10764 "HtCapa",
10765 self.orig_loc,
10766 self.buf.as_ptr() as usize,
10767 ))
10768 }
10769 pub fn get_ht_ampdu_factor(&self) -> Result<u8, ErrorContext> {
10770 let mut iter = self.clone();
10771 iter.pos = 0;
10772 for attr in iter {
10773 if let Ok(BandAttrs::HtAmpduFactor(val)) = attr {
10774 return Ok(val);
10775 }
10776 }
10777 Err(ErrorContext::new_missing(
10778 "BandAttrs",
10779 "HtAmpduFactor",
10780 self.orig_loc,
10781 self.buf.as_ptr() as usize,
10782 ))
10783 }
10784 pub fn get_ht_ampdu_density(&self) -> Result<u8, ErrorContext> {
10785 let mut iter = self.clone();
10786 iter.pos = 0;
10787 for attr in iter {
10788 if let Ok(BandAttrs::HtAmpduDensity(val)) = attr {
10789 return Ok(val);
10790 }
10791 }
10792 Err(ErrorContext::new_missing(
10793 "BandAttrs",
10794 "HtAmpduDensity",
10795 self.orig_loc,
10796 self.buf.as_ptr() as usize,
10797 ))
10798 }
10799 pub fn get_vht_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
10800 let mut iter = self.clone();
10801 iter.pos = 0;
10802 for attr in iter {
10803 if let Ok(BandAttrs::VhtMcsSet(val)) = attr {
10804 return Ok(val);
10805 }
10806 }
10807 Err(ErrorContext::new_missing(
10808 "BandAttrs",
10809 "VhtMcsSet",
10810 self.orig_loc,
10811 self.buf.as_ptr() as usize,
10812 ))
10813 }
10814 pub fn get_vht_capa(&self) -> Result<u32, ErrorContext> {
10815 let mut iter = self.clone();
10816 iter.pos = 0;
10817 for attr in iter {
10818 if let Ok(BandAttrs::VhtCapa(val)) = attr {
10819 return Ok(val);
10820 }
10821 }
10822 Err(ErrorContext::new_missing(
10823 "BandAttrs",
10824 "VhtCapa",
10825 self.orig_loc,
10826 self.buf.as_ptr() as usize,
10827 ))
10828 }
10829 pub fn get_iftype_data(
10830 &self,
10831 ) -> Result<
10832 ArrayIterable<IterableArrayIftypeDataAttrs<'a>, IterableIftypeDataAttrs<'a>>,
10833 ErrorContext,
10834 > {
10835 for attr in self.clone() {
10836 if let Ok(BandAttrs::IftypeData(val)) = attr {
10837 return Ok(ArrayIterable::new(val));
10838 }
10839 }
10840 Err(ErrorContext::new_missing(
10841 "BandAttrs",
10842 "IftypeData",
10843 self.orig_loc,
10844 self.buf.as_ptr() as usize,
10845 ))
10846 }
10847 pub fn get_edmg_channels(&self) -> Result<&'a [u8], ErrorContext> {
10848 let mut iter = self.clone();
10849 iter.pos = 0;
10850 for attr in iter {
10851 if let Ok(BandAttrs::EdmgChannels(val)) = attr {
10852 return Ok(val);
10853 }
10854 }
10855 Err(ErrorContext::new_missing(
10856 "BandAttrs",
10857 "EdmgChannels",
10858 self.orig_loc,
10859 self.buf.as_ptr() as usize,
10860 ))
10861 }
10862 pub fn get_edmg_bw_config(&self) -> Result<&'a [u8], ErrorContext> {
10863 let mut iter = self.clone();
10864 iter.pos = 0;
10865 for attr in iter {
10866 if let Ok(BandAttrs::EdmgBwConfig(val)) = attr {
10867 return Ok(val);
10868 }
10869 }
10870 Err(ErrorContext::new_missing(
10871 "BandAttrs",
10872 "EdmgBwConfig",
10873 self.orig_loc,
10874 self.buf.as_ptr() as usize,
10875 ))
10876 }
10877 pub fn get_s1g_mcs_nss_set(&self) -> Result<&'a [u8], ErrorContext> {
10878 let mut iter = self.clone();
10879 iter.pos = 0;
10880 for attr in iter {
10881 if let Ok(BandAttrs::S1gMcsNssSet(val)) = attr {
10882 return Ok(val);
10883 }
10884 }
10885 Err(ErrorContext::new_missing(
10886 "BandAttrs",
10887 "S1gMcsNssSet",
10888 self.orig_loc,
10889 self.buf.as_ptr() as usize,
10890 ))
10891 }
10892 pub fn get_s1g_capa(&self) -> Result<&'a [u8], ErrorContext> {
10893 let mut iter = self.clone();
10894 iter.pos = 0;
10895 for attr in iter {
10896 if let Ok(BandAttrs::S1gCapa(val)) = attr {
10897 return Ok(val);
10898 }
10899 }
10900 Err(ErrorContext::new_missing(
10901 "BandAttrs",
10902 "S1gCapa",
10903 self.orig_loc,
10904 self.buf.as_ptr() as usize,
10905 ))
10906 }
10907}
10908impl<'a> FrequencyAttrs<'a> {
10909 pub fn new_array(buf: &[u8]) -> IterableArrayFrequencyAttrs<'_> {
10910 IterableArrayFrequencyAttrs::with_loc(buf, buf.as_ptr() as usize)
10911 }
10912}
10913#[derive(Clone, Copy, Default)]
10914pub struct IterableArrayFrequencyAttrs<'a> {
10915 buf: &'a [u8],
10916 pos: usize,
10917 orig_loc: usize,
10918}
10919impl<'a> IterableArrayFrequencyAttrs<'a> {
10920 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10921 Self {
10922 buf,
10923 pos: 0,
10924 orig_loc,
10925 }
10926 }
10927 pub fn get_buf(&self) -> &'a [u8] {
10928 self.buf
10929 }
10930}
10931impl<'a> Iterator for IterableArrayFrequencyAttrs<'a> {
10932 type Item = Result<IterableFrequencyAttrs<'a>, ErrorContext>;
10933 fn next(&mut self) -> Option<Self::Item> {
10934 if self.buf.len() == self.pos {
10935 return None;
10936 }
10937 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
10938 {
10939 return Some(Ok(IterableFrequencyAttrs::with_loc(next, self.orig_loc)));
10940 }
10941 }
10942 let pos = self.pos;
10943 self.pos = self.buf.len();
10944 Some(Err(ErrorContext::new(
10945 "FrequencyAttrs",
10946 None,
10947 self.orig_loc,
10948 self.buf.as_ptr().wrapping_add(pos) as usize,
10949 )))
10950 }
10951}
10952impl BitrateAttrs {
10953 pub fn new_array(buf: &[u8]) -> IterableArrayBitrateAttrs<'_> {
10954 IterableArrayBitrateAttrs::with_loc(buf, buf.as_ptr() as usize)
10955 }
10956}
10957#[derive(Clone, Copy, Default)]
10958pub struct IterableArrayBitrateAttrs<'a> {
10959 buf: &'a [u8],
10960 pos: usize,
10961 orig_loc: usize,
10962}
10963impl<'a> IterableArrayBitrateAttrs<'a> {
10964 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
10965 Self {
10966 buf,
10967 pos: 0,
10968 orig_loc,
10969 }
10970 }
10971 pub fn get_buf(&self) -> &'a [u8] {
10972 self.buf
10973 }
10974}
10975impl<'a> Iterator for IterableArrayBitrateAttrs<'a> {
10976 type Item = Result<IterableBitrateAttrs<'a>, ErrorContext>;
10977 fn next(&mut self) -> Option<Self::Item> {
10978 if self.buf.len() == self.pos {
10979 return None;
10980 }
10981 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
10982 {
10983 return Some(Ok(IterableBitrateAttrs::with_loc(next, self.orig_loc)));
10984 }
10985 }
10986 let pos = self.pos;
10987 self.pos = self.buf.len();
10988 Some(Err(ErrorContext::new(
10989 "BitrateAttrs",
10990 None,
10991 self.orig_loc,
10992 self.buf.as_ptr().wrapping_add(pos) as usize,
10993 )))
10994 }
10995}
10996impl<'a> IftypeDataAttrs<'a> {
10997 pub fn new_array(buf: &[u8]) -> IterableArrayIftypeDataAttrs<'_> {
10998 IterableArrayIftypeDataAttrs::with_loc(buf, buf.as_ptr() as usize)
10999 }
11000}
11001#[derive(Clone, Copy, Default)]
11002pub struct IterableArrayIftypeDataAttrs<'a> {
11003 buf: &'a [u8],
11004 pos: usize,
11005 orig_loc: usize,
11006}
11007impl<'a> IterableArrayIftypeDataAttrs<'a> {
11008 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
11009 Self {
11010 buf,
11011 pos: 0,
11012 orig_loc,
11013 }
11014 }
11015 pub fn get_buf(&self) -> &'a [u8] {
11016 self.buf
11017 }
11018}
11019impl<'a> Iterator for IterableArrayIftypeDataAttrs<'a> {
11020 type Item = Result<IterableIftypeDataAttrs<'a>, ErrorContext>;
11021 fn next(&mut self) -> Option<Self::Item> {
11022 if self.buf.len() == self.pos {
11023 return None;
11024 }
11025 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
11026 {
11027 return Some(Ok(IterableIftypeDataAttrs::with_loc(next, self.orig_loc)));
11028 }
11029 }
11030 let pos = self.pos;
11031 self.pos = self.buf.len();
11032 Some(Err(ErrorContext::new(
11033 "IftypeDataAttrs",
11034 None,
11035 self.orig_loc,
11036 self.buf.as_ptr().wrapping_add(pos) as usize,
11037 )))
11038 }
11039}
11040impl BandAttrs<'_> {
11041 pub fn new<'a>(buf: &'a [u8]) -> IterableBandAttrs<'a> {
11042 IterableBandAttrs::with_loc(buf, buf.as_ptr() as usize)
11043 }
11044 fn attr_from_type(r#type: u16) -> Option<&'static str> {
11045 let res = match r#type {
11046 1u16 => "Freqs",
11047 2u16 => "Rates",
11048 3u16 => "HtMcsSet",
11049 4u16 => "HtCapa",
11050 5u16 => "HtAmpduFactor",
11051 6u16 => "HtAmpduDensity",
11052 7u16 => "VhtMcsSet",
11053 8u16 => "VhtCapa",
11054 9u16 => "IftypeData",
11055 10u16 => "EdmgChannels",
11056 11u16 => "EdmgBwConfig",
11057 12u16 => "S1gMcsNssSet",
11058 13u16 => "S1gCapa",
11059 _ => return None,
11060 };
11061 Some(res)
11062 }
11063}
11064#[derive(Clone, Copy, Default)]
11065pub struct IterableBandAttrs<'a> {
11066 buf: &'a [u8],
11067 pos: usize,
11068 orig_loc: usize,
11069}
11070impl<'a> IterableBandAttrs<'a> {
11071 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
11072 Self {
11073 buf,
11074 pos: 0,
11075 orig_loc,
11076 }
11077 }
11078 pub fn get_buf(&self) -> &'a [u8] {
11079 self.buf
11080 }
11081}
11082impl<'a> Iterator for IterableBandAttrs<'a> {
11083 type Item = Result<BandAttrs<'a>, ErrorContext>;
11084 fn next(&mut self) -> Option<Self::Item> {
11085 let mut pos;
11086 let mut r#type;
11087 loop {
11088 pos = self.pos;
11089 r#type = None;
11090 if self.buf.len() == self.pos {
11091 return None;
11092 }
11093 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
11094 self.pos = self.buf.len();
11095 break;
11096 };
11097 r#type = Some(header.r#type);
11098 let res = match header.r#type {
11099 1u16 => BandAttrs::Freqs({
11100 let res = Some(IterableArrayFrequencyAttrs::with_loc(next, self.orig_loc));
11101 let Some(val) = res else { break };
11102 val
11103 }),
11104 2u16 => BandAttrs::Rates({
11105 let res = Some(IterableArrayBitrateAttrs::with_loc(next, self.orig_loc));
11106 let Some(val) = res else { break };
11107 val
11108 }),
11109 3u16 => BandAttrs::HtMcsSet({
11110 let res = Some(next);
11111 let Some(val) = res else { break };
11112 val
11113 }),
11114 4u16 => BandAttrs::HtCapa({
11115 let res = parse_u16(next);
11116 let Some(val) = res else { break };
11117 val
11118 }),
11119 5u16 => BandAttrs::HtAmpduFactor({
11120 let res = parse_u8(next);
11121 let Some(val) = res else { break };
11122 val
11123 }),
11124 6u16 => BandAttrs::HtAmpduDensity({
11125 let res = parse_u8(next);
11126 let Some(val) = res else { break };
11127 val
11128 }),
11129 7u16 => BandAttrs::VhtMcsSet({
11130 let res = Some(next);
11131 let Some(val) = res else { break };
11132 val
11133 }),
11134 8u16 => BandAttrs::VhtCapa({
11135 let res = parse_u32(next);
11136 let Some(val) = res else { break };
11137 val
11138 }),
11139 9u16 => BandAttrs::IftypeData({
11140 let res = Some(IterableArrayIftypeDataAttrs::with_loc(next, self.orig_loc));
11141 let Some(val) = res else { break };
11142 val
11143 }),
11144 10u16 => BandAttrs::EdmgChannels({
11145 let res = Some(next);
11146 let Some(val) = res else { break };
11147 val
11148 }),
11149 11u16 => BandAttrs::EdmgBwConfig({
11150 let res = Some(next);
11151 let Some(val) = res else { break };
11152 val
11153 }),
11154 12u16 => BandAttrs::S1gMcsNssSet({
11155 let res = Some(next);
11156 let Some(val) = res else { break };
11157 val
11158 }),
11159 13u16 => BandAttrs::S1gCapa({
11160 let res = Some(next);
11161 let Some(val) = res else { break };
11162 val
11163 }),
11164 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
11165 n => continue,
11166 };
11167 return Some(Ok(res));
11168 }
11169 Some(Err(ErrorContext::new(
11170 "BandAttrs",
11171 r#type.and_then(|t| BandAttrs::attr_from_type(t)),
11172 self.orig_loc,
11173 self.buf.as_ptr().wrapping_add(pos) as usize,
11174 )))
11175 }
11176}
11177impl std::fmt::Debug for IterableArrayFrequencyAttrs<'_> {
11178 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11179 fmt.debug_list()
11180 .entries(self.clone().map(FlattenErrorContext))
11181 .finish()
11182 }
11183}
11184impl std::fmt::Debug for IterableArrayBitrateAttrs<'_> {
11185 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11186 fmt.debug_list()
11187 .entries(self.clone().map(FlattenErrorContext))
11188 .finish()
11189 }
11190}
11191impl std::fmt::Debug for IterableArrayIftypeDataAttrs<'_> {
11192 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11193 fmt.debug_list()
11194 .entries(self.clone().map(FlattenErrorContext))
11195 .finish()
11196 }
11197}
11198impl<'a> std::fmt::Debug for IterableBandAttrs<'_> {
11199 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11200 let mut fmt = f.debug_struct("BandAttrs");
11201 for attr in self.clone() {
11202 let attr = match attr {
11203 Ok(a) => a,
11204 Err(err) => {
11205 fmt.finish()?;
11206 f.write_str("Err(")?;
11207 err.fmt(f)?;
11208 return f.write_str(")");
11209 }
11210 };
11211 match attr {
11212 BandAttrs::Freqs(val) => fmt.field("Freqs", &val),
11213 BandAttrs::Rates(val) => fmt.field("Rates", &val),
11214 BandAttrs::HtMcsSet(val) => fmt.field("HtMcsSet", &val),
11215 BandAttrs::HtCapa(val) => fmt.field("HtCapa", &val),
11216 BandAttrs::HtAmpduFactor(val) => fmt.field("HtAmpduFactor", &val),
11217 BandAttrs::HtAmpduDensity(val) => fmt.field("HtAmpduDensity", &val),
11218 BandAttrs::VhtMcsSet(val) => fmt.field("VhtMcsSet", &val),
11219 BandAttrs::VhtCapa(val) => fmt.field("VhtCapa", &val),
11220 BandAttrs::IftypeData(val) => fmt.field("IftypeData", &val),
11221 BandAttrs::EdmgChannels(val) => fmt.field("EdmgChannels", &val),
11222 BandAttrs::EdmgBwConfig(val) => fmt.field("EdmgBwConfig", &val),
11223 BandAttrs::S1gMcsNssSet(val) => fmt.field("S1gMcsNssSet", &val),
11224 BandAttrs::S1gCapa(val) => fmt.field("S1gCapa", &val),
11225 };
11226 }
11227 fmt.finish()
11228 }
11229}
11230impl IterableBandAttrs<'_> {
11231 pub fn lookup_attr(
11232 &self,
11233 offset: usize,
11234 missing_type: Option<u16>,
11235 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
11236 let mut stack = Vec::new();
11237 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
11238 if missing_type.is_some() && cur == offset {
11239 stack.push(("BandAttrs", offset));
11240 return (
11241 stack,
11242 missing_type.and_then(|t| BandAttrs::attr_from_type(t)),
11243 );
11244 }
11245 if cur > offset || cur + self.buf.len() < offset {
11246 return (stack, None);
11247 }
11248 let mut attrs = self.clone();
11249 let mut last_off = cur + attrs.pos;
11250 let mut missing = None;
11251 while let Some(attr) = attrs.next() {
11252 let Ok(attr) = attr else { break };
11253 match attr {
11254 BandAttrs::Freqs(val) => {
11255 for entry in val {
11256 let Ok(attr) = entry else { break };
11257 (stack, missing) = attr.lookup_attr(offset, missing_type);
11258 if !stack.is_empty() {
11259 break;
11260 }
11261 }
11262 if !stack.is_empty() {
11263 stack.push(("Freqs", last_off));
11264 break;
11265 }
11266 }
11267 BandAttrs::Rates(val) => {
11268 for entry in val {
11269 let Ok(attr) = entry else { break };
11270 (stack, missing) = attr.lookup_attr(offset, missing_type);
11271 if !stack.is_empty() {
11272 break;
11273 }
11274 }
11275 if !stack.is_empty() {
11276 stack.push(("Rates", last_off));
11277 break;
11278 }
11279 }
11280 BandAttrs::HtMcsSet(val) => {
11281 if last_off == offset {
11282 stack.push(("HtMcsSet", last_off));
11283 break;
11284 }
11285 }
11286 BandAttrs::HtCapa(val) => {
11287 if last_off == offset {
11288 stack.push(("HtCapa", last_off));
11289 break;
11290 }
11291 }
11292 BandAttrs::HtAmpduFactor(val) => {
11293 if last_off == offset {
11294 stack.push(("HtAmpduFactor", last_off));
11295 break;
11296 }
11297 }
11298 BandAttrs::HtAmpduDensity(val) => {
11299 if last_off == offset {
11300 stack.push(("HtAmpduDensity", last_off));
11301 break;
11302 }
11303 }
11304 BandAttrs::VhtMcsSet(val) => {
11305 if last_off == offset {
11306 stack.push(("VhtMcsSet", last_off));
11307 break;
11308 }
11309 }
11310 BandAttrs::VhtCapa(val) => {
11311 if last_off == offset {
11312 stack.push(("VhtCapa", last_off));
11313 break;
11314 }
11315 }
11316 BandAttrs::IftypeData(val) => {
11317 for entry in val {
11318 let Ok(attr) = entry else { break };
11319 (stack, missing) = attr.lookup_attr(offset, missing_type);
11320 if !stack.is_empty() {
11321 break;
11322 }
11323 }
11324 if !stack.is_empty() {
11325 stack.push(("IftypeData", last_off));
11326 break;
11327 }
11328 }
11329 BandAttrs::EdmgChannels(val) => {
11330 if last_off == offset {
11331 stack.push(("EdmgChannels", last_off));
11332 break;
11333 }
11334 }
11335 BandAttrs::EdmgBwConfig(val) => {
11336 if last_off == offset {
11337 stack.push(("EdmgBwConfig", last_off));
11338 break;
11339 }
11340 }
11341 BandAttrs::S1gMcsNssSet(val) => {
11342 if last_off == offset {
11343 stack.push(("S1gMcsNssSet", last_off));
11344 break;
11345 }
11346 }
11347 BandAttrs::S1gCapa(val) => {
11348 if last_off == offset {
11349 stack.push(("S1gCapa", last_off));
11350 break;
11351 }
11352 }
11353 _ => {}
11354 };
11355 last_off = cur + attrs.pos;
11356 }
11357 if !stack.is_empty() {
11358 stack.push(("BandAttrs", cur));
11359 }
11360 (stack, missing)
11361 }
11362}
11363#[derive(Clone)]
11364pub enum BitrateAttrs {
11365 Rate(u32),
11366 _2ghzShortpreamble(()),
11367}
11368impl<'a> IterableBitrateAttrs<'a> {
11369 pub fn get_rate(&self) -> Result<u32, ErrorContext> {
11370 let mut iter = self.clone();
11371 iter.pos = 0;
11372 for attr in iter {
11373 if let Ok(BitrateAttrs::Rate(val)) = attr {
11374 return Ok(val);
11375 }
11376 }
11377 Err(ErrorContext::new_missing(
11378 "BitrateAttrs",
11379 "Rate",
11380 self.orig_loc,
11381 self.buf.as_ptr() as usize,
11382 ))
11383 }
11384 pub fn get_2ghz_shortpreamble(&self) -> Result<(), ErrorContext> {
11385 let mut iter = self.clone();
11386 iter.pos = 0;
11387 for attr in iter {
11388 if let Ok(BitrateAttrs::_2ghzShortpreamble(val)) = attr {
11389 return Ok(val);
11390 }
11391 }
11392 Err(ErrorContext::new_missing(
11393 "BitrateAttrs",
11394 "2ghzShortpreamble",
11395 self.orig_loc,
11396 self.buf.as_ptr() as usize,
11397 ))
11398 }
11399}
11400impl BitrateAttrs {
11401 pub fn new<'a>(buf: &'a [u8]) -> IterableBitrateAttrs<'a> {
11402 IterableBitrateAttrs::with_loc(buf, buf.as_ptr() as usize)
11403 }
11404 fn attr_from_type(r#type: u16) -> Option<&'static str> {
11405 let res = match r#type {
11406 1u16 => "Rate",
11407 2u16 => "2ghzShortpreamble",
11408 _ => return None,
11409 };
11410 Some(res)
11411 }
11412}
11413#[derive(Clone, Copy, Default)]
11414pub struct IterableBitrateAttrs<'a> {
11415 buf: &'a [u8],
11416 pos: usize,
11417 orig_loc: usize,
11418}
11419impl<'a> IterableBitrateAttrs<'a> {
11420 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
11421 Self {
11422 buf,
11423 pos: 0,
11424 orig_loc,
11425 }
11426 }
11427 pub fn get_buf(&self) -> &'a [u8] {
11428 self.buf
11429 }
11430}
11431impl<'a> Iterator for IterableBitrateAttrs<'a> {
11432 type Item = Result<BitrateAttrs, ErrorContext>;
11433 fn next(&mut self) -> Option<Self::Item> {
11434 let mut pos;
11435 let mut r#type;
11436 loop {
11437 pos = self.pos;
11438 r#type = None;
11439 if self.buf.len() == self.pos {
11440 return None;
11441 }
11442 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
11443 self.pos = self.buf.len();
11444 break;
11445 };
11446 r#type = Some(header.r#type);
11447 let res = match header.r#type {
11448 1u16 => BitrateAttrs::Rate({
11449 let res = parse_u32(next);
11450 let Some(val) = res else { break };
11451 val
11452 }),
11453 2u16 => BitrateAttrs::_2ghzShortpreamble(()),
11454 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
11455 n => continue,
11456 };
11457 return Some(Ok(res));
11458 }
11459 Some(Err(ErrorContext::new(
11460 "BitrateAttrs",
11461 r#type.and_then(|t| BitrateAttrs::attr_from_type(t)),
11462 self.orig_loc,
11463 self.buf.as_ptr().wrapping_add(pos) as usize,
11464 )))
11465 }
11466}
11467impl std::fmt::Debug for IterableBitrateAttrs<'_> {
11468 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11469 let mut fmt = f.debug_struct("BitrateAttrs");
11470 for attr in self.clone() {
11471 let attr = match attr {
11472 Ok(a) => a,
11473 Err(err) => {
11474 fmt.finish()?;
11475 f.write_str("Err(")?;
11476 err.fmt(f)?;
11477 return f.write_str(")");
11478 }
11479 };
11480 match attr {
11481 BitrateAttrs::Rate(val) => fmt.field("Rate", &val),
11482 BitrateAttrs::_2ghzShortpreamble(val) => fmt.field("_2ghzShortpreamble", &val),
11483 };
11484 }
11485 fmt.finish()
11486 }
11487}
11488impl IterableBitrateAttrs<'_> {
11489 pub fn lookup_attr(
11490 &self,
11491 offset: usize,
11492 missing_type: Option<u16>,
11493 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
11494 let mut stack = Vec::new();
11495 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
11496 if missing_type.is_some() && cur == offset {
11497 stack.push(("BitrateAttrs", offset));
11498 return (
11499 stack,
11500 missing_type.and_then(|t| BitrateAttrs::attr_from_type(t)),
11501 );
11502 }
11503 if cur > offset || cur + self.buf.len() < offset {
11504 return (stack, None);
11505 }
11506 let mut attrs = self.clone();
11507 let mut last_off = cur + attrs.pos;
11508 while let Some(attr) = attrs.next() {
11509 let Ok(attr) = attr else { break };
11510 match attr {
11511 BitrateAttrs::Rate(val) => {
11512 if last_off == offset {
11513 stack.push(("Rate", last_off));
11514 break;
11515 }
11516 }
11517 BitrateAttrs::_2ghzShortpreamble(val) => {
11518 if last_off == offset {
11519 stack.push(("2ghzShortpreamble", last_off));
11520 break;
11521 }
11522 }
11523 _ => {}
11524 };
11525 last_off = cur + attrs.pos;
11526 }
11527 if !stack.is_empty() {
11528 stack.push(("BitrateAttrs", cur));
11529 }
11530 (stack, None)
11531 }
11532}
11533#[derive(Clone)]
11534pub enum FrequencyAttrs<'a> {
11535 Freq(u32),
11536 Disabled(()),
11537 NoIr(()),
11538 NoIbss(()),
11539 Radar(()),
11540 MaxTxPower(u32),
11541 DfsState(u32),
11542 DfsTime(&'a [u8]),
11543 NoHt40Minus(&'a [u8]),
11544 NoHt40Plus(&'a [u8]),
11545 No80mhz(&'a [u8]),
11546 No160mhz(&'a [u8]),
11547 DfsCacTime(&'a [u8]),
11548 IndoorOnly(&'a [u8]),
11549 IrConcurrent(&'a [u8]),
11550 No20mhz(&'a [u8]),
11551 No10mhz(&'a [u8]),
11552 Wmm(IterableArrayWmmAttrs<'a>),
11553 NoHe(&'a [u8]),
11554 Offset(u32),
11555 _1mhz(&'a [u8]),
11556 _2mhz(&'a [u8]),
11557 _4mhz(&'a [u8]),
11558 _8mhz(&'a [u8]),
11559 _16mhz(&'a [u8]),
11560 No320mhz(&'a [u8]),
11561 NoEht(&'a [u8]),
11562 Psd(&'a [u8]),
11563 DfsConcurrent(&'a [u8]),
11564 No6ghzVlpClient(&'a [u8]),
11565 No6ghzAfcClient(&'a [u8]),
11566 CanMonitor(&'a [u8]),
11567 Allow6ghzVlpAp(&'a [u8]),
11568}
11569impl<'a> IterableFrequencyAttrs<'a> {
11570 pub fn get_freq(&self) -> Result<u32, ErrorContext> {
11571 let mut iter = self.clone();
11572 iter.pos = 0;
11573 for attr in iter {
11574 if let Ok(FrequencyAttrs::Freq(val)) = attr {
11575 return Ok(val);
11576 }
11577 }
11578 Err(ErrorContext::new_missing(
11579 "FrequencyAttrs",
11580 "Freq",
11581 self.orig_loc,
11582 self.buf.as_ptr() as usize,
11583 ))
11584 }
11585 pub fn get_disabled(&self) -> Result<(), ErrorContext> {
11586 let mut iter = self.clone();
11587 iter.pos = 0;
11588 for attr in iter {
11589 if let Ok(FrequencyAttrs::Disabled(val)) = attr {
11590 return Ok(val);
11591 }
11592 }
11593 Err(ErrorContext::new_missing(
11594 "FrequencyAttrs",
11595 "Disabled",
11596 self.orig_loc,
11597 self.buf.as_ptr() as usize,
11598 ))
11599 }
11600 pub fn get_no_ir(&self) -> Result<(), ErrorContext> {
11601 let mut iter = self.clone();
11602 iter.pos = 0;
11603 for attr in iter {
11604 if let Ok(FrequencyAttrs::NoIr(val)) = attr {
11605 return Ok(val);
11606 }
11607 }
11608 Err(ErrorContext::new_missing(
11609 "FrequencyAttrs",
11610 "NoIr",
11611 self.orig_loc,
11612 self.buf.as_ptr() as usize,
11613 ))
11614 }
11615 pub fn get_no_ibss(&self) -> Result<(), ErrorContext> {
11616 let mut iter = self.clone();
11617 iter.pos = 0;
11618 for attr in iter {
11619 if let Ok(FrequencyAttrs::NoIbss(val)) = attr {
11620 return Ok(val);
11621 }
11622 }
11623 Err(ErrorContext::new_missing(
11624 "FrequencyAttrs",
11625 "NoIbss",
11626 self.orig_loc,
11627 self.buf.as_ptr() as usize,
11628 ))
11629 }
11630 pub fn get_radar(&self) -> Result<(), ErrorContext> {
11631 let mut iter = self.clone();
11632 iter.pos = 0;
11633 for attr in iter {
11634 if let Ok(FrequencyAttrs::Radar(val)) = attr {
11635 return Ok(val);
11636 }
11637 }
11638 Err(ErrorContext::new_missing(
11639 "FrequencyAttrs",
11640 "Radar",
11641 self.orig_loc,
11642 self.buf.as_ptr() as usize,
11643 ))
11644 }
11645 pub fn get_max_tx_power(&self) -> Result<u32, ErrorContext> {
11646 let mut iter = self.clone();
11647 iter.pos = 0;
11648 for attr in iter {
11649 if let Ok(FrequencyAttrs::MaxTxPower(val)) = attr {
11650 return Ok(val);
11651 }
11652 }
11653 Err(ErrorContext::new_missing(
11654 "FrequencyAttrs",
11655 "MaxTxPower",
11656 self.orig_loc,
11657 self.buf.as_ptr() as usize,
11658 ))
11659 }
11660 pub fn get_dfs_state(&self) -> Result<u32, ErrorContext> {
11661 let mut iter = self.clone();
11662 iter.pos = 0;
11663 for attr in iter {
11664 if let Ok(FrequencyAttrs::DfsState(val)) = attr {
11665 return Ok(val);
11666 }
11667 }
11668 Err(ErrorContext::new_missing(
11669 "FrequencyAttrs",
11670 "DfsState",
11671 self.orig_loc,
11672 self.buf.as_ptr() as usize,
11673 ))
11674 }
11675 pub fn get_dfs_time(&self) -> Result<&'a [u8], ErrorContext> {
11676 let mut iter = self.clone();
11677 iter.pos = 0;
11678 for attr in iter {
11679 if let Ok(FrequencyAttrs::DfsTime(val)) = attr {
11680 return Ok(val);
11681 }
11682 }
11683 Err(ErrorContext::new_missing(
11684 "FrequencyAttrs",
11685 "DfsTime",
11686 self.orig_loc,
11687 self.buf.as_ptr() as usize,
11688 ))
11689 }
11690 pub fn get_no_ht40_minus(&self) -> Result<&'a [u8], ErrorContext> {
11691 let mut iter = self.clone();
11692 iter.pos = 0;
11693 for attr in iter {
11694 if let Ok(FrequencyAttrs::NoHt40Minus(val)) = attr {
11695 return Ok(val);
11696 }
11697 }
11698 Err(ErrorContext::new_missing(
11699 "FrequencyAttrs",
11700 "NoHt40Minus",
11701 self.orig_loc,
11702 self.buf.as_ptr() as usize,
11703 ))
11704 }
11705 pub fn get_no_ht40_plus(&self) -> Result<&'a [u8], ErrorContext> {
11706 let mut iter = self.clone();
11707 iter.pos = 0;
11708 for attr in iter {
11709 if let Ok(FrequencyAttrs::NoHt40Plus(val)) = attr {
11710 return Ok(val);
11711 }
11712 }
11713 Err(ErrorContext::new_missing(
11714 "FrequencyAttrs",
11715 "NoHt40Plus",
11716 self.orig_loc,
11717 self.buf.as_ptr() as usize,
11718 ))
11719 }
11720 pub fn get_no_80mhz(&self) -> Result<&'a [u8], ErrorContext> {
11721 let mut iter = self.clone();
11722 iter.pos = 0;
11723 for attr in iter {
11724 if let Ok(FrequencyAttrs::No80mhz(val)) = attr {
11725 return Ok(val);
11726 }
11727 }
11728 Err(ErrorContext::new_missing(
11729 "FrequencyAttrs",
11730 "No80mhz",
11731 self.orig_loc,
11732 self.buf.as_ptr() as usize,
11733 ))
11734 }
11735 pub fn get_no_160mhz(&self) -> Result<&'a [u8], ErrorContext> {
11736 let mut iter = self.clone();
11737 iter.pos = 0;
11738 for attr in iter {
11739 if let Ok(FrequencyAttrs::No160mhz(val)) = attr {
11740 return Ok(val);
11741 }
11742 }
11743 Err(ErrorContext::new_missing(
11744 "FrequencyAttrs",
11745 "No160mhz",
11746 self.orig_loc,
11747 self.buf.as_ptr() as usize,
11748 ))
11749 }
11750 pub fn get_dfs_cac_time(&self) -> Result<&'a [u8], ErrorContext> {
11751 let mut iter = self.clone();
11752 iter.pos = 0;
11753 for attr in iter {
11754 if let Ok(FrequencyAttrs::DfsCacTime(val)) = attr {
11755 return Ok(val);
11756 }
11757 }
11758 Err(ErrorContext::new_missing(
11759 "FrequencyAttrs",
11760 "DfsCacTime",
11761 self.orig_loc,
11762 self.buf.as_ptr() as usize,
11763 ))
11764 }
11765 pub fn get_indoor_only(&self) -> Result<&'a [u8], ErrorContext> {
11766 let mut iter = self.clone();
11767 iter.pos = 0;
11768 for attr in iter {
11769 if let Ok(FrequencyAttrs::IndoorOnly(val)) = attr {
11770 return Ok(val);
11771 }
11772 }
11773 Err(ErrorContext::new_missing(
11774 "FrequencyAttrs",
11775 "IndoorOnly",
11776 self.orig_loc,
11777 self.buf.as_ptr() as usize,
11778 ))
11779 }
11780 pub fn get_ir_concurrent(&self) -> Result<&'a [u8], ErrorContext> {
11781 let mut iter = self.clone();
11782 iter.pos = 0;
11783 for attr in iter {
11784 if let Ok(FrequencyAttrs::IrConcurrent(val)) = attr {
11785 return Ok(val);
11786 }
11787 }
11788 Err(ErrorContext::new_missing(
11789 "FrequencyAttrs",
11790 "IrConcurrent",
11791 self.orig_loc,
11792 self.buf.as_ptr() as usize,
11793 ))
11794 }
11795 pub fn get_no_20mhz(&self) -> Result<&'a [u8], ErrorContext> {
11796 let mut iter = self.clone();
11797 iter.pos = 0;
11798 for attr in iter {
11799 if let Ok(FrequencyAttrs::No20mhz(val)) = attr {
11800 return Ok(val);
11801 }
11802 }
11803 Err(ErrorContext::new_missing(
11804 "FrequencyAttrs",
11805 "No20mhz",
11806 self.orig_loc,
11807 self.buf.as_ptr() as usize,
11808 ))
11809 }
11810 pub fn get_no_10mhz(&self) -> Result<&'a [u8], ErrorContext> {
11811 let mut iter = self.clone();
11812 iter.pos = 0;
11813 for attr in iter {
11814 if let Ok(FrequencyAttrs::No10mhz(val)) = attr {
11815 return Ok(val);
11816 }
11817 }
11818 Err(ErrorContext::new_missing(
11819 "FrequencyAttrs",
11820 "No10mhz",
11821 self.orig_loc,
11822 self.buf.as_ptr() as usize,
11823 ))
11824 }
11825 pub fn get_wmm(
11826 &self,
11827 ) -> Result<ArrayIterable<IterableArrayWmmAttrs<'a>, IterableWmmAttrs<'a>>, ErrorContext> {
11828 for attr in self.clone() {
11829 if let Ok(FrequencyAttrs::Wmm(val)) = attr {
11830 return Ok(ArrayIterable::new(val));
11831 }
11832 }
11833 Err(ErrorContext::new_missing(
11834 "FrequencyAttrs",
11835 "Wmm",
11836 self.orig_loc,
11837 self.buf.as_ptr() as usize,
11838 ))
11839 }
11840 pub fn get_no_he(&self) -> Result<&'a [u8], ErrorContext> {
11841 let mut iter = self.clone();
11842 iter.pos = 0;
11843 for attr in iter {
11844 if let Ok(FrequencyAttrs::NoHe(val)) = attr {
11845 return Ok(val);
11846 }
11847 }
11848 Err(ErrorContext::new_missing(
11849 "FrequencyAttrs",
11850 "NoHe",
11851 self.orig_loc,
11852 self.buf.as_ptr() as usize,
11853 ))
11854 }
11855 pub fn get_offset(&self) -> Result<u32, ErrorContext> {
11856 let mut iter = self.clone();
11857 iter.pos = 0;
11858 for attr in iter {
11859 if let Ok(FrequencyAttrs::Offset(val)) = attr {
11860 return Ok(val);
11861 }
11862 }
11863 Err(ErrorContext::new_missing(
11864 "FrequencyAttrs",
11865 "Offset",
11866 self.orig_loc,
11867 self.buf.as_ptr() as usize,
11868 ))
11869 }
11870 pub fn get_1mhz(&self) -> Result<&'a [u8], ErrorContext> {
11871 let mut iter = self.clone();
11872 iter.pos = 0;
11873 for attr in iter {
11874 if let Ok(FrequencyAttrs::_1mhz(val)) = attr {
11875 return Ok(val);
11876 }
11877 }
11878 Err(ErrorContext::new_missing(
11879 "FrequencyAttrs",
11880 "1mhz",
11881 self.orig_loc,
11882 self.buf.as_ptr() as usize,
11883 ))
11884 }
11885 pub fn get_2mhz(&self) -> Result<&'a [u8], ErrorContext> {
11886 let mut iter = self.clone();
11887 iter.pos = 0;
11888 for attr in iter {
11889 if let Ok(FrequencyAttrs::_2mhz(val)) = attr {
11890 return Ok(val);
11891 }
11892 }
11893 Err(ErrorContext::new_missing(
11894 "FrequencyAttrs",
11895 "2mhz",
11896 self.orig_loc,
11897 self.buf.as_ptr() as usize,
11898 ))
11899 }
11900 pub fn get_4mhz(&self) -> Result<&'a [u8], ErrorContext> {
11901 let mut iter = self.clone();
11902 iter.pos = 0;
11903 for attr in iter {
11904 if let Ok(FrequencyAttrs::_4mhz(val)) = attr {
11905 return Ok(val);
11906 }
11907 }
11908 Err(ErrorContext::new_missing(
11909 "FrequencyAttrs",
11910 "4mhz",
11911 self.orig_loc,
11912 self.buf.as_ptr() as usize,
11913 ))
11914 }
11915 pub fn get_8mhz(&self) -> Result<&'a [u8], ErrorContext> {
11916 let mut iter = self.clone();
11917 iter.pos = 0;
11918 for attr in iter {
11919 if let Ok(FrequencyAttrs::_8mhz(val)) = attr {
11920 return Ok(val);
11921 }
11922 }
11923 Err(ErrorContext::new_missing(
11924 "FrequencyAttrs",
11925 "8mhz",
11926 self.orig_loc,
11927 self.buf.as_ptr() as usize,
11928 ))
11929 }
11930 pub fn get_16mhz(&self) -> Result<&'a [u8], ErrorContext> {
11931 let mut iter = self.clone();
11932 iter.pos = 0;
11933 for attr in iter {
11934 if let Ok(FrequencyAttrs::_16mhz(val)) = attr {
11935 return Ok(val);
11936 }
11937 }
11938 Err(ErrorContext::new_missing(
11939 "FrequencyAttrs",
11940 "16mhz",
11941 self.orig_loc,
11942 self.buf.as_ptr() as usize,
11943 ))
11944 }
11945 pub fn get_no_320mhz(&self) -> Result<&'a [u8], ErrorContext> {
11946 let mut iter = self.clone();
11947 iter.pos = 0;
11948 for attr in iter {
11949 if let Ok(FrequencyAttrs::No320mhz(val)) = attr {
11950 return Ok(val);
11951 }
11952 }
11953 Err(ErrorContext::new_missing(
11954 "FrequencyAttrs",
11955 "No320mhz",
11956 self.orig_loc,
11957 self.buf.as_ptr() as usize,
11958 ))
11959 }
11960 pub fn get_no_eht(&self) -> Result<&'a [u8], ErrorContext> {
11961 let mut iter = self.clone();
11962 iter.pos = 0;
11963 for attr in iter {
11964 if let Ok(FrequencyAttrs::NoEht(val)) = attr {
11965 return Ok(val);
11966 }
11967 }
11968 Err(ErrorContext::new_missing(
11969 "FrequencyAttrs",
11970 "NoEht",
11971 self.orig_loc,
11972 self.buf.as_ptr() as usize,
11973 ))
11974 }
11975 pub fn get_psd(&self) -> Result<&'a [u8], ErrorContext> {
11976 let mut iter = self.clone();
11977 iter.pos = 0;
11978 for attr in iter {
11979 if let Ok(FrequencyAttrs::Psd(val)) = attr {
11980 return Ok(val);
11981 }
11982 }
11983 Err(ErrorContext::new_missing(
11984 "FrequencyAttrs",
11985 "Psd",
11986 self.orig_loc,
11987 self.buf.as_ptr() as usize,
11988 ))
11989 }
11990 pub fn get_dfs_concurrent(&self) -> Result<&'a [u8], ErrorContext> {
11991 let mut iter = self.clone();
11992 iter.pos = 0;
11993 for attr in iter {
11994 if let Ok(FrequencyAttrs::DfsConcurrent(val)) = attr {
11995 return Ok(val);
11996 }
11997 }
11998 Err(ErrorContext::new_missing(
11999 "FrequencyAttrs",
12000 "DfsConcurrent",
12001 self.orig_loc,
12002 self.buf.as_ptr() as usize,
12003 ))
12004 }
12005 pub fn get_no_6ghz_vlp_client(&self) -> Result<&'a [u8], ErrorContext> {
12006 let mut iter = self.clone();
12007 iter.pos = 0;
12008 for attr in iter {
12009 if let Ok(FrequencyAttrs::No6ghzVlpClient(val)) = attr {
12010 return Ok(val);
12011 }
12012 }
12013 Err(ErrorContext::new_missing(
12014 "FrequencyAttrs",
12015 "No6ghzVlpClient",
12016 self.orig_loc,
12017 self.buf.as_ptr() as usize,
12018 ))
12019 }
12020 pub fn get_no_6ghz_afc_client(&self) -> Result<&'a [u8], ErrorContext> {
12021 let mut iter = self.clone();
12022 iter.pos = 0;
12023 for attr in iter {
12024 if let Ok(FrequencyAttrs::No6ghzAfcClient(val)) = attr {
12025 return Ok(val);
12026 }
12027 }
12028 Err(ErrorContext::new_missing(
12029 "FrequencyAttrs",
12030 "No6ghzAfcClient",
12031 self.orig_loc,
12032 self.buf.as_ptr() as usize,
12033 ))
12034 }
12035 pub fn get_can_monitor(&self) -> Result<&'a [u8], ErrorContext> {
12036 let mut iter = self.clone();
12037 iter.pos = 0;
12038 for attr in iter {
12039 if let Ok(FrequencyAttrs::CanMonitor(val)) = attr {
12040 return Ok(val);
12041 }
12042 }
12043 Err(ErrorContext::new_missing(
12044 "FrequencyAttrs",
12045 "CanMonitor",
12046 self.orig_loc,
12047 self.buf.as_ptr() as usize,
12048 ))
12049 }
12050 pub fn get_allow_6ghz_vlp_ap(&self) -> Result<&'a [u8], ErrorContext> {
12051 let mut iter = self.clone();
12052 iter.pos = 0;
12053 for attr in iter {
12054 if let Ok(FrequencyAttrs::Allow6ghzVlpAp(val)) = attr {
12055 return Ok(val);
12056 }
12057 }
12058 Err(ErrorContext::new_missing(
12059 "FrequencyAttrs",
12060 "Allow6ghzVlpAp",
12061 self.orig_loc,
12062 self.buf.as_ptr() as usize,
12063 ))
12064 }
12065}
12066impl WmmAttrs {
12067 pub fn new_array(buf: &[u8]) -> IterableArrayWmmAttrs<'_> {
12068 IterableArrayWmmAttrs::with_loc(buf, buf.as_ptr() as usize)
12069 }
12070}
12071#[derive(Clone, Copy, Default)]
12072pub struct IterableArrayWmmAttrs<'a> {
12073 buf: &'a [u8],
12074 pos: usize,
12075 orig_loc: usize,
12076}
12077impl<'a> IterableArrayWmmAttrs<'a> {
12078 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12079 Self {
12080 buf,
12081 pos: 0,
12082 orig_loc,
12083 }
12084 }
12085 pub fn get_buf(&self) -> &'a [u8] {
12086 self.buf
12087 }
12088}
12089impl<'a> Iterator for IterableArrayWmmAttrs<'a> {
12090 type Item = Result<IterableWmmAttrs<'a>, ErrorContext>;
12091 fn next(&mut self) -> Option<Self::Item> {
12092 if self.buf.len() == self.pos {
12093 return None;
12094 }
12095 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
12096 {
12097 return Some(Ok(IterableWmmAttrs::with_loc(next, self.orig_loc)));
12098 }
12099 }
12100 let pos = self.pos;
12101 self.pos = self.buf.len();
12102 Some(Err(ErrorContext::new(
12103 "WmmAttrs",
12104 None,
12105 self.orig_loc,
12106 self.buf.as_ptr().wrapping_add(pos) as usize,
12107 )))
12108 }
12109}
12110impl FrequencyAttrs<'_> {
12111 pub fn new<'a>(buf: &'a [u8]) -> IterableFrequencyAttrs<'a> {
12112 IterableFrequencyAttrs::with_loc(buf, buf.as_ptr() as usize)
12113 }
12114 fn attr_from_type(r#type: u16) -> Option<&'static str> {
12115 let res = match r#type {
12116 1u16 => "Freq",
12117 2u16 => "Disabled",
12118 3u16 => "NoIr",
12119 4u16 => "NoIbss",
12120 5u16 => "Radar",
12121 6u16 => "MaxTxPower",
12122 7u16 => "DfsState",
12123 8u16 => "DfsTime",
12124 9u16 => "NoHt40Minus",
12125 10u16 => "NoHt40Plus",
12126 11u16 => "No80mhz",
12127 12u16 => "No160mhz",
12128 13u16 => "DfsCacTime",
12129 14u16 => "IndoorOnly",
12130 15u16 => "IrConcurrent",
12131 16u16 => "No20mhz",
12132 17u16 => "No10mhz",
12133 18u16 => "Wmm",
12134 19u16 => "NoHe",
12135 20u16 => "Offset",
12136 21u16 => "1mhz",
12137 22u16 => "2mhz",
12138 23u16 => "4mhz",
12139 24u16 => "8mhz",
12140 25u16 => "16mhz",
12141 26u16 => "No320mhz",
12142 27u16 => "NoEht",
12143 28u16 => "Psd",
12144 29u16 => "DfsConcurrent",
12145 30u16 => "No6ghzVlpClient",
12146 31u16 => "No6ghzAfcClient",
12147 32u16 => "CanMonitor",
12148 33u16 => "Allow6ghzVlpAp",
12149 _ => return None,
12150 };
12151 Some(res)
12152 }
12153}
12154#[derive(Clone, Copy, Default)]
12155pub struct IterableFrequencyAttrs<'a> {
12156 buf: &'a [u8],
12157 pos: usize,
12158 orig_loc: usize,
12159}
12160impl<'a> IterableFrequencyAttrs<'a> {
12161 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12162 Self {
12163 buf,
12164 pos: 0,
12165 orig_loc,
12166 }
12167 }
12168 pub fn get_buf(&self) -> &'a [u8] {
12169 self.buf
12170 }
12171}
12172impl<'a> Iterator for IterableFrequencyAttrs<'a> {
12173 type Item = Result<FrequencyAttrs<'a>, ErrorContext>;
12174 fn next(&mut self) -> Option<Self::Item> {
12175 let mut pos;
12176 let mut r#type;
12177 loop {
12178 pos = self.pos;
12179 r#type = None;
12180 if self.buf.len() == self.pos {
12181 return None;
12182 }
12183 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
12184 self.pos = self.buf.len();
12185 break;
12186 };
12187 r#type = Some(header.r#type);
12188 let res = match header.r#type {
12189 1u16 => FrequencyAttrs::Freq({
12190 let res = parse_u32(next);
12191 let Some(val) = res else { break };
12192 val
12193 }),
12194 2u16 => FrequencyAttrs::Disabled(()),
12195 3u16 => FrequencyAttrs::NoIr(()),
12196 4u16 => FrequencyAttrs::NoIbss(()),
12197 5u16 => FrequencyAttrs::Radar(()),
12198 6u16 => FrequencyAttrs::MaxTxPower({
12199 let res = parse_u32(next);
12200 let Some(val) = res else { break };
12201 val
12202 }),
12203 7u16 => FrequencyAttrs::DfsState({
12204 let res = parse_u32(next);
12205 let Some(val) = res else { break };
12206 val
12207 }),
12208 8u16 => FrequencyAttrs::DfsTime({
12209 let res = Some(next);
12210 let Some(val) = res else { break };
12211 val
12212 }),
12213 9u16 => FrequencyAttrs::NoHt40Minus({
12214 let res = Some(next);
12215 let Some(val) = res else { break };
12216 val
12217 }),
12218 10u16 => FrequencyAttrs::NoHt40Plus({
12219 let res = Some(next);
12220 let Some(val) = res else { break };
12221 val
12222 }),
12223 11u16 => FrequencyAttrs::No80mhz({
12224 let res = Some(next);
12225 let Some(val) = res else { break };
12226 val
12227 }),
12228 12u16 => FrequencyAttrs::No160mhz({
12229 let res = Some(next);
12230 let Some(val) = res else { break };
12231 val
12232 }),
12233 13u16 => FrequencyAttrs::DfsCacTime({
12234 let res = Some(next);
12235 let Some(val) = res else { break };
12236 val
12237 }),
12238 14u16 => FrequencyAttrs::IndoorOnly({
12239 let res = Some(next);
12240 let Some(val) = res else { break };
12241 val
12242 }),
12243 15u16 => FrequencyAttrs::IrConcurrent({
12244 let res = Some(next);
12245 let Some(val) = res else { break };
12246 val
12247 }),
12248 16u16 => FrequencyAttrs::No20mhz({
12249 let res = Some(next);
12250 let Some(val) = res else { break };
12251 val
12252 }),
12253 17u16 => FrequencyAttrs::No10mhz({
12254 let res = Some(next);
12255 let Some(val) = res else { break };
12256 val
12257 }),
12258 18u16 => FrequencyAttrs::Wmm({
12259 let res = Some(IterableArrayWmmAttrs::with_loc(next, self.orig_loc));
12260 let Some(val) = res else { break };
12261 val
12262 }),
12263 19u16 => FrequencyAttrs::NoHe({
12264 let res = Some(next);
12265 let Some(val) = res else { break };
12266 val
12267 }),
12268 20u16 => FrequencyAttrs::Offset({
12269 let res = parse_u32(next);
12270 let Some(val) = res else { break };
12271 val
12272 }),
12273 21u16 => FrequencyAttrs::_1mhz({
12274 let res = Some(next);
12275 let Some(val) = res else { break };
12276 val
12277 }),
12278 22u16 => FrequencyAttrs::_2mhz({
12279 let res = Some(next);
12280 let Some(val) = res else { break };
12281 val
12282 }),
12283 23u16 => FrequencyAttrs::_4mhz({
12284 let res = Some(next);
12285 let Some(val) = res else { break };
12286 val
12287 }),
12288 24u16 => FrequencyAttrs::_8mhz({
12289 let res = Some(next);
12290 let Some(val) = res else { break };
12291 val
12292 }),
12293 25u16 => FrequencyAttrs::_16mhz({
12294 let res = Some(next);
12295 let Some(val) = res else { break };
12296 val
12297 }),
12298 26u16 => FrequencyAttrs::No320mhz({
12299 let res = Some(next);
12300 let Some(val) = res else { break };
12301 val
12302 }),
12303 27u16 => FrequencyAttrs::NoEht({
12304 let res = Some(next);
12305 let Some(val) = res else { break };
12306 val
12307 }),
12308 28u16 => FrequencyAttrs::Psd({
12309 let res = Some(next);
12310 let Some(val) = res else { break };
12311 val
12312 }),
12313 29u16 => FrequencyAttrs::DfsConcurrent({
12314 let res = Some(next);
12315 let Some(val) = res else { break };
12316 val
12317 }),
12318 30u16 => FrequencyAttrs::No6ghzVlpClient({
12319 let res = Some(next);
12320 let Some(val) = res else { break };
12321 val
12322 }),
12323 31u16 => FrequencyAttrs::No6ghzAfcClient({
12324 let res = Some(next);
12325 let Some(val) = res else { break };
12326 val
12327 }),
12328 32u16 => FrequencyAttrs::CanMonitor({
12329 let res = Some(next);
12330 let Some(val) = res else { break };
12331 val
12332 }),
12333 33u16 => FrequencyAttrs::Allow6ghzVlpAp({
12334 let res = Some(next);
12335 let Some(val) = res else { break };
12336 val
12337 }),
12338 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
12339 n => continue,
12340 };
12341 return Some(Ok(res));
12342 }
12343 Some(Err(ErrorContext::new(
12344 "FrequencyAttrs",
12345 r#type.and_then(|t| FrequencyAttrs::attr_from_type(t)),
12346 self.orig_loc,
12347 self.buf.as_ptr().wrapping_add(pos) as usize,
12348 )))
12349 }
12350}
12351impl std::fmt::Debug for IterableArrayWmmAttrs<'_> {
12352 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12353 fmt.debug_list()
12354 .entries(self.clone().map(FlattenErrorContext))
12355 .finish()
12356 }
12357}
12358impl<'a> std::fmt::Debug for IterableFrequencyAttrs<'_> {
12359 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12360 let mut fmt = f.debug_struct("FrequencyAttrs");
12361 for attr in self.clone() {
12362 let attr = match attr {
12363 Ok(a) => a,
12364 Err(err) => {
12365 fmt.finish()?;
12366 f.write_str("Err(")?;
12367 err.fmt(f)?;
12368 return f.write_str(")");
12369 }
12370 };
12371 match attr {
12372 FrequencyAttrs::Freq(val) => fmt.field("Freq", &val),
12373 FrequencyAttrs::Disabled(val) => fmt.field("Disabled", &val),
12374 FrequencyAttrs::NoIr(val) => fmt.field("NoIr", &val),
12375 FrequencyAttrs::NoIbss(val) => fmt.field("NoIbss", &val),
12376 FrequencyAttrs::Radar(val) => fmt.field("Radar", &val),
12377 FrequencyAttrs::MaxTxPower(val) => fmt.field("MaxTxPower", &val),
12378 FrequencyAttrs::DfsState(val) => fmt.field("DfsState", &val),
12379 FrequencyAttrs::DfsTime(val) => fmt.field("DfsTime", &val),
12380 FrequencyAttrs::NoHt40Minus(val) => fmt.field("NoHt40Minus", &val),
12381 FrequencyAttrs::NoHt40Plus(val) => fmt.field("NoHt40Plus", &val),
12382 FrequencyAttrs::No80mhz(val) => fmt.field("No80mhz", &val),
12383 FrequencyAttrs::No160mhz(val) => fmt.field("No160mhz", &val),
12384 FrequencyAttrs::DfsCacTime(val) => fmt.field("DfsCacTime", &val),
12385 FrequencyAttrs::IndoorOnly(val) => fmt.field("IndoorOnly", &val),
12386 FrequencyAttrs::IrConcurrent(val) => fmt.field("IrConcurrent", &val),
12387 FrequencyAttrs::No20mhz(val) => fmt.field("No20mhz", &val),
12388 FrequencyAttrs::No10mhz(val) => fmt.field("No10mhz", &val),
12389 FrequencyAttrs::Wmm(val) => fmt.field("Wmm", &val),
12390 FrequencyAttrs::NoHe(val) => fmt.field("NoHe", &val),
12391 FrequencyAttrs::Offset(val) => fmt.field("Offset", &val),
12392 FrequencyAttrs::_1mhz(val) => fmt.field("_1mhz", &val),
12393 FrequencyAttrs::_2mhz(val) => fmt.field("_2mhz", &val),
12394 FrequencyAttrs::_4mhz(val) => fmt.field("_4mhz", &val),
12395 FrequencyAttrs::_8mhz(val) => fmt.field("_8mhz", &val),
12396 FrequencyAttrs::_16mhz(val) => fmt.field("_16mhz", &val),
12397 FrequencyAttrs::No320mhz(val) => fmt.field("No320mhz", &val),
12398 FrequencyAttrs::NoEht(val) => fmt.field("NoEht", &val),
12399 FrequencyAttrs::Psd(val) => fmt.field("Psd", &val),
12400 FrequencyAttrs::DfsConcurrent(val) => fmt.field("DfsConcurrent", &val),
12401 FrequencyAttrs::No6ghzVlpClient(val) => fmt.field("No6ghzVlpClient", &val),
12402 FrequencyAttrs::No6ghzAfcClient(val) => fmt.field("No6ghzAfcClient", &val),
12403 FrequencyAttrs::CanMonitor(val) => fmt.field("CanMonitor", &val),
12404 FrequencyAttrs::Allow6ghzVlpAp(val) => fmt.field("Allow6ghzVlpAp", &val),
12405 };
12406 }
12407 fmt.finish()
12408 }
12409}
12410impl IterableFrequencyAttrs<'_> {
12411 pub fn lookup_attr(
12412 &self,
12413 offset: usize,
12414 missing_type: Option<u16>,
12415 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
12416 let mut stack = Vec::new();
12417 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
12418 if missing_type.is_some() && cur == offset {
12419 stack.push(("FrequencyAttrs", offset));
12420 return (
12421 stack,
12422 missing_type.and_then(|t| FrequencyAttrs::attr_from_type(t)),
12423 );
12424 }
12425 if cur > offset || cur + self.buf.len() < offset {
12426 return (stack, None);
12427 }
12428 let mut attrs = self.clone();
12429 let mut last_off = cur + attrs.pos;
12430 let mut missing = None;
12431 while let Some(attr) = attrs.next() {
12432 let Ok(attr) = attr else { break };
12433 match attr {
12434 FrequencyAttrs::Freq(val) => {
12435 if last_off == offset {
12436 stack.push(("Freq", last_off));
12437 break;
12438 }
12439 }
12440 FrequencyAttrs::Disabled(val) => {
12441 if last_off == offset {
12442 stack.push(("Disabled", last_off));
12443 break;
12444 }
12445 }
12446 FrequencyAttrs::NoIr(val) => {
12447 if last_off == offset {
12448 stack.push(("NoIr", last_off));
12449 break;
12450 }
12451 }
12452 FrequencyAttrs::NoIbss(val) => {
12453 if last_off == offset {
12454 stack.push(("NoIbss", last_off));
12455 break;
12456 }
12457 }
12458 FrequencyAttrs::Radar(val) => {
12459 if last_off == offset {
12460 stack.push(("Radar", last_off));
12461 break;
12462 }
12463 }
12464 FrequencyAttrs::MaxTxPower(val) => {
12465 if last_off == offset {
12466 stack.push(("MaxTxPower", last_off));
12467 break;
12468 }
12469 }
12470 FrequencyAttrs::DfsState(val) => {
12471 if last_off == offset {
12472 stack.push(("DfsState", last_off));
12473 break;
12474 }
12475 }
12476 FrequencyAttrs::DfsTime(val) => {
12477 if last_off == offset {
12478 stack.push(("DfsTime", last_off));
12479 break;
12480 }
12481 }
12482 FrequencyAttrs::NoHt40Minus(val) => {
12483 if last_off == offset {
12484 stack.push(("NoHt40Minus", last_off));
12485 break;
12486 }
12487 }
12488 FrequencyAttrs::NoHt40Plus(val) => {
12489 if last_off == offset {
12490 stack.push(("NoHt40Plus", last_off));
12491 break;
12492 }
12493 }
12494 FrequencyAttrs::No80mhz(val) => {
12495 if last_off == offset {
12496 stack.push(("No80mhz", last_off));
12497 break;
12498 }
12499 }
12500 FrequencyAttrs::No160mhz(val) => {
12501 if last_off == offset {
12502 stack.push(("No160mhz", last_off));
12503 break;
12504 }
12505 }
12506 FrequencyAttrs::DfsCacTime(val) => {
12507 if last_off == offset {
12508 stack.push(("DfsCacTime", last_off));
12509 break;
12510 }
12511 }
12512 FrequencyAttrs::IndoorOnly(val) => {
12513 if last_off == offset {
12514 stack.push(("IndoorOnly", last_off));
12515 break;
12516 }
12517 }
12518 FrequencyAttrs::IrConcurrent(val) => {
12519 if last_off == offset {
12520 stack.push(("IrConcurrent", last_off));
12521 break;
12522 }
12523 }
12524 FrequencyAttrs::No20mhz(val) => {
12525 if last_off == offset {
12526 stack.push(("No20mhz", last_off));
12527 break;
12528 }
12529 }
12530 FrequencyAttrs::No10mhz(val) => {
12531 if last_off == offset {
12532 stack.push(("No10mhz", last_off));
12533 break;
12534 }
12535 }
12536 FrequencyAttrs::Wmm(val) => {
12537 for entry in val {
12538 let Ok(attr) = entry else { break };
12539 (stack, missing) = attr.lookup_attr(offset, missing_type);
12540 if !stack.is_empty() {
12541 break;
12542 }
12543 }
12544 if !stack.is_empty() {
12545 stack.push(("Wmm", last_off));
12546 break;
12547 }
12548 }
12549 FrequencyAttrs::NoHe(val) => {
12550 if last_off == offset {
12551 stack.push(("NoHe", last_off));
12552 break;
12553 }
12554 }
12555 FrequencyAttrs::Offset(val) => {
12556 if last_off == offset {
12557 stack.push(("Offset", last_off));
12558 break;
12559 }
12560 }
12561 FrequencyAttrs::_1mhz(val) => {
12562 if last_off == offset {
12563 stack.push(("1mhz", last_off));
12564 break;
12565 }
12566 }
12567 FrequencyAttrs::_2mhz(val) => {
12568 if last_off == offset {
12569 stack.push(("2mhz", last_off));
12570 break;
12571 }
12572 }
12573 FrequencyAttrs::_4mhz(val) => {
12574 if last_off == offset {
12575 stack.push(("4mhz", last_off));
12576 break;
12577 }
12578 }
12579 FrequencyAttrs::_8mhz(val) => {
12580 if last_off == offset {
12581 stack.push(("8mhz", last_off));
12582 break;
12583 }
12584 }
12585 FrequencyAttrs::_16mhz(val) => {
12586 if last_off == offset {
12587 stack.push(("16mhz", last_off));
12588 break;
12589 }
12590 }
12591 FrequencyAttrs::No320mhz(val) => {
12592 if last_off == offset {
12593 stack.push(("No320mhz", last_off));
12594 break;
12595 }
12596 }
12597 FrequencyAttrs::NoEht(val) => {
12598 if last_off == offset {
12599 stack.push(("NoEht", last_off));
12600 break;
12601 }
12602 }
12603 FrequencyAttrs::Psd(val) => {
12604 if last_off == offset {
12605 stack.push(("Psd", last_off));
12606 break;
12607 }
12608 }
12609 FrequencyAttrs::DfsConcurrent(val) => {
12610 if last_off == offset {
12611 stack.push(("DfsConcurrent", last_off));
12612 break;
12613 }
12614 }
12615 FrequencyAttrs::No6ghzVlpClient(val) => {
12616 if last_off == offset {
12617 stack.push(("No6ghzVlpClient", last_off));
12618 break;
12619 }
12620 }
12621 FrequencyAttrs::No6ghzAfcClient(val) => {
12622 if last_off == offset {
12623 stack.push(("No6ghzAfcClient", last_off));
12624 break;
12625 }
12626 }
12627 FrequencyAttrs::CanMonitor(val) => {
12628 if last_off == offset {
12629 stack.push(("CanMonitor", last_off));
12630 break;
12631 }
12632 }
12633 FrequencyAttrs::Allow6ghzVlpAp(val) => {
12634 if last_off == offset {
12635 stack.push(("Allow6ghzVlpAp", last_off));
12636 break;
12637 }
12638 }
12639 _ => {}
12640 };
12641 last_off = cur + attrs.pos;
12642 }
12643 if !stack.is_empty() {
12644 stack.push(("FrequencyAttrs", cur));
12645 }
12646 (stack, missing)
12647 }
12648}
12649#[derive(Clone)]
12650pub enum IfCombinationAttributes<'a> {
12651 Limits(IterableArrayIfaceLimitAttributes<'a>),
12652 Maxnum(u32),
12653 StaApBiMatch(()),
12654 NumChannels(u32),
12655 RadarDetectWidths(u32),
12656 RadarDetectRegions(u32),
12657 BiMinGcd(u32),
12658}
12659impl<'a> IterableIfCombinationAttributes<'a> {
12660 pub fn get_limits(
12661 &self,
12662 ) -> Result<
12663 ArrayIterable<IterableArrayIfaceLimitAttributes<'a>, IterableIfaceLimitAttributes<'a>>,
12664 ErrorContext,
12665 > {
12666 for attr in self.clone() {
12667 if let Ok(IfCombinationAttributes::Limits(val)) = attr {
12668 return Ok(ArrayIterable::new(val));
12669 }
12670 }
12671 Err(ErrorContext::new_missing(
12672 "IfCombinationAttributes",
12673 "Limits",
12674 self.orig_loc,
12675 self.buf.as_ptr() as usize,
12676 ))
12677 }
12678 pub fn get_maxnum(&self) -> Result<u32, ErrorContext> {
12679 let mut iter = self.clone();
12680 iter.pos = 0;
12681 for attr in iter {
12682 if let Ok(IfCombinationAttributes::Maxnum(val)) = attr {
12683 return Ok(val);
12684 }
12685 }
12686 Err(ErrorContext::new_missing(
12687 "IfCombinationAttributes",
12688 "Maxnum",
12689 self.orig_loc,
12690 self.buf.as_ptr() as usize,
12691 ))
12692 }
12693 pub fn get_sta_ap_bi_match(&self) -> Result<(), ErrorContext> {
12694 let mut iter = self.clone();
12695 iter.pos = 0;
12696 for attr in iter {
12697 if let Ok(IfCombinationAttributes::StaApBiMatch(val)) = attr {
12698 return Ok(val);
12699 }
12700 }
12701 Err(ErrorContext::new_missing(
12702 "IfCombinationAttributes",
12703 "StaApBiMatch",
12704 self.orig_loc,
12705 self.buf.as_ptr() as usize,
12706 ))
12707 }
12708 pub fn get_num_channels(&self) -> Result<u32, ErrorContext> {
12709 let mut iter = self.clone();
12710 iter.pos = 0;
12711 for attr in iter {
12712 if let Ok(IfCombinationAttributes::NumChannels(val)) = attr {
12713 return Ok(val);
12714 }
12715 }
12716 Err(ErrorContext::new_missing(
12717 "IfCombinationAttributes",
12718 "NumChannels",
12719 self.orig_loc,
12720 self.buf.as_ptr() as usize,
12721 ))
12722 }
12723 pub fn get_radar_detect_widths(&self) -> Result<u32, ErrorContext> {
12724 let mut iter = self.clone();
12725 iter.pos = 0;
12726 for attr in iter {
12727 if let Ok(IfCombinationAttributes::RadarDetectWidths(val)) = attr {
12728 return Ok(val);
12729 }
12730 }
12731 Err(ErrorContext::new_missing(
12732 "IfCombinationAttributes",
12733 "RadarDetectWidths",
12734 self.orig_loc,
12735 self.buf.as_ptr() as usize,
12736 ))
12737 }
12738 pub fn get_radar_detect_regions(&self) -> Result<u32, ErrorContext> {
12739 let mut iter = self.clone();
12740 iter.pos = 0;
12741 for attr in iter {
12742 if let Ok(IfCombinationAttributes::RadarDetectRegions(val)) = attr {
12743 return Ok(val);
12744 }
12745 }
12746 Err(ErrorContext::new_missing(
12747 "IfCombinationAttributes",
12748 "RadarDetectRegions",
12749 self.orig_loc,
12750 self.buf.as_ptr() as usize,
12751 ))
12752 }
12753 pub fn get_bi_min_gcd(&self) -> Result<u32, ErrorContext> {
12754 let mut iter = self.clone();
12755 iter.pos = 0;
12756 for attr in iter {
12757 if let Ok(IfCombinationAttributes::BiMinGcd(val)) = attr {
12758 return Ok(val);
12759 }
12760 }
12761 Err(ErrorContext::new_missing(
12762 "IfCombinationAttributes",
12763 "BiMinGcd",
12764 self.orig_loc,
12765 self.buf.as_ptr() as usize,
12766 ))
12767 }
12768}
12769impl<'a> IfaceLimitAttributes<'a> {
12770 pub fn new_array(buf: &[u8]) -> IterableArrayIfaceLimitAttributes<'_> {
12771 IterableArrayIfaceLimitAttributes::with_loc(buf, buf.as_ptr() as usize)
12772 }
12773}
12774#[derive(Clone, Copy, Default)]
12775pub struct IterableArrayIfaceLimitAttributes<'a> {
12776 buf: &'a [u8],
12777 pos: usize,
12778 orig_loc: usize,
12779}
12780impl<'a> IterableArrayIfaceLimitAttributes<'a> {
12781 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12782 Self {
12783 buf,
12784 pos: 0,
12785 orig_loc,
12786 }
12787 }
12788 pub fn get_buf(&self) -> &'a [u8] {
12789 self.buf
12790 }
12791}
12792impl<'a> Iterator for IterableArrayIfaceLimitAttributes<'a> {
12793 type Item = Result<IterableIfaceLimitAttributes<'a>, ErrorContext>;
12794 fn next(&mut self) -> Option<Self::Item> {
12795 if self.buf.len() == self.pos {
12796 return None;
12797 }
12798 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
12799 {
12800 return Some(Ok(IterableIfaceLimitAttributes::with_loc(
12801 next,
12802 self.orig_loc,
12803 )));
12804 }
12805 }
12806 let pos = self.pos;
12807 self.pos = self.buf.len();
12808 Some(Err(ErrorContext::new(
12809 "IfaceLimitAttributes",
12810 None,
12811 self.orig_loc,
12812 self.buf.as_ptr().wrapping_add(pos) as usize,
12813 )))
12814 }
12815}
12816impl IfCombinationAttributes<'_> {
12817 pub fn new<'a>(buf: &'a [u8]) -> IterableIfCombinationAttributes<'a> {
12818 IterableIfCombinationAttributes::with_loc(buf, buf.as_ptr() as usize)
12819 }
12820 fn attr_from_type(r#type: u16) -> Option<&'static str> {
12821 let res = match r#type {
12822 1u16 => "Limits",
12823 2u16 => "Maxnum",
12824 3u16 => "StaApBiMatch",
12825 4u16 => "NumChannels",
12826 5u16 => "RadarDetectWidths",
12827 6u16 => "RadarDetectRegions",
12828 7u16 => "BiMinGcd",
12829 _ => return None,
12830 };
12831 Some(res)
12832 }
12833}
12834#[derive(Clone, Copy, Default)]
12835pub struct IterableIfCombinationAttributes<'a> {
12836 buf: &'a [u8],
12837 pos: usize,
12838 orig_loc: usize,
12839}
12840impl<'a> IterableIfCombinationAttributes<'a> {
12841 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
12842 Self {
12843 buf,
12844 pos: 0,
12845 orig_loc,
12846 }
12847 }
12848 pub fn get_buf(&self) -> &'a [u8] {
12849 self.buf
12850 }
12851}
12852impl<'a> Iterator for IterableIfCombinationAttributes<'a> {
12853 type Item = Result<IfCombinationAttributes<'a>, ErrorContext>;
12854 fn next(&mut self) -> Option<Self::Item> {
12855 let mut pos;
12856 let mut r#type;
12857 loop {
12858 pos = self.pos;
12859 r#type = None;
12860 if self.buf.len() == self.pos {
12861 return None;
12862 }
12863 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
12864 self.pos = self.buf.len();
12865 break;
12866 };
12867 r#type = Some(header.r#type);
12868 let res = match header.r#type {
12869 1u16 => IfCombinationAttributes::Limits({
12870 let res = Some(IterableArrayIfaceLimitAttributes::with_loc(
12871 next,
12872 self.orig_loc,
12873 ));
12874 let Some(val) = res else { break };
12875 val
12876 }),
12877 2u16 => IfCombinationAttributes::Maxnum({
12878 let res = parse_u32(next);
12879 let Some(val) = res else { break };
12880 val
12881 }),
12882 3u16 => IfCombinationAttributes::StaApBiMatch(()),
12883 4u16 => IfCombinationAttributes::NumChannels({
12884 let res = parse_u32(next);
12885 let Some(val) = res else { break };
12886 val
12887 }),
12888 5u16 => IfCombinationAttributes::RadarDetectWidths({
12889 let res = parse_u32(next);
12890 let Some(val) = res else { break };
12891 val
12892 }),
12893 6u16 => IfCombinationAttributes::RadarDetectRegions({
12894 let res = parse_u32(next);
12895 let Some(val) = res else { break };
12896 val
12897 }),
12898 7u16 => IfCombinationAttributes::BiMinGcd({
12899 let res = parse_u32(next);
12900 let Some(val) = res else { break };
12901 val
12902 }),
12903 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
12904 n => continue,
12905 };
12906 return Some(Ok(res));
12907 }
12908 Some(Err(ErrorContext::new(
12909 "IfCombinationAttributes",
12910 r#type.and_then(|t| IfCombinationAttributes::attr_from_type(t)),
12911 self.orig_loc,
12912 self.buf.as_ptr().wrapping_add(pos) as usize,
12913 )))
12914 }
12915}
12916impl std::fmt::Debug for IterableArrayIfaceLimitAttributes<'_> {
12917 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12918 fmt.debug_list()
12919 .entries(self.clone().map(FlattenErrorContext))
12920 .finish()
12921 }
12922}
12923impl<'a> std::fmt::Debug for IterableIfCombinationAttributes<'_> {
12924 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12925 let mut fmt = f.debug_struct("IfCombinationAttributes");
12926 for attr in self.clone() {
12927 let attr = match attr {
12928 Ok(a) => a,
12929 Err(err) => {
12930 fmt.finish()?;
12931 f.write_str("Err(")?;
12932 err.fmt(f)?;
12933 return f.write_str(")");
12934 }
12935 };
12936 match attr {
12937 IfCombinationAttributes::Limits(val) => fmt.field("Limits", &val),
12938 IfCombinationAttributes::Maxnum(val) => fmt.field("Maxnum", &val),
12939 IfCombinationAttributes::StaApBiMatch(val) => fmt.field("StaApBiMatch", &val),
12940 IfCombinationAttributes::NumChannels(val) => fmt.field("NumChannels", &val),
12941 IfCombinationAttributes::RadarDetectWidths(val) => {
12942 fmt.field("RadarDetectWidths", &val)
12943 }
12944 IfCombinationAttributes::RadarDetectRegions(val) => {
12945 fmt.field("RadarDetectRegions", &val)
12946 }
12947 IfCombinationAttributes::BiMinGcd(val) => fmt.field("BiMinGcd", &val),
12948 };
12949 }
12950 fmt.finish()
12951 }
12952}
12953impl IterableIfCombinationAttributes<'_> {
12954 pub fn lookup_attr(
12955 &self,
12956 offset: usize,
12957 missing_type: Option<u16>,
12958 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
12959 let mut stack = Vec::new();
12960 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
12961 if missing_type.is_some() && cur == offset {
12962 stack.push(("IfCombinationAttributes", offset));
12963 return (
12964 stack,
12965 missing_type.and_then(|t| IfCombinationAttributes::attr_from_type(t)),
12966 );
12967 }
12968 if cur > offset || cur + self.buf.len() < offset {
12969 return (stack, None);
12970 }
12971 let mut attrs = self.clone();
12972 let mut last_off = cur + attrs.pos;
12973 let mut missing = None;
12974 while let Some(attr) = attrs.next() {
12975 let Ok(attr) = attr else { break };
12976 match attr {
12977 IfCombinationAttributes::Limits(val) => {
12978 for entry in val {
12979 let Ok(attr) = entry else { break };
12980 (stack, missing) = attr.lookup_attr(offset, missing_type);
12981 if !stack.is_empty() {
12982 break;
12983 }
12984 }
12985 if !stack.is_empty() {
12986 stack.push(("Limits", last_off));
12987 break;
12988 }
12989 }
12990 IfCombinationAttributes::Maxnum(val) => {
12991 if last_off == offset {
12992 stack.push(("Maxnum", last_off));
12993 break;
12994 }
12995 }
12996 IfCombinationAttributes::StaApBiMatch(val) => {
12997 if last_off == offset {
12998 stack.push(("StaApBiMatch", last_off));
12999 break;
13000 }
13001 }
13002 IfCombinationAttributes::NumChannels(val) => {
13003 if last_off == offset {
13004 stack.push(("NumChannels", last_off));
13005 break;
13006 }
13007 }
13008 IfCombinationAttributes::RadarDetectWidths(val) => {
13009 if last_off == offset {
13010 stack.push(("RadarDetectWidths", last_off));
13011 break;
13012 }
13013 }
13014 IfCombinationAttributes::RadarDetectRegions(val) => {
13015 if last_off == offset {
13016 stack.push(("RadarDetectRegions", last_off));
13017 break;
13018 }
13019 }
13020 IfCombinationAttributes::BiMinGcd(val) => {
13021 if last_off == offset {
13022 stack.push(("BiMinGcd", last_off));
13023 break;
13024 }
13025 }
13026 _ => {}
13027 };
13028 last_off = cur + attrs.pos;
13029 }
13030 if !stack.is_empty() {
13031 stack.push(("IfCombinationAttributes", cur));
13032 }
13033 (stack, missing)
13034 }
13035}
13036#[derive(Clone)]
13037pub enum IfaceLimitAttributes<'a> {
13038 Max(u32),
13039 Types(IterableSupportedIftypes<'a>),
13040}
13041impl<'a> IterableIfaceLimitAttributes<'a> {
13042 pub fn get_max(&self) -> Result<u32, ErrorContext> {
13043 let mut iter = self.clone();
13044 iter.pos = 0;
13045 for attr in iter {
13046 if let Ok(IfaceLimitAttributes::Max(val)) = attr {
13047 return Ok(val);
13048 }
13049 }
13050 Err(ErrorContext::new_missing(
13051 "IfaceLimitAttributes",
13052 "Max",
13053 self.orig_loc,
13054 self.buf.as_ptr() as usize,
13055 ))
13056 }
13057 pub fn get_types(&self) -> Result<IterableSupportedIftypes<'a>, ErrorContext> {
13058 let mut iter = self.clone();
13059 iter.pos = 0;
13060 for attr in iter {
13061 if let Ok(IfaceLimitAttributes::Types(val)) = attr {
13062 return Ok(val);
13063 }
13064 }
13065 Err(ErrorContext::new_missing(
13066 "IfaceLimitAttributes",
13067 "Types",
13068 self.orig_loc,
13069 self.buf.as_ptr() as usize,
13070 ))
13071 }
13072}
13073impl IfaceLimitAttributes<'_> {
13074 pub fn new<'a>(buf: &'a [u8]) -> IterableIfaceLimitAttributes<'a> {
13075 IterableIfaceLimitAttributes::with_loc(buf, buf.as_ptr() as usize)
13076 }
13077 fn attr_from_type(r#type: u16) -> Option<&'static str> {
13078 let res = match r#type {
13079 1u16 => "Max",
13080 2u16 => "Types",
13081 _ => return None,
13082 };
13083 Some(res)
13084 }
13085}
13086#[derive(Clone, Copy, Default)]
13087pub struct IterableIfaceLimitAttributes<'a> {
13088 buf: &'a [u8],
13089 pos: usize,
13090 orig_loc: usize,
13091}
13092impl<'a> IterableIfaceLimitAttributes<'a> {
13093 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13094 Self {
13095 buf,
13096 pos: 0,
13097 orig_loc,
13098 }
13099 }
13100 pub fn get_buf(&self) -> &'a [u8] {
13101 self.buf
13102 }
13103}
13104impl<'a> Iterator for IterableIfaceLimitAttributes<'a> {
13105 type Item = Result<IfaceLimitAttributes<'a>, ErrorContext>;
13106 fn next(&mut self) -> Option<Self::Item> {
13107 let mut pos;
13108 let mut r#type;
13109 loop {
13110 pos = self.pos;
13111 r#type = None;
13112 if self.buf.len() == self.pos {
13113 return None;
13114 }
13115 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13116 self.pos = self.buf.len();
13117 break;
13118 };
13119 r#type = Some(header.r#type);
13120 let res = match header.r#type {
13121 1u16 => IfaceLimitAttributes::Max({
13122 let res = parse_u32(next);
13123 let Some(val) = res else { break };
13124 val
13125 }),
13126 2u16 => IfaceLimitAttributes::Types({
13127 let res = Some(IterableSupportedIftypes::with_loc(next, self.orig_loc));
13128 let Some(val) = res else { break };
13129 val
13130 }),
13131 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13132 n => continue,
13133 };
13134 return Some(Ok(res));
13135 }
13136 Some(Err(ErrorContext::new(
13137 "IfaceLimitAttributes",
13138 r#type.and_then(|t| IfaceLimitAttributes::attr_from_type(t)),
13139 self.orig_loc,
13140 self.buf.as_ptr().wrapping_add(pos) as usize,
13141 )))
13142 }
13143}
13144impl<'a> std::fmt::Debug for IterableIfaceLimitAttributes<'_> {
13145 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13146 let mut fmt = f.debug_struct("IfaceLimitAttributes");
13147 for attr in self.clone() {
13148 let attr = match attr {
13149 Ok(a) => a,
13150 Err(err) => {
13151 fmt.finish()?;
13152 f.write_str("Err(")?;
13153 err.fmt(f)?;
13154 return f.write_str(")");
13155 }
13156 };
13157 match attr {
13158 IfaceLimitAttributes::Max(val) => fmt.field("Max", &val),
13159 IfaceLimitAttributes::Types(val) => fmt.field("Types", &val),
13160 };
13161 }
13162 fmt.finish()
13163 }
13164}
13165impl IterableIfaceLimitAttributes<'_> {
13166 pub fn lookup_attr(
13167 &self,
13168 offset: usize,
13169 missing_type: Option<u16>,
13170 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
13171 let mut stack = Vec::new();
13172 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
13173 if missing_type.is_some() && cur == offset {
13174 stack.push(("IfaceLimitAttributes", offset));
13175 return (
13176 stack,
13177 missing_type.and_then(|t| IfaceLimitAttributes::attr_from_type(t)),
13178 );
13179 }
13180 if cur > offset || cur + self.buf.len() < offset {
13181 return (stack, None);
13182 }
13183 let mut attrs = self.clone();
13184 let mut last_off = cur + attrs.pos;
13185 let mut missing = None;
13186 while let Some(attr) = attrs.next() {
13187 let Ok(attr) = attr else { break };
13188 match attr {
13189 IfaceLimitAttributes::Max(val) => {
13190 if last_off == offset {
13191 stack.push(("Max", last_off));
13192 break;
13193 }
13194 }
13195 IfaceLimitAttributes::Types(val) => {
13196 (stack, missing) = val.lookup_attr(offset, missing_type);
13197 if !stack.is_empty() {
13198 break;
13199 }
13200 }
13201 _ => {}
13202 };
13203 last_off = cur + attrs.pos;
13204 }
13205 if !stack.is_empty() {
13206 stack.push(("IfaceLimitAttributes", cur));
13207 }
13208 (stack, missing)
13209 }
13210}
13211#[derive(Clone)]
13212pub enum IftypeDataAttrs<'a> {
13213 Iftypes(&'a [u8]),
13214 HeCapMac(&'a [u8]),
13215 HeCapPhy(&'a [u8]),
13216 HeCapMcsSet(&'a [u8]),
13217 HeCapPpe(&'a [u8]),
13218 He6ghzCapa(&'a [u8]),
13219 VendorElems(&'a [u8]),
13220 EhtCapMac(&'a [u8]),
13221 EhtCapPhy(&'a [u8]),
13222 EhtCapMcsSet(&'a [u8]),
13223 EhtCapPpe(&'a [u8]),
13224}
13225impl<'a> IterableIftypeDataAttrs<'a> {
13226 pub fn get_iftypes(&self) -> Result<&'a [u8], ErrorContext> {
13227 let mut iter = self.clone();
13228 iter.pos = 0;
13229 for attr in iter {
13230 if let Ok(IftypeDataAttrs::Iftypes(val)) = attr {
13231 return Ok(val);
13232 }
13233 }
13234 Err(ErrorContext::new_missing(
13235 "IftypeDataAttrs",
13236 "Iftypes",
13237 self.orig_loc,
13238 self.buf.as_ptr() as usize,
13239 ))
13240 }
13241 pub fn get_he_cap_mac(&self) -> Result<&'a [u8], ErrorContext> {
13242 let mut iter = self.clone();
13243 iter.pos = 0;
13244 for attr in iter {
13245 if let Ok(IftypeDataAttrs::HeCapMac(val)) = attr {
13246 return Ok(val);
13247 }
13248 }
13249 Err(ErrorContext::new_missing(
13250 "IftypeDataAttrs",
13251 "HeCapMac",
13252 self.orig_loc,
13253 self.buf.as_ptr() as usize,
13254 ))
13255 }
13256 pub fn get_he_cap_phy(&self) -> Result<&'a [u8], ErrorContext> {
13257 let mut iter = self.clone();
13258 iter.pos = 0;
13259 for attr in iter {
13260 if let Ok(IftypeDataAttrs::HeCapPhy(val)) = attr {
13261 return Ok(val);
13262 }
13263 }
13264 Err(ErrorContext::new_missing(
13265 "IftypeDataAttrs",
13266 "HeCapPhy",
13267 self.orig_loc,
13268 self.buf.as_ptr() as usize,
13269 ))
13270 }
13271 pub fn get_he_cap_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
13272 let mut iter = self.clone();
13273 iter.pos = 0;
13274 for attr in iter {
13275 if let Ok(IftypeDataAttrs::HeCapMcsSet(val)) = attr {
13276 return Ok(val);
13277 }
13278 }
13279 Err(ErrorContext::new_missing(
13280 "IftypeDataAttrs",
13281 "HeCapMcsSet",
13282 self.orig_loc,
13283 self.buf.as_ptr() as usize,
13284 ))
13285 }
13286 pub fn get_he_cap_ppe(&self) -> Result<&'a [u8], ErrorContext> {
13287 let mut iter = self.clone();
13288 iter.pos = 0;
13289 for attr in iter {
13290 if let Ok(IftypeDataAttrs::HeCapPpe(val)) = attr {
13291 return Ok(val);
13292 }
13293 }
13294 Err(ErrorContext::new_missing(
13295 "IftypeDataAttrs",
13296 "HeCapPpe",
13297 self.orig_loc,
13298 self.buf.as_ptr() as usize,
13299 ))
13300 }
13301 pub fn get_he_6ghz_capa(&self) -> Result<&'a [u8], ErrorContext> {
13302 let mut iter = self.clone();
13303 iter.pos = 0;
13304 for attr in iter {
13305 if let Ok(IftypeDataAttrs::He6ghzCapa(val)) = attr {
13306 return Ok(val);
13307 }
13308 }
13309 Err(ErrorContext::new_missing(
13310 "IftypeDataAttrs",
13311 "He6ghzCapa",
13312 self.orig_loc,
13313 self.buf.as_ptr() as usize,
13314 ))
13315 }
13316 pub fn get_vendor_elems(&self) -> Result<&'a [u8], ErrorContext> {
13317 let mut iter = self.clone();
13318 iter.pos = 0;
13319 for attr in iter {
13320 if let Ok(IftypeDataAttrs::VendorElems(val)) = attr {
13321 return Ok(val);
13322 }
13323 }
13324 Err(ErrorContext::new_missing(
13325 "IftypeDataAttrs",
13326 "VendorElems",
13327 self.orig_loc,
13328 self.buf.as_ptr() as usize,
13329 ))
13330 }
13331 pub fn get_eht_cap_mac(&self) -> Result<&'a [u8], ErrorContext> {
13332 let mut iter = self.clone();
13333 iter.pos = 0;
13334 for attr in iter {
13335 if let Ok(IftypeDataAttrs::EhtCapMac(val)) = attr {
13336 return Ok(val);
13337 }
13338 }
13339 Err(ErrorContext::new_missing(
13340 "IftypeDataAttrs",
13341 "EhtCapMac",
13342 self.orig_loc,
13343 self.buf.as_ptr() as usize,
13344 ))
13345 }
13346 pub fn get_eht_cap_phy(&self) -> Result<&'a [u8], ErrorContext> {
13347 let mut iter = self.clone();
13348 iter.pos = 0;
13349 for attr in iter {
13350 if let Ok(IftypeDataAttrs::EhtCapPhy(val)) = attr {
13351 return Ok(val);
13352 }
13353 }
13354 Err(ErrorContext::new_missing(
13355 "IftypeDataAttrs",
13356 "EhtCapPhy",
13357 self.orig_loc,
13358 self.buf.as_ptr() as usize,
13359 ))
13360 }
13361 pub fn get_eht_cap_mcs_set(&self) -> Result<&'a [u8], ErrorContext> {
13362 let mut iter = self.clone();
13363 iter.pos = 0;
13364 for attr in iter {
13365 if let Ok(IftypeDataAttrs::EhtCapMcsSet(val)) = attr {
13366 return Ok(val);
13367 }
13368 }
13369 Err(ErrorContext::new_missing(
13370 "IftypeDataAttrs",
13371 "EhtCapMcsSet",
13372 self.orig_loc,
13373 self.buf.as_ptr() as usize,
13374 ))
13375 }
13376 pub fn get_eht_cap_ppe(&self) -> Result<&'a [u8], ErrorContext> {
13377 let mut iter = self.clone();
13378 iter.pos = 0;
13379 for attr in iter {
13380 if let Ok(IftypeDataAttrs::EhtCapPpe(val)) = attr {
13381 return Ok(val);
13382 }
13383 }
13384 Err(ErrorContext::new_missing(
13385 "IftypeDataAttrs",
13386 "EhtCapPpe",
13387 self.orig_loc,
13388 self.buf.as_ptr() as usize,
13389 ))
13390 }
13391}
13392impl IftypeDataAttrs<'_> {
13393 pub fn new<'a>(buf: &'a [u8]) -> IterableIftypeDataAttrs<'a> {
13394 IterableIftypeDataAttrs::with_loc(buf, buf.as_ptr() as usize)
13395 }
13396 fn attr_from_type(r#type: u16) -> Option<&'static str> {
13397 let res = match r#type {
13398 1u16 => "Iftypes",
13399 2u16 => "HeCapMac",
13400 3u16 => "HeCapPhy",
13401 4u16 => "HeCapMcsSet",
13402 5u16 => "HeCapPpe",
13403 6u16 => "He6ghzCapa",
13404 7u16 => "VendorElems",
13405 8u16 => "EhtCapMac",
13406 9u16 => "EhtCapPhy",
13407 10u16 => "EhtCapMcsSet",
13408 11u16 => "EhtCapPpe",
13409 _ => return None,
13410 };
13411 Some(res)
13412 }
13413}
13414#[derive(Clone, Copy, Default)]
13415pub struct IterableIftypeDataAttrs<'a> {
13416 buf: &'a [u8],
13417 pos: usize,
13418 orig_loc: usize,
13419}
13420impl<'a> IterableIftypeDataAttrs<'a> {
13421 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13422 Self {
13423 buf,
13424 pos: 0,
13425 orig_loc,
13426 }
13427 }
13428 pub fn get_buf(&self) -> &'a [u8] {
13429 self.buf
13430 }
13431}
13432impl<'a> Iterator for IterableIftypeDataAttrs<'a> {
13433 type Item = Result<IftypeDataAttrs<'a>, ErrorContext>;
13434 fn next(&mut self) -> Option<Self::Item> {
13435 let mut pos;
13436 let mut r#type;
13437 loop {
13438 pos = self.pos;
13439 r#type = None;
13440 if self.buf.len() == self.pos {
13441 return None;
13442 }
13443 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13444 self.pos = self.buf.len();
13445 break;
13446 };
13447 r#type = Some(header.r#type);
13448 let res = match header.r#type {
13449 1u16 => IftypeDataAttrs::Iftypes({
13450 let res = Some(next);
13451 let Some(val) = res else { break };
13452 val
13453 }),
13454 2u16 => IftypeDataAttrs::HeCapMac({
13455 let res = Some(next);
13456 let Some(val) = res else { break };
13457 val
13458 }),
13459 3u16 => IftypeDataAttrs::HeCapPhy({
13460 let res = Some(next);
13461 let Some(val) = res else { break };
13462 val
13463 }),
13464 4u16 => IftypeDataAttrs::HeCapMcsSet({
13465 let res = Some(next);
13466 let Some(val) = res else { break };
13467 val
13468 }),
13469 5u16 => IftypeDataAttrs::HeCapPpe({
13470 let res = Some(next);
13471 let Some(val) = res else { break };
13472 val
13473 }),
13474 6u16 => IftypeDataAttrs::He6ghzCapa({
13475 let res = Some(next);
13476 let Some(val) = res else { break };
13477 val
13478 }),
13479 7u16 => IftypeDataAttrs::VendorElems({
13480 let res = Some(next);
13481 let Some(val) = res else { break };
13482 val
13483 }),
13484 8u16 => IftypeDataAttrs::EhtCapMac({
13485 let res = Some(next);
13486 let Some(val) = res else { break };
13487 val
13488 }),
13489 9u16 => IftypeDataAttrs::EhtCapPhy({
13490 let res = Some(next);
13491 let Some(val) = res else { break };
13492 val
13493 }),
13494 10u16 => IftypeDataAttrs::EhtCapMcsSet({
13495 let res = Some(next);
13496 let Some(val) = res else { break };
13497 val
13498 }),
13499 11u16 => IftypeDataAttrs::EhtCapPpe({
13500 let res = Some(next);
13501 let Some(val) = res else { break };
13502 val
13503 }),
13504 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13505 n => continue,
13506 };
13507 return Some(Ok(res));
13508 }
13509 Some(Err(ErrorContext::new(
13510 "IftypeDataAttrs",
13511 r#type.and_then(|t| IftypeDataAttrs::attr_from_type(t)),
13512 self.orig_loc,
13513 self.buf.as_ptr().wrapping_add(pos) as usize,
13514 )))
13515 }
13516}
13517impl<'a> std::fmt::Debug for IterableIftypeDataAttrs<'_> {
13518 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13519 let mut fmt = f.debug_struct("IftypeDataAttrs");
13520 for attr in self.clone() {
13521 let attr = match attr {
13522 Ok(a) => a,
13523 Err(err) => {
13524 fmt.finish()?;
13525 f.write_str("Err(")?;
13526 err.fmt(f)?;
13527 return f.write_str(")");
13528 }
13529 };
13530 match attr {
13531 IftypeDataAttrs::Iftypes(val) => fmt.field("Iftypes", &val),
13532 IftypeDataAttrs::HeCapMac(val) => fmt.field("HeCapMac", &val),
13533 IftypeDataAttrs::HeCapPhy(val) => fmt.field("HeCapPhy", &val),
13534 IftypeDataAttrs::HeCapMcsSet(val) => fmt.field("HeCapMcsSet", &val),
13535 IftypeDataAttrs::HeCapPpe(val) => fmt.field("HeCapPpe", &val),
13536 IftypeDataAttrs::He6ghzCapa(val) => fmt.field("He6ghzCapa", &val),
13537 IftypeDataAttrs::VendorElems(val) => fmt.field("VendorElems", &val),
13538 IftypeDataAttrs::EhtCapMac(val) => fmt.field("EhtCapMac", &val),
13539 IftypeDataAttrs::EhtCapPhy(val) => fmt.field("EhtCapPhy", &val),
13540 IftypeDataAttrs::EhtCapMcsSet(val) => fmt.field("EhtCapMcsSet", &val),
13541 IftypeDataAttrs::EhtCapPpe(val) => fmt.field("EhtCapPpe", &val),
13542 };
13543 }
13544 fmt.finish()
13545 }
13546}
13547impl IterableIftypeDataAttrs<'_> {
13548 pub fn lookup_attr(
13549 &self,
13550 offset: usize,
13551 missing_type: Option<u16>,
13552 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
13553 let mut stack = Vec::new();
13554 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
13555 if missing_type.is_some() && cur == offset {
13556 stack.push(("IftypeDataAttrs", offset));
13557 return (
13558 stack,
13559 missing_type.and_then(|t| IftypeDataAttrs::attr_from_type(t)),
13560 );
13561 }
13562 if cur > offset || cur + self.buf.len() < offset {
13563 return (stack, None);
13564 }
13565 let mut attrs = self.clone();
13566 let mut last_off = cur + attrs.pos;
13567 while let Some(attr) = attrs.next() {
13568 let Ok(attr) = attr else { break };
13569 match attr {
13570 IftypeDataAttrs::Iftypes(val) => {
13571 if last_off == offset {
13572 stack.push(("Iftypes", last_off));
13573 break;
13574 }
13575 }
13576 IftypeDataAttrs::HeCapMac(val) => {
13577 if last_off == offset {
13578 stack.push(("HeCapMac", last_off));
13579 break;
13580 }
13581 }
13582 IftypeDataAttrs::HeCapPhy(val) => {
13583 if last_off == offset {
13584 stack.push(("HeCapPhy", last_off));
13585 break;
13586 }
13587 }
13588 IftypeDataAttrs::HeCapMcsSet(val) => {
13589 if last_off == offset {
13590 stack.push(("HeCapMcsSet", last_off));
13591 break;
13592 }
13593 }
13594 IftypeDataAttrs::HeCapPpe(val) => {
13595 if last_off == offset {
13596 stack.push(("HeCapPpe", last_off));
13597 break;
13598 }
13599 }
13600 IftypeDataAttrs::He6ghzCapa(val) => {
13601 if last_off == offset {
13602 stack.push(("He6ghzCapa", last_off));
13603 break;
13604 }
13605 }
13606 IftypeDataAttrs::VendorElems(val) => {
13607 if last_off == offset {
13608 stack.push(("VendorElems", last_off));
13609 break;
13610 }
13611 }
13612 IftypeDataAttrs::EhtCapMac(val) => {
13613 if last_off == offset {
13614 stack.push(("EhtCapMac", last_off));
13615 break;
13616 }
13617 }
13618 IftypeDataAttrs::EhtCapPhy(val) => {
13619 if last_off == offset {
13620 stack.push(("EhtCapPhy", last_off));
13621 break;
13622 }
13623 }
13624 IftypeDataAttrs::EhtCapMcsSet(val) => {
13625 if last_off == offset {
13626 stack.push(("EhtCapMcsSet", last_off));
13627 break;
13628 }
13629 }
13630 IftypeDataAttrs::EhtCapPpe(val) => {
13631 if last_off == offset {
13632 stack.push(("EhtCapPpe", last_off));
13633 break;
13634 }
13635 }
13636 _ => {}
13637 };
13638 last_off = cur + attrs.pos;
13639 }
13640 if !stack.is_empty() {
13641 stack.push(("IftypeDataAttrs", cur));
13642 }
13643 (stack, None)
13644 }
13645}
13646#[derive(Clone)]
13647pub enum IftypeAttrs<'a> {
13648 Unspecified(IterableFrameTypeAttrs<'a>),
13649 Adhoc(IterableFrameTypeAttrs<'a>),
13650 Station(IterableFrameTypeAttrs<'a>),
13651 Ap(IterableFrameTypeAttrs<'a>),
13652 ApVlan(IterableFrameTypeAttrs<'a>),
13653 Wds(IterableFrameTypeAttrs<'a>),
13654 Monitor(IterableFrameTypeAttrs<'a>),
13655 MeshPoint(IterableFrameTypeAttrs<'a>),
13656 P2pClient(IterableFrameTypeAttrs<'a>),
13657 P2pGo(IterableFrameTypeAttrs<'a>),
13658 P2pDevice(IterableFrameTypeAttrs<'a>),
13659 Ocb(IterableFrameTypeAttrs<'a>),
13660 Nan(IterableFrameTypeAttrs<'a>),
13661}
13662impl<'a> IterableIftypeAttrs<'a> {
13663 pub fn get_unspecified(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13664 let mut iter = self.clone();
13665 iter.pos = 0;
13666 for attr in iter {
13667 if let Ok(IftypeAttrs::Unspecified(val)) = attr {
13668 return Ok(val);
13669 }
13670 }
13671 Err(ErrorContext::new_missing(
13672 "IftypeAttrs",
13673 "Unspecified",
13674 self.orig_loc,
13675 self.buf.as_ptr() as usize,
13676 ))
13677 }
13678 pub fn get_adhoc(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13679 let mut iter = self.clone();
13680 iter.pos = 0;
13681 for attr in iter {
13682 if let Ok(IftypeAttrs::Adhoc(val)) = attr {
13683 return Ok(val);
13684 }
13685 }
13686 Err(ErrorContext::new_missing(
13687 "IftypeAttrs",
13688 "Adhoc",
13689 self.orig_loc,
13690 self.buf.as_ptr() as usize,
13691 ))
13692 }
13693 pub fn get_station(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13694 let mut iter = self.clone();
13695 iter.pos = 0;
13696 for attr in iter {
13697 if let Ok(IftypeAttrs::Station(val)) = attr {
13698 return Ok(val);
13699 }
13700 }
13701 Err(ErrorContext::new_missing(
13702 "IftypeAttrs",
13703 "Station",
13704 self.orig_loc,
13705 self.buf.as_ptr() as usize,
13706 ))
13707 }
13708 pub fn get_ap(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13709 let mut iter = self.clone();
13710 iter.pos = 0;
13711 for attr in iter {
13712 if let Ok(IftypeAttrs::Ap(val)) = attr {
13713 return Ok(val);
13714 }
13715 }
13716 Err(ErrorContext::new_missing(
13717 "IftypeAttrs",
13718 "Ap",
13719 self.orig_loc,
13720 self.buf.as_ptr() as usize,
13721 ))
13722 }
13723 pub fn get_ap_vlan(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13724 let mut iter = self.clone();
13725 iter.pos = 0;
13726 for attr in iter {
13727 if let Ok(IftypeAttrs::ApVlan(val)) = attr {
13728 return Ok(val);
13729 }
13730 }
13731 Err(ErrorContext::new_missing(
13732 "IftypeAttrs",
13733 "ApVlan",
13734 self.orig_loc,
13735 self.buf.as_ptr() as usize,
13736 ))
13737 }
13738 pub fn get_wds(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13739 let mut iter = self.clone();
13740 iter.pos = 0;
13741 for attr in iter {
13742 if let Ok(IftypeAttrs::Wds(val)) = attr {
13743 return Ok(val);
13744 }
13745 }
13746 Err(ErrorContext::new_missing(
13747 "IftypeAttrs",
13748 "Wds",
13749 self.orig_loc,
13750 self.buf.as_ptr() as usize,
13751 ))
13752 }
13753 pub fn get_monitor(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13754 let mut iter = self.clone();
13755 iter.pos = 0;
13756 for attr in iter {
13757 if let Ok(IftypeAttrs::Monitor(val)) = attr {
13758 return Ok(val);
13759 }
13760 }
13761 Err(ErrorContext::new_missing(
13762 "IftypeAttrs",
13763 "Monitor",
13764 self.orig_loc,
13765 self.buf.as_ptr() as usize,
13766 ))
13767 }
13768 pub fn get_mesh_point(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13769 let mut iter = self.clone();
13770 iter.pos = 0;
13771 for attr in iter {
13772 if let Ok(IftypeAttrs::MeshPoint(val)) = attr {
13773 return Ok(val);
13774 }
13775 }
13776 Err(ErrorContext::new_missing(
13777 "IftypeAttrs",
13778 "MeshPoint",
13779 self.orig_loc,
13780 self.buf.as_ptr() as usize,
13781 ))
13782 }
13783 pub fn get_p2p_client(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13784 let mut iter = self.clone();
13785 iter.pos = 0;
13786 for attr in iter {
13787 if let Ok(IftypeAttrs::P2pClient(val)) = attr {
13788 return Ok(val);
13789 }
13790 }
13791 Err(ErrorContext::new_missing(
13792 "IftypeAttrs",
13793 "P2pClient",
13794 self.orig_loc,
13795 self.buf.as_ptr() as usize,
13796 ))
13797 }
13798 pub fn get_p2p_go(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13799 let mut iter = self.clone();
13800 iter.pos = 0;
13801 for attr in iter {
13802 if let Ok(IftypeAttrs::P2pGo(val)) = attr {
13803 return Ok(val);
13804 }
13805 }
13806 Err(ErrorContext::new_missing(
13807 "IftypeAttrs",
13808 "P2pGo",
13809 self.orig_loc,
13810 self.buf.as_ptr() as usize,
13811 ))
13812 }
13813 pub fn get_p2p_device(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13814 let mut iter = self.clone();
13815 iter.pos = 0;
13816 for attr in iter {
13817 if let Ok(IftypeAttrs::P2pDevice(val)) = attr {
13818 return Ok(val);
13819 }
13820 }
13821 Err(ErrorContext::new_missing(
13822 "IftypeAttrs",
13823 "P2pDevice",
13824 self.orig_loc,
13825 self.buf.as_ptr() as usize,
13826 ))
13827 }
13828 pub fn get_ocb(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13829 let mut iter = self.clone();
13830 iter.pos = 0;
13831 for attr in iter {
13832 if let Ok(IftypeAttrs::Ocb(val)) = attr {
13833 return Ok(val);
13834 }
13835 }
13836 Err(ErrorContext::new_missing(
13837 "IftypeAttrs",
13838 "Ocb",
13839 self.orig_loc,
13840 self.buf.as_ptr() as usize,
13841 ))
13842 }
13843 pub fn get_nan(&self) -> Result<IterableFrameTypeAttrs<'a>, ErrorContext> {
13844 let mut iter = self.clone();
13845 iter.pos = 0;
13846 for attr in iter {
13847 if let Ok(IftypeAttrs::Nan(val)) = attr {
13848 return Ok(val);
13849 }
13850 }
13851 Err(ErrorContext::new_missing(
13852 "IftypeAttrs",
13853 "Nan",
13854 self.orig_loc,
13855 self.buf.as_ptr() as usize,
13856 ))
13857 }
13858}
13859impl IftypeAttrs<'_> {
13860 pub fn new<'a>(buf: &'a [u8]) -> IterableIftypeAttrs<'a> {
13861 IterableIftypeAttrs::with_loc(buf, buf.as_ptr() as usize)
13862 }
13863 fn attr_from_type(r#type: u16) -> Option<&'static str> {
13864 let res = match r#type {
13865 0u16 => "Unspecified",
13866 1u16 => "Adhoc",
13867 2u16 => "Station",
13868 3u16 => "Ap",
13869 4u16 => "ApVlan",
13870 5u16 => "Wds",
13871 6u16 => "Monitor",
13872 7u16 => "MeshPoint",
13873 8u16 => "P2pClient",
13874 9u16 => "P2pGo",
13875 10u16 => "P2pDevice",
13876 11u16 => "Ocb",
13877 12u16 => "Nan",
13878 _ => return None,
13879 };
13880 Some(res)
13881 }
13882}
13883#[derive(Clone, Copy, Default)]
13884pub struct IterableIftypeAttrs<'a> {
13885 buf: &'a [u8],
13886 pos: usize,
13887 orig_loc: usize,
13888}
13889impl<'a> IterableIftypeAttrs<'a> {
13890 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
13891 Self {
13892 buf,
13893 pos: 0,
13894 orig_loc,
13895 }
13896 }
13897 pub fn get_buf(&self) -> &'a [u8] {
13898 self.buf
13899 }
13900}
13901impl<'a> Iterator for IterableIftypeAttrs<'a> {
13902 type Item = Result<IftypeAttrs<'a>, ErrorContext>;
13903 fn next(&mut self) -> Option<Self::Item> {
13904 let mut pos;
13905 let mut r#type;
13906 loop {
13907 pos = self.pos;
13908 r#type = None;
13909 if self.buf.len() == self.pos {
13910 return None;
13911 }
13912 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
13913 self.pos = self.buf.len();
13914 break;
13915 };
13916 r#type = Some(header.r#type);
13917 let res = match header.r#type {
13918 0u16 => IftypeAttrs::Unspecified({
13919 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13920 let Some(val) = res else { break };
13921 val
13922 }),
13923 1u16 => IftypeAttrs::Adhoc({
13924 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13925 let Some(val) = res else { break };
13926 val
13927 }),
13928 2u16 => IftypeAttrs::Station({
13929 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13930 let Some(val) = res else { break };
13931 val
13932 }),
13933 3u16 => IftypeAttrs::Ap({
13934 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13935 let Some(val) = res else { break };
13936 val
13937 }),
13938 4u16 => IftypeAttrs::ApVlan({
13939 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13940 let Some(val) = res else { break };
13941 val
13942 }),
13943 5u16 => IftypeAttrs::Wds({
13944 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13945 let Some(val) = res else { break };
13946 val
13947 }),
13948 6u16 => IftypeAttrs::Monitor({
13949 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13950 let Some(val) = res else { break };
13951 val
13952 }),
13953 7u16 => IftypeAttrs::MeshPoint({
13954 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13955 let Some(val) = res else { break };
13956 val
13957 }),
13958 8u16 => IftypeAttrs::P2pClient({
13959 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13960 let Some(val) = res else { break };
13961 val
13962 }),
13963 9u16 => IftypeAttrs::P2pGo({
13964 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13965 let Some(val) = res else { break };
13966 val
13967 }),
13968 10u16 => IftypeAttrs::P2pDevice({
13969 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13970 let Some(val) = res else { break };
13971 val
13972 }),
13973 11u16 => IftypeAttrs::Ocb({
13974 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13975 let Some(val) = res else { break };
13976 val
13977 }),
13978 12u16 => IftypeAttrs::Nan({
13979 let res = Some(IterableFrameTypeAttrs::with_loc(next, self.orig_loc));
13980 let Some(val) = res else { break };
13981 val
13982 }),
13983 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
13984 n => continue,
13985 };
13986 return Some(Ok(res));
13987 }
13988 Some(Err(ErrorContext::new(
13989 "IftypeAttrs",
13990 r#type.and_then(|t| IftypeAttrs::attr_from_type(t)),
13991 self.orig_loc,
13992 self.buf.as_ptr().wrapping_add(pos) as usize,
13993 )))
13994 }
13995}
13996impl<'a> std::fmt::Debug for IterableIftypeAttrs<'_> {
13997 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13998 let mut fmt = f.debug_struct("IftypeAttrs");
13999 for attr in self.clone() {
14000 let attr = match attr {
14001 Ok(a) => a,
14002 Err(err) => {
14003 fmt.finish()?;
14004 f.write_str("Err(")?;
14005 err.fmt(f)?;
14006 return f.write_str(")");
14007 }
14008 };
14009 match attr {
14010 IftypeAttrs::Unspecified(val) => fmt.field("Unspecified", &val),
14011 IftypeAttrs::Adhoc(val) => fmt.field("Adhoc", &val),
14012 IftypeAttrs::Station(val) => fmt.field("Station", &val),
14013 IftypeAttrs::Ap(val) => fmt.field("Ap", &val),
14014 IftypeAttrs::ApVlan(val) => fmt.field("ApVlan", &val),
14015 IftypeAttrs::Wds(val) => fmt.field("Wds", &val),
14016 IftypeAttrs::Monitor(val) => fmt.field("Monitor", &val),
14017 IftypeAttrs::MeshPoint(val) => fmt.field("MeshPoint", &val),
14018 IftypeAttrs::P2pClient(val) => fmt.field("P2pClient", &val),
14019 IftypeAttrs::P2pGo(val) => fmt.field("P2pGo", &val),
14020 IftypeAttrs::P2pDevice(val) => fmt.field("P2pDevice", &val),
14021 IftypeAttrs::Ocb(val) => fmt.field("Ocb", &val),
14022 IftypeAttrs::Nan(val) => fmt.field("Nan", &val),
14023 };
14024 }
14025 fmt.finish()
14026 }
14027}
14028impl IterableIftypeAttrs<'_> {
14029 pub fn lookup_attr(
14030 &self,
14031 offset: usize,
14032 missing_type: Option<u16>,
14033 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14034 let mut stack = Vec::new();
14035 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14036 if missing_type.is_some() && cur == offset {
14037 stack.push(("IftypeAttrs", offset));
14038 return (
14039 stack,
14040 missing_type.and_then(|t| IftypeAttrs::attr_from_type(t)),
14041 );
14042 }
14043 if cur > offset || cur + self.buf.len() < offset {
14044 return (stack, None);
14045 }
14046 let mut attrs = self.clone();
14047 let mut last_off = cur + attrs.pos;
14048 let mut missing = None;
14049 while let Some(attr) = attrs.next() {
14050 let Ok(attr) = attr else { break };
14051 match attr {
14052 IftypeAttrs::Unspecified(val) => {
14053 (stack, missing) = val.lookup_attr(offset, missing_type);
14054 if !stack.is_empty() {
14055 break;
14056 }
14057 }
14058 IftypeAttrs::Adhoc(val) => {
14059 (stack, missing) = val.lookup_attr(offset, missing_type);
14060 if !stack.is_empty() {
14061 break;
14062 }
14063 }
14064 IftypeAttrs::Station(val) => {
14065 (stack, missing) = val.lookup_attr(offset, missing_type);
14066 if !stack.is_empty() {
14067 break;
14068 }
14069 }
14070 IftypeAttrs::Ap(val) => {
14071 (stack, missing) = val.lookup_attr(offset, missing_type);
14072 if !stack.is_empty() {
14073 break;
14074 }
14075 }
14076 IftypeAttrs::ApVlan(val) => {
14077 (stack, missing) = val.lookup_attr(offset, missing_type);
14078 if !stack.is_empty() {
14079 break;
14080 }
14081 }
14082 IftypeAttrs::Wds(val) => {
14083 (stack, missing) = val.lookup_attr(offset, missing_type);
14084 if !stack.is_empty() {
14085 break;
14086 }
14087 }
14088 IftypeAttrs::Monitor(val) => {
14089 (stack, missing) = val.lookup_attr(offset, missing_type);
14090 if !stack.is_empty() {
14091 break;
14092 }
14093 }
14094 IftypeAttrs::MeshPoint(val) => {
14095 (stack, missing) = val.lookup_attr(offset, missing_type);
14096 if !stack.is_empty() {
14097 break;
14098 }
14099 }
14100 IftypeAttrs::P2pClient(val) => {
14101 (stack, missing) = val.lookup_attr(offset, missing_type);
14102 if !stack.is_empty() {
14103 break;
14104 }
14105 }
14106 IftypeAttrs::P2pGo(val) => {
14107 (stack, missing) = val.lookup_attr(offset, missing_type);
14108 if !stack.is_empty() {
14109 break;
14110 }
14111 }
14112 IftypeAttrs::P2pDevice(val) => {
14113 (stack, missing) = val.lookup_attr(offset, missing_type);
14114 if !stack.is_empty() {
14115 break;
14116 }
14117 }
14118 IftypeAttrs::Ocb(val) => {
14119 (stack, missing) = val.lookup_attr(offset, missing_type);
14120 if !stack.is_empty() {
14121 break;
14122 }
14123 }
14124 IftypeAttrs::Nan(val) => {
14125 (stack, missing) = val.lookup_attr(offset, missing_type);
14126 if !stack.is_empty() {
14127 break;
14128 }
14129 }
14130 _ => {}
14131 };
14132 last_off = cur + attrs.pos;
14133 }
14134 if !stack.is_empty() {
14135 stack.push(("IftypeAttrs", cur));
14136 }
14137 (stack, missing)
14138 }
14139}
14140#[derive(Clone)]
14141pub enum SarAttributes<'a> {
14142 Type(u32),
14143 Specs(IterableArraySarSpecs<'a>),
14144}
14145impl<'a> IterableSarAttributes<'a> {
14146 pub fn get_type(&self) -> Result<u32, ErrorContext> {
14147 let mut iter = self.clone();
14148 iter.pos = 0;
14149 for attr in iter {
14150 if let Ok(SarAttributes::Type(val)) = attr {
14151 return Ok(val);
14152 }
14153 }
14154 Err(ErrorContext::new_missing(
14155 "SarAttributes",
14156 "Type",
14157 self.orig_loc,
14158 self.buf.as_ptr() as usize,
14159 ))
14160 }
14161 pub fn get_specs(
14162 &self,
14163 ) -> Result<ArrayIterable<IterableArraySarSpecs<'a>, IterableSarSpecs<'a>>, ErrorContext> {
14164 for attr in self.clone() {
14165 if let Ok(SarAttributes::Specs(val)) = attr {
14166 return Ok(ArrayIterable::new(val));
14167 }
14168 }
14169 Err(ErrorContext::new_missing(
14170 "SarAttributes",
14171 "Specs",
14172 self.orig_loc,
14173 self.buf.as_ptr() as usize,
14174 ))
14175 }
14176}
14177impl SarSpecs {
14178 pub fn new_array(buf: &[u8]) -> IterableArraySarSpecs<'_> {
14179 IterableArraySarSpecs::with_loc(buf, buf.as_ptr() as usize)
14180 }
14181}
14182#[derive(Clone, Copy, Default)]
14183pub struct IterableArraySarSpecs<'a> {
14184 buf: &'a [u8],
14185 pos: usize,
14186 orig_loc: usize,
14187}
14188impl<'a> IterableArraySarSpecs<'a> {
14189 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14190 Self {
14191 buf,
14192 pos: 0,
14193 orig_loc,
14194 }
14195 }
14196 pub fn get_buf(&self) -> &'a [u8] {
14197 self.buf
14198 }
14199}
14200impl<'a> Iterator for IterableArraySarSpecs<'a> {
14201 type Item = Result<IterableSarSpecs<'a>, ErrorContext>;
14202 fn next(&mut self) -> Option<Self::Item> {
14203 if self.buf.len() == self.pos {
14204 return None;
14205 }
14206 while let Some((header, next)) = chop_header(self.buf, &mut self.pos) {
14207 {
14208 return Some(Ok(IterableSarSpecs::with_loc(next, self.orig_loc)));
14209 }
14210 }
14211 let pos = self.pos;
14212 self.pos = self.buf.len();
14213 Some(Err(ErrorContext::new(
14214 "SarSpecs",
14215 None,
14216 self.orig_loc,
14217 self.buf.as_ptr().wrapping_add(pos) as usize,
14218 )))
14219 }
14220}
14221impl SarAttributes<'_> {
14222 pub fn new<'a>(buf: &'a [u8]) -> IterableSarAttributes<'a> {
14223 IterableSarAttributes::with_loc(buf, buf.as_ptr() as usize)
14224 }
14225 fn attr_from_type(r#type: u16) -> Option<&'static str> {
14226 let res = match r#type {
14227 1u16 => "Type",
14228 2u16 => "Specs",
14229 _ => return None,
14230 };
14231 Some(res)
14232 }
14233}
14234#[derive(Clone, Copy, Default)]
14235pub struct IterableSarAttributes<'a> {
14236 buf: &'a [u8],
14237 pos: usize,
14238 orig_loc: usize,
14239}
14240impl<'a> IterableSarAttributes<'a> {
14241 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14242 Self {
14243 buf,
14244 pos: 0,
14245 orig_loc,
14246 }
14247 }
14248 pub fn get_buf(&self) -> &'a [u8] {
14249 self.buf
14250 }
14251}
14252impl<'a> Iterator for IterableSarAttributes<'a> {
14253 type Item = Result<SarAttributes<'a>, ErrorContext>;
14254 fn next(&mut self) -> Option<Self::Item> {
14255 let mut pos;
14256 let mut r#type;
14257 loop {
14258 pos = self.pos;
14259 r#type = None;
14260 if self.buf.len() == self.pos {
14261 return None;
14262 }
14263 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14264 self.pos = self.buf.len();
14265 break;
14266 };
14267 r#type = Some(header.r#type);
14268 let res = match header.r#type {
14269 1u16 => SarAttributes::Type({
14270 let res = parse_u32(next);
14271 let Some(val) = res else { break };
14272 val
14273 }),
14274 2u16 => SarAttributes::Specs({
14275 let res = Some(IterableArraySarSpecs::with_loc(next, self.orig_loc));
14276 let Some(val) = res else { break };
14277 val
14278 }),
14279 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14280 n => continue,
14281 };
14282 return Some(Ok(res));
14283 }
14284 Some(Err(ErrorContext::new(
14285 "SarAttributes",
14286 r#type.and_then(|t| SarAttributes::attr_from_type(t)),
14287 self.orig_loc,
14288 self.buf.as_ptr().wrapping_add(pos) as usize,
14289 )))
14290 }
14291}
14292impl std::fmt::Debug for IterableArraySarSpecs<'_> {
14293 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14294 fmt.debug_list()
14295 .entries(self.clone().map(FlattenErrorContext))
14296 .finish()
14297 }
14298}
14299impl<'a> std::fmt::Debug for IterableSarAttributes<'_> {
14300 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14301 let mut fmt = f.debug_struct("SarAttributes");
14302 for attr in self.clone() {
14303 let attr = match attr {
14304 Ok(a) => a,
14305 Err(err) => {
14306 fmt.finish()?;
14307 f.write_str("Err(")?;
14308 err.fmt(f)?;
14309 return f.write_str(")");
14310 }
14311 };
14312 match attr {
14313 SarAttributes::Type(val) => fmt.field("Type", &val),
14314 SarAttributes::Specs(val) => fmt.field("Specs", &val),
14315 };
14316 }
14317 fmt.finish()
14318 }
14319}
14320impl IterableSarAttributes<'_> {
14321 pub fn lookup_attr(
14322 &self,
14323 offset: usize,
14324 missing_type: Option<u16>,
14325 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14326 let mut stack = Vec::new();
14327 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14328 if missing_type.is_some() && cur == offset {
14329 stack.push(("SarAttributes", offset));
14330 return (
14331 stack,
14332 missing_type.and_then(|t| SarAttributes::attr_from_type(t)),
14333 );
14334 }
14335 if cur > offset || cur + self.buf.len() < offset {
14336 return (stack, None);
14337 }
14338 let mut attrs = self.clone();
14339 let mut last_off = cur + attrs.pos;
14340 let mut missing = None;
14341 while let Some(attr) = attrs.next() {
14342 let Ok(attr) = attr else { break };
14343 match attr {
14344 SarAttributes::Type(val) => {
14345 if last_off == offset {
14346 stack.push(("Type", last_off));
14347 break;
14348 }
14349 }
14350 SarAttributes::Specs(val) => {
14351 for entry in val {
14352 let Ok(attr) = entry else { break };
14353 (stack, missing) = attr.lookup_attr(offset, missing_type);
14354 if !stack.is_empty() {
14355 break;
14356 }
14357 }
14358 if !stack.is_empty() {
14359 stack.push(("Specs", last_off));
14360 break;
14361 }
14362 }
14363 _ => {}
14364 };
14365 last_off = cur + attrs.pos;
14366 }
14367 if !stack.is_empty() {
14368 stack.push(("SarAttributes", cur));
14369 }
14370 (stack, missing)
14371 }
14372}
14373#[derive(Clone)]
14374pub enum SarSpecs {
14375 Power(i32),
14376 RangeIndex(u32),
14377 StartFreq(u32),
14378 EndFreq(u32),
14379}
14380impl<'a> IterableSarSpecs<'a> {
14381 pub fn get_power(&self) -> Result<i32, ErrorContext> {
14382 let mut iter = self.clone();
14383 iter.pos = 0;
14384 for attr in iter {
14385 if let Ok(SarSpecs::Power(val)) = attr {
14386 return Ok(val);
14387 }
14388 }
14389 Err(ErrorContext::new_missing(
14390 "SarSpecs",
14391 "Power",
14392 self.orig_loc,
14393 self.buf.as_ptr() as usize,
14394 ))
14395 }
14396 pub fn get_range_index(&self) -> Result<u32, ErrorContext> {
14397 let mut iter = self.clone();
14398 iter.pos = 0;
14399 for attr in iter {
14400 if let Ok(SarSpecs::RangeIndex(val)) = attr {
14401 return Ok(val);
14402 }
14403 }
14404 Err(ErrorContext::new_missing(
14405 "SarSpecs",
14406 "RangeIndex",
14407 self.orig_loc,
14408 self.buf.as_ptr() as usize,
14409 ))
14410 }
14411 pub fn get_start_freq(&self) -> Result<u32, ErrorContext> {
14412 let mut iter = self.clone();
14413 iter.pos = 0;
14414 for attr in iter {
14415 if let Ok(SarSpecs::StartFreq(val)) = attr {
14416 return Ok(val);
14417 }
14418 }
14419 Err(ErrorContext::new_missing(
14420 "SarSpecs",
14421 "StartFreq",
14422 self.orig_loc,
14423 self.buf.as_ptr() as usize,
14424 ))
14425 }
14426 pub fn get_end_freq(&self) -> Result<u32, ErrorContext> {
14427 let mut iter = self.clone();
14428 iter.pos = 0;
14429 for attr in iter {
14430 if let Ok(SarSpecs::EndFreq(val)) = attr {
14431 return Ok(val);
14432 }
14433 }
14434 Err(ErrorContext::new_missing(
14435 "SarSpecs",
14436 "EndFreq",
14437 self.orig_loc,
14438 self.buf.as_ptr() as usize,
14439 ))
14440 }
14441}
14442impl SarSpecs {
14443 pub fn new<'a>(buf: &'a [u8]) -> IterableSarSpecs<'a> {
14444 IterableSarSpecs::with_loc(buf, buf.as_ptr() as usize)
14445 }
14446 fn attr_from_type(r#type: u16) -> Option<&'static str> {
14447 let res = match r#type {
14448 1u16 => "Power",
14449 2u16 => "RangeIndex",
14450 3u16 => "StartFreq",
14451 4u16 => "EndFreq",
14452 _ => return None,
14453 };
14454 Some(res)
14455 }
14456}
14457#[derive(Clone, Copy, Default)]
14458pub struct IterableSarSpecs<'a> {
14459 buf: &'a [u8],
14460 pos: usize,
14461 orig_loc: usize,
14462}
14463impl<'a> IterableSarSpecs<'a> {
14464 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14465 Self {
14466 buf,
14467 pos: 0,
14468 orig_loc,
14469 }
14470 }
14471 pub fn get_buf(&self) -> &'a [u8] {
14472 self.buf
14473 }
14474}
14475impl<'a> Iterator for IterableSarSpecs<'a> {
14476 type Item = Result<SarSpecs, ErrorContext>;
14477 fn next(&mut self) -> Option<Self::Item> {
14478 let mut pos;
14479 let mut r#type;
14480 loop {
14481 pos = self.pos;
14482 r#type = None;
14483 if self.buf.len() == self.pos {
14484 return None;
14485 }
14486 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14487 self.pos = self.buf.len();
14488 break;
14489 };
14490 r#type = Some(header.r#type);
14491 let res = match header.r#type {
14492 1u16 => SarSpecs::Power({
14493 let res = parse_i32(next);
14494 let Some(val) = res else { break };
14495 val
14496 }),
14497 2u16 => SarSpecs::RangeIndex({
14498 let res = parse_u32(next);
14499 let Some(val) = res else { break };
14500 val
14501 }),
14502 3u16 => SarSpecs::StartFreq({
14503 let res = parse_u32(next);
14504 let Some(val) = res else { break };
14505 val
14506 }),
14507 4u16 => SarSpecs::EndFreq({
14508 let res = parse_u32(next);
14509 let Some(val) = res else { break };
14510 val
14511 }),
14512 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14513 n => continue,
14514 };
14515 return Some(Ok(res));
14516 }
14517 Some(Err(ErrorContext::new(
14518 "SarSpecs",
14519 r#type.and_then(|t| SarSpecs::attr_from_type(t)),
14520 self.orig_loc,
14521 self.buf.as_ptr().wrapping_add(pos) as usize,
14522 )))
14523 }
14524}
14525impl std::fmt::Debug for IterableSarSpecs<'_> {
14526 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14527 let mut fmt = f.debug_struct("SarSpecs");
14528 for attr in self.clone() {
14529 let attr = match attr {
14530 Ok(a) => a,
14531 Err(err) => {
14532 fmt.finish()?;
14533 f.write_str("Err(")?;
14534 err.fmt(f)?;
14535 return f.write_str(")");
14536 }
14537 };
14538 match attr {
14539 SarSpecs::Power(val) => fmt.field("Power", &val),
14540 SarSpecs::RangeIndex(val) => fmt.field("RangeIndex", &val),
14541 SarSpecs::StartFreq(val) => fmt.field("StartFreq", &val),
14542 SarSpecs::EndFreq(val) => fmt.field("EndFreq", &val),
14543 };
14544 }
14545 fmt.finish()
14546 }
14547}
14548impl IterableSarSpecs<'_> {
14549 pub fn lookup_attr(
14550 &self,
14551 offset: usize,
14552 missing_type: Option<u16>,
14553 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14554 let mut stack = Vec::new();
14555 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14556 if missing_type.is_some() && cur == offset {
14557 stack.push(("SarSpecs", offset));
14558 return (
14559 stack,
14560 missing_type.and_then(|t| SarSpecs::attr_from_type(t)),
14561 );
14562 }
14563 if cur > offset || cur + self.buf.len() < offset {
14564 return (stack, None);
14565 }
14566 let mut attrs = self.clone();
14567 let mut last_off = cur + attrs.pos;
14568 while let Some(attr) = attrs.next() {
14569 let Ok(attr) = attr else { break };
14570 match attr {
14571 SarSpecs::Power(val) => {
14572 if last_off == offset {
14573 stack.push(("Power", last_off));
14574 break;
14575 }
14576 }
14577 SarSpecs::RangeIndex(val) => {
14578 if last_off == offset {
14579 stack.push(("RangeIndex", last_off));
14580 break;
14581 }
14582 }
14583 SarSpecs::StartFreq(val) => {
14584 if last_off == offset {
14585 stack.push(("StartFreq", last_off));
14586 break;
14587 }
14588 }
14589 SarSpecs::EndFreq(val) => {
14590 if last_off == offset {
14591 stack.push(("EndFreq", last_off));
14592 break;
14593 }
14594 }
14595 _ => {}
14596 };
14597 last_off = cur + attrs.pos;
14598 }
14599 if !stack.is_empty() {
14600 stack.push(("SarSpecs", cur));
14601 }
14602 (stack, None)
14603 }
14604}
14605#[derive(Clone)]
14606pub enum SupportedIftypes {
14607 Adhoc(()),
14608 Station(()),
14609 Ap(()),
14610 ApVlan(()),
14611 Wds(()),
14612 Monitor(()),
14613 MeshPoint(()),
14614 P2pClient(()),
14615 P2pGo(()),
14616 P2pDevice(()),
14617 Ocb(()),
14618 Nan(()),
14619}
14620impl<'a> IterableSupportedIftypes<'a> {
14621 pub fn get_adhoc(&self) -> Result<(), ErrorContext> {
14622 let mut iter = self.clone();
14623 iter.pos = 0;
14624 for attr in iter {
14625 if let Ok(SupportedIftypes::Adhoc(val)) = attr {
14626 return Ok(val);
14627 }
14628 }
14629 Err(ErrorContext::new_missing(
14630 "SupportedIftypes",
14631 "Adhoc",
14632 self.orig_loc,
14633 self.buf.as_ptr() as usize,
14634 ))
14635 }
14636 pub fn get_station(&self) -> Result<(), ErrorContext> {
14637 let mut iter = self.clone();
14638 iter.pos = 0;
14639 for attr in iter {
14640 if let Ok(SupportedIftypes::Station(val)) = attr {
14641 return Ok(val);
14642 }
14643 }
14644 Err(ErrorContext::new_missing(
14645 "SupportedIftypes",
14646 "Station",
14647 self.orig_loc,
14648 self.buf.as_ptr() as usize,
14649 ))
14650 }
14651 pub fn get_ap(&self) -> Result<(), ErrorContext> {
14652 let mut iter = self.clone();
14653 iter.pos = 0;
14654 for attr in iter {
14655 if let Ok(SupportedIftypes::Ap(val)) = attr {
14656 return Ok(val);
14657 }
14658 }
14659 Err(ErrorContext::new_missing(
14660 "SupportedIftypes",
14661 "Ap",
14662 self.orig_loc,
14663 self.buf.as_ptr() as usize,
14664 ))
14665 }
14666 pub fn get_ap_vlan(&self) -> Result<(), ErrorContext> {
14667 let mut iter = self.clone();
14668 iter.pos = 0;
14669 for attr in iter {
14670 if let Ok(SupportedIftypes::ApVlan(val)) = attr {
14671 return Ok(val);
14672 }
14673 }
14674 Err(ErrorContext::new_missing(
14675 "SupportedIftypes",
14676 "ApVlan",
14677 self.orig_loc,
14678 self.buf.as_ptr() as usize,
14679 ))
14680 }
14681 pub fn get_wds(&self) -> Result<(), ErrorContext> {
14682 let mut iter = self.clone();
14683 iter.pos = 0;
14684 for attr in iter {
14685 if let Ok(SupportedIftypes::Wds(val)) = attr {
14686 return Ok(val);
14687 }
14688 }
14689 Err(ErrorContext::new_missing(
14690 "SupportedIftypes",
14691 "Wds",
14692 self.orig_loc,
14693 self.buf.as_ptr() as usize,
14694 ))
14695 }
14696 pub fn get_monitor(&self) -> Result<(), ErrorContext> {
14697 let mut iter = self.clone();
14698 iter.pos = 0;
14699 for attr in iter {
14700 if let Ok(SupportedIftypes::Monitor(val)) = attr {
14701 return Ok(val);
14702 }
14703 }
14704 Err(ErrorContext::new_missing(
14705 "SupportedIftypes",
14706 "Monitor",
14707 self.orig_loc,
14708 self.buf.as_ptr() as usize,
14709 ))
14710 }
14711 pub fn get_mesh_point(&self) -> Result<(), ErrorContext> {
14712 let mut iter = self.clone();
14713 iter.pos = 0;
14714 for attr in iter {
14715 if let Ok(SupportedIftypes::MeshPoint(val)) = attr {
14716 return Ok(val);
14717 }
14718 }
14719 Err(ErrorContext::new_missing(
14720 "SupportedIftypes",
14721 "MeshPoint",
14722 self.orig_loc,
14723 self.buf.as_ptr() as usize,
14724 ))
14725 }
14726 pub fn get_p2p_client(&self) -> Result<(), ErrorContext> {
14727 let mut iter = self.clone();
14728 iter.pos = 0;
14729 for attr in iter {
14730 if let Ok(SupportedIftypes::P2pClient(val)) = attr {
14731 return Ok(val);
14732 }
14733 }
14734 Err(ErrorContext::new_missing(
14735 "SupportedIftypes",
14736 "P2pClient",
14737 self.orig_loc,
14738 self.buf.as_ptr() as usize,
14739 ))
14740 }
14741 pub fn get_p2p_go(&self) -> Result<(), ErrorContext> {
14742 let mut iter = self.clone();
14743 iter.pos = 0;
14744 for attr in iter {
14745 if let Ok(SupportedIftypes::P2pGo(val)) = attr {
14746 return Ok(val);
14747 }
14748 }
14749 Err(ErrorContext::new_missing(
14750 "SupportedIftypes",
14751 "P2pGo",
14752 self.orig_loc,
14753 self.buf.as_ptr() as usize,
14754 ))
14755 }
14756 pub fn get_p2p_device(&self) -> Result<(), ErrorContext> {
14757 let mut iter = self.clone();
14758 iter.pos = 0;
14759 for attr in iter {
14760 if let Ok(SupportedIftypes::P2pDevice(val)) = attr {
14761 return Ok(val);
14762 }
14763 }
14764 Err(ErrorContext::new_missing(
14765 "SupportedIftypes",
14766 "P2pDevice",
14767 self.orig_loc,
14768 self.buf.as_ptr() as usize,
14769 ))
14770 }
14771 pub fn get_ocb(&self) -> Result<(), ErrorContext> {
14772 let mut iter = self.clone();
14773 iter.pos = 0;
14774 for attr in iter {
14775 if let Ok(SupportedIftypes::Ocb(val)) = attr {
14776 return Ok(val);
14777 }
14778 }
14779 Err(ErrorContext::new_missing(
14780 "SupportedIftypes",
14781 "Ocb",
14782 self.orig_loc,
14783 self.buf.as_ptr() as usize,
14784 ))
14785 }
14786 pub fn get_nan(&self) -> Result<(), ErrorContext> {
14787 let mut iter = self.clone();
14788 iter.pos = 0;
14789 for attr in iter {
14790 if let Ok(SupportedIftypes::Nan(val)) = attr {
14791 return Ok(val);
14792 }
14793 }
14794 Err(ErrorContext::new_missing(
14795 "SupportedIftypes",
14796 "Nan",
14797 self.orig_loc,
14798 self.buf.as_ptr() as usize,
14799 ))
14800 }
14801}
14802impl SupportedIftypes {
14803 pub fn new<'a>(buf: &'a [u8]) -> IterableSupportedIftypes<'a> {
14804 IterableSupportedIftypes::with_loc(buf, buf.as_ptr() as usize)
14805 }
14806 fn attr_from_type(r#type: u16) -> Option<&'static str> {
14807 let res = match r#type {
14808 1u16 => "Adhoc",
14809 2u16 => "Station",
14810 3u16 => "Ap",
14811 4u16 => "ApVlan",
14812 5u16 => "Wds",
14813 6u16 => "Monitor",
14814 7u16 => "MeshPoint",
14815 8u16 => "P2pClient",
14816 9u16 => "P2pGo",
14817 10u16 => "P2pDevice",
14818 11u16 => "Ocb",
14819 12u16 => "Nan",
14820 _ => return None,
14821 };
14822 Some(res)
14823 }
14824}
14825#[derive(Clone, Copy, Default)]
14826pub struct IterableSupportedIftypes<'a> {
14827 buf: &'a [u8],
14828 pos: usize,
14829 orig_loc: usize,
14830}
14831impl<'a> IterableSupportedIftypes<'a> {
14832 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
14833 Self {
14834 buf,
14835 pos: 0,
14836 orig_loc,
14837 }
14838 }
14839 pub fn get_buf(&self) -> &'a [u8] {
14840 self.buf
14841 }
14842}
14843impl<'a> Iterator for IterableSupportedIftypes<'a> {
14844 type Item = Result<SupportedIftypes, ErrorContext>;
14845 fn next(&mut self) -> Option<Self::Item> {
14846 let mut pos;
14847 let mut r#type;
14848 loop {
14849 pos = self.pos;
14850 r#type = None;
14851 if self.buf.len() == self.pos {
14852 return None;
14853 }
14854 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
14855 self.pos = self.buf.len();
14856 break;
14857 };
14858 r#type = Some(header.r#type);
14859 let res = match header.r#type {
14860 1u16 => SupportedIftypes::Adhoc(()),
14861 2u16 => SupportedIftypes::Station(()),
14862 3u16 => SupportedIftypes::Ap(()),
14863 4u16 => SupportedIftypes::ApVlan(()),
14864 5u16 => SupportedIftypes::Wds(()),
14865 6u16 => SupportedIftypes::Monitor(()),
14866 7u16 => SupportedIftypes::MeshPoint(()),
14867 8u16 => SupportedIftypes::P2pClient(()),
14868 9u16 => SupportedIftypes::P2pGo(()),
14869 10u16 => SupportedIftypes::P2pDevice(()),
14870 11u16 => SupportedIftypes::Ocb(()),
14871 12u16 => SupportedIftypes::Nan(()),
14872 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
14873 n => continue,
14874 };
14875 return Some(Ok(res));
14876 }
14877 Some(Err(ErrorContext::new(
14878 "SupportedIftypes",
14879 r#type.and_then(|t| SupportedIftypes::attr_from_type(t)),
14880 self.orig_loc,
14881 self.buf.as_ptr().wrapping_add(pos) as usize,
14882 )))
14883 }
14884}
14885impl std::fmt::Debug for IterableSupportedIftypes<'_> {
14886 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14887 let mut fmt = f.debug_struct("SupportedIftypes");
14888 for attr in self.clone() {
14889 let attr = match attr {
14890 Ok(a) => a,
14891 Err(err) => {
14892 fmt.finish()?;
14893 f.write_str("Err(")?;
14894 err.fmt(f)?;
14895 return f.write_str(")");
14896 }
14897 };
14898 match attr {
14899 SupportedIftypes::Adhoc(val) => fmt.field("Adhoc", &val),
14900 SupportedIftypes::Station(val) => fmt.field("Station", &val),
14901 SupportedIftypes::Ap(val) => fmt.field("Ap", &val),
14902 SupportedIftypes::ApVlan(val) => fmt.field("ApVlan", &val),
14903 SupportedIftypes::Wds(val) => fmt.field("Wds", &val),
14904 SupportedIftypes::Monitor(val) => fmt.field("Monitor", &val),
14905 SupportedIftypes::MeshPoint(val) => fmt.field("MeshPoint", &val),
14906 SupportedIftypes::P2pClient(val) => fmt.field("P2pClient", &val),
14907 SupportedIftypes::P2pGo(val) => fmt.field("P2pGo", &val),
14908 SupportedIftypes::P2pDevice(val) => fmt.field("P2pDevice", &val),
14909 SupportedIftypes::Ocb(val) => fmt.field("Ocb", &val),
14910 SupportedIftypes::Nan(val) => fmt.field("Nan", &val),
14911 };
14912 }
14913 fmt.finish()
14914 }
14915}
14916impl IterableSupportedIftypes<'_> {
14917 pub fn lookup_attr(
14918 &self,
14919 offset: usize,
14920 missing_type: Option<u16>,
14921 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
14922 let mut stack = Vec::new();
14923 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
14924 if missing_type.is_some() && cur == offset {
14925 stack.push(("SupportedIftypes", offset));
14926 return (
14927 stack,
14928 missing_type.and_then(|t| SupportedIftypes::attr_from_type(t)),
14929 );
14930 }
14931 if cur > offset || cur + self.buf.len() < offset {
14932 return (stack, None);
14933 }
14934 let mut attrs = self.clone();
14935 let mut last_off = cur + attrs.pos;
14936 while let Some(attr) = attrs.next() {
14937 let Ok(attr) = attr else { break };
14938 match attr {
14939 SupportedIftypes::Adhoc(val) => {
14940 if last_off == offset {
14941 stack.push(("Adhoc", last_off));
14942 break;
14943 }
14944 }
14945 SupportedIftypes::Station(val) => {
14946 if last_off == offset {
14947 stack.push(("Station", last_off));
14948 break;
14949 }
14950 }
14951 SupportedIftypes::Ap(val) => {
14952 if last_off == offset {
14953 stack.push(("Ap", last_off));
14954 break;
14955 }
14956 }
14957 SupportedIftypes::ApVlan(val) => {
14958 if last_off == offset {
14959 stack.push(("ApVlan", last_off));
14960 break;
14961 }
14962 }
14963 SupportedIftypes::Wds(val) => {
14964 if last_off == offset {
14965 stack.push(("Wds", last_off));
14966 break;
14967 }
14968 }
14969 SupportedIftypes::Monitor(val) => {
14970 if last_off == offset {
14971 stack.push(("Monitor", last_off));
14972 break;
14973 }
14974 }
14975 SupportedIftypes::MeshPoint(val) => {
14976 if last_off == offset {
14977 stack.push(("MeshPoint", last_off));
14978 break;
14979 }
14980 }
14981 SupportedIftypes::P2pClient(val) => {
14982 if last_off == offset {
14983 stack.push(("P2pClient", last_off));
14984 break;
14985 }
14986 }
14987 SupportedIftypes::P2pGo(val) => {
14988 if last_off == offset {
14989 stack.push(("P2pGo", last_off));
14990 break;
14991 }
14992 }
14993 SupportedIftypes::P2pDevice(val) => {
14994 if last_off == offset {
14995 stack.push(("P2pDevice", last_off));
14996 break;
14997 }
14998 }
14999 SupportedIftypes::Ocb(val) => {
15000 if last_off == offset {
15001 stack.push(("Ocb", last_off));
15002 break;
15003 }
15004 }
15005 SupportedIftypes::Nan(val) => {
15006 if last_off == offset {
15007 stack.push(("Nan", last_off));
15008 break;
15009 }
15010 }
15011 _ => {}
15012 };
15013 last_off = cur + attrs.pos;
15014 }
15015 if !stack.is_empty() {
15016 stack.push(("SupportedIftypes", cur));
15017 }
15018 (stack, None)
15019 }
15020}
15021#[derive(Clone)]
15022pub enum TxqStatsAttrs {
15023 BacklogBytes(u32),
15024 BacklogPackets(u32),
15025 Flows(u32),
15026 Drops(u32),
15027 EcnMarks(u32),
15028 Overlimit(u32),
15029 Overmemory(u32),
15030 Collisions(u32),
15031 TxBytes(u32),
15032 TxPackets(u32),
15033 MaxFlows(u32),
15034}
15035impl<'a> IterableTxqStatsAttrs<'a> {
15036 pub fn get_backlog_bytes(&self) -> Result<u32, ErrorContext> {
15037 let mut iter = self.clone();
15038 iter.pos = 0;
15039 for attr in iter {
15040 if let Ok(TxqStatsAttrs::BacklogBytes(val)) = attr {
15041 return Ok(val);
15042 }
15043 }
15044 Err(ErrorContext::new_missing(
15045 "TxqStatsAttrs",
15046 "BacklogBytes",
15047 self.orig_loc,
15048 self.buf.as_ptr() as usize,
15049 ))
15050 }
15051 pub fn get_backlog_packets(&self) -> Result<u32, ErrorContext> {
15052 let mut iter = self.clone();
15053 iter.pos = 0;
15054 for attr in iter {
15055 if let Ok(TxqStatsAttrs::BacklogPackets(val)) = attr {
15056 return Ok(val);
15057 }
15058 }
15059 Err(ErrorContext::new_missing(
15060 "TxqStatsAttrs",
15061 "BacklogPackets",
15062 self.orig_loc,
15063 self.buf.as_ptr() as usize,
15064 ))
15065 }
15066 pub fn get_flows(&self) -> Result<u32, ErrorContext> {
15067 let mut iter = self.clone();
15068 iter.pos = 0;
15069 for attr in iter {
15070 if let Ok(TxqStatsAttrs::Flows(val)) = attr {
15071 return Ok(val);
15072 }
15073 }
15074 Err(ErrorContext::new_missing(
15075 "TxqStatsAttrs",
15076 "Flows",
15077 self.orig_loc,
15078 self.buf.as_ptr() as usize,
15079 ))
15080 }
15081 pub fn get_drops(&self) -> Result<u32, ErrorContext> {
15082 let mut iter = self.clone();
15083 iter.pos = 0;
15084 for attr in iter {
15085 if let Ok(TxqStatsAttrs::Drops(val)) = attr {
15086 return Ok(val);
15087 }
15088 }
15089 Err(ErrorContext::new_missing(
15090 "TxqStatsAttrs",
15091 "Drops",
15092 self.orig_loc,
15093 self.buf.as_ptr() as usize,
15094 ))
15095 }
15096 pub fn get_ecn_marks(&self) -> Result<u32, ErrorContext> {
15097 let mut iter = self.clone();
15098 iter.pos = 0;
15099 for attr in iter {
15100 if let Ok(TxqStatsAttrs::EcnMarks(val)) = attr {
15101 return Ok(val);
15102 }
15103 }
15104 Err(ErrorContext::new_missing(
15105 "TxqStatsAttrs",
15106 "EcnMarks",
15107 self.orig_loc,
15108 self.buf.as_ptr() as usize,
15109 ))
15110 }
15111 pub fn get_overlimit(&self) -> Result<u32, ErrorContext> {
15112 let mut iter = self.clone();
15113 iter.pos = 0;
15114 for attr in iter {
15115 if let Ok(TxqStatsAttrs::Overlimit(val)) = attr {
15116 return Ok(val);
15117 }
15118 }
15119 Err(ErrorContext::new_missing(
15120 "TxqStatsAttrs",
15121 "Overlimit",
15122 self.orig_loc,
15123 self.buf.as_ptr() as usize,
15124 ))
15125 }
15126 pub fn get_overmemory(&self) -> Result<u32, ErrorContext> {
15127 let mut iter = self.clone();
15128 iter.pos = 0;
15129 for attr in iter {
15130 if let Ok(TxqStatsAttrs::Overmemory(val)) = attr {
15131 return Ok(val);
15132 }
15133 }
15134 Err(ErrorContext::new_missing(
15135 "TxqStatsAttrs",
15136 "Overmemory",
15137 self.orig_loc,
15138 self.buf.as_ptr() as usize,
15139 ))
15140 }
15141 pub fn get_collisions(&self) -> Result<u32, ErrorContext> {
15142 let mut iter = self.clone();
15143 iter.pos = 0;
15144 for attr in iter {
15145 if let Ok(TxqStatsAttrs::Collisions(val)) = attr {
15146 return Ok(val);
15147 }
15148 }
15149 Err(ErrorContext::new_missing(
15150 "TxqStatsAttrs",
15151 "Collisions",
15152 self.orig_loc,
15153 self.buf.as_ptr() as usize,
15154 ))
15155 }
15156 pub fn get_tx_bytes(&self) -> Result<u32, ErrorContext> {
15157 let mut iter = self.clone();
15158 iter.pos = 0;
15159 for attr in iter {
15160 if let Ok(TxqStatsAttrs::TxBytes(val)) = attr {
15161 return Ok(val);
15162 }
15163 }
15164 Err(ErrorContext::new_missing(
15165 "TxqStatsAttrs",
15166 "TxBytes",
15167 self.orig_loc,
15168 self.buf.as_ptr() as usize,
15169 ))
15170 }
15171 pub fn get_tx_packets(&self) -> Result<u32, ErrorContext> {
15172 let mut iter = self.clone();
15173 iter.pos = 0;
15174 for attr in iter {
15175 if let Ok(TxqStatsAttrs::TxPackets(val)) = attr {
15176 return Ok(val);
15177 }
15178 }
15179 Err(ErrorContext::new_missing(
15180 "TxqStatsAttrs",
15181 "TxPackets",
15182 self.orig_loc,
15183 self.buf.as_ptr() as usize,
15184 ))
15185 }
15186 pub fn get_max_flows(&self) -> Result<u32, ErrorContext> {
15187 let mut iter = self.clone();
15188 iter.pos = 0;
15189 for attr in iter {
15190 if let Ok(TxqStatsAttrs::MaxFlows(val)) = attr {
15191 return Ok(val);
15192 }
15193 }
15194 Err(ErrorContext::new_missing(
15195 "TxqStatsAttrs",
15196 "MaxFlows",
15197 self.orig_loc,
15198 self.buf.as_ptr() as usize,
15199 ))
15200 }
15201}
15202impl TxqStatsAttrs {
15203 pub fn new<'a>(buf: &'a [u8]) -> IterableTxqStatsAttrs<'a> {
15204 IterableTxqStatsAttrs::with_loc(buf, buf.as_ptr() as usize)
15205 }
15206 fn attr_from_type(r#type: u16) -> Option<&'static str> {
15207 let res = match r#type {
15208 1u16 => "BacklogBytes",
15209 2u16 => "BacklogPackets",
15210 3u16 => "Flows",
15211 4u16 => "Drops",
15212 5u16 => "EcnMarks",
15213 6u16 => "Overlimit",
15214 7u16 => "Overmemory",
15215 8u16 => "Collisions",
15216 9u16 => "TxBytes",
15217 10u16 => "TxPackets",
15218 11u16 => "MaxFlows",
15219 _ => return None,
15220 };
15221 Some(res)
15222 }
15223}
15224#[derive(Clone, Copy, Default)]
15225pub struct IterableTxqStatsAttrs<'a> {
15226 buf: &'a [u8],
15227 pos: usize,
15228 orig_loc: usize,
15229}
15230impl<'a> IterableTxqStatsAttrs<'a> {
15231 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
15232 Self {
15233 buf,
15234 pos: 0,
15235 orig_loc,
15236 }
15237 }
15238 pub fn get_buf(&self) -> &'a [u8] {
15239 self.buf
15240 }
15241}
15242impl<'a> Iterator for IterableTxqStatsAttrs<'a> {
15243 type Item = Result<TxqStatsAttrs, ErrorContext>;
15244 fn next(&mut self) -> Option<Self::Item> {
15245 let mut pos;
15246 let mut r#type;
15247 loop {
15248 pos = self.pos;
15249 r#type = None;
15250 if self.buf.len() == self.pos {
15251 return None;
15252 }
15253 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
15254 self.pos = self.buf.len();
15255 break;
15256 };
15257 r#type = Some(header.r#type);
15258 let res = match header.r#type {
15259 1u16 => TxqStatsAttrs::BacklogBytes({
15260 let res = parse_u32(next);
15261 let Some(val) = res else { break };
15262 val
15263 }),
15264 2u16 => TxqStatsAttrs::BacklogPackets({
15265 let res = parse_u32(next);
15266 let Some(val) = res else { break };
15267 val
15268 }),
15269 3u16 => TxqStatsAttrs::Flows({
15270 let res = parse_u32(next);
15271 let Some(val) = res else { break };
15272 val
15273 }),
15274 4u16 => TxqStatsAttrs::Drops({
15275 let res = parse_u32(next);
15276 let Some(val) = res else { break };
15277 val
15278 }),
15279 5u16 => TxqStatsAttrs::EcnMarks({
15280 let res = parse_u32(next);
15281 let Some(val) = res else { break };
15282 val
15283 }),
15284 6u16 => TxqStatsAttrs::Overlimit({
15285 let res = parse_u32(next);
15286 let Some(val) = res else { break };
15287 val
15288 }),
15289 7u16 => TxqStatsAttrs::Overmemory({
15290 let res = parse_u32(next);
15291 let Some(val) = res else { break };
15292 val
15293 }),
15294 8u16 => TxqStatsAttrs::Collisions({
15295 let res = parse_u32(next);
15296 let Some(val) = res else { break };
15297 val
15298 }),
15299 9u16 => TxqStatsAttrs::TxBytes({
15300 let res = parse_u32(next);
15301 let Some(val) = res else { break };
15302 val
15303 }),
15304 10u16 => TxqStatsAttrs::TxPackets({
15305 let res = parse_u32(next);
15306 let Some(val) = res else { break };
15307 val
15308 }),
15309 11u16 => TxqStatsAttrs::MaxFlows({
15310 let res = parse_u32(next);
15311 let Some(val) = res else { break };
15312 val
15313 }),
15314 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
15315 n => continue,
15316 };
15317 return Some(Ok(res));
15318 }
15319 Some(Err(ErrorContext::new(
15320 "TxqStatsAttrs",
15321 r#type.and_then(|t| TxqStatsAttrs::attr_from_type(t)),
15322 self.orig_loc,
15323 self.buf.as_ptr().wrapping_add(pos) as usize,
15324 )))
15325 }
15326}
15327impl std::fmt::Debug for IterableTxqStatsAttrs<'_> {
15328 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15329 let mut fmt = f.debug_struct("TxqStatsAttrs");
15330 for attr in self.clone() {
15331 let attr = match attr {
15332 Ok(a) => a,
15333 Err(err) => {
15334 fmt.finish()?;
15335 f.write_str("Err(")?;
15336 err.fmt(f)?;
15337 return f.write_str(")");
15338 }
15339 };
15340 match attr {
15341 TxqStatsAttrs::BacklogBytes(val) => fmt.field("BacklogBytes", &val),
15342 TxqStatsAttrs::BacklogPackets(val) => fmt.field("BacklogPackets", &val),
15343 TxqStatsAttrs::Flows(val) => fmt.field("Flows", &val),
15344 TxqStatsAttrs::Drops(val) => fmt.field("Drops", &val),
15345 TxqStatsAttrs::EcnMarks(val) => fmt.field("EcnMarks", &val),
15346 TxqStatsAttrs::Overlimit(val) => fmt.field("Overlimit", &val),
15347 TxqStatsAttrs::Overmemory(val) => fmt.field("Overmemory", &val),
15348 TxqStatsAttrs::Collisions(val) => fmt.field("Collisions", &val),
15349 TxqStatsAttrs::TxBytes(val) => fmt.field("TxBytes", &val),
15350 TxqStatsAttrs::TxPackets(val) => fmt.field("TxPackets", &val),
15351 TxqStatsAttrs::MaxFlows(val) => fmt.field("MaxFlows", &val),
15352 };
15353 }
15354 fmt.finish()
15355 }
15356}
15357impl IterableTxqStatsAttrs<'_> {
15358 pub fn lookup_attr(
15359 &self,
15360 offset: usize,
15361 missing_type: Option<u16>,
15362 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
15363 let mut stack = Vec::new();
15364 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
15365 if missing_type.is_some() && cur == offset {
15366 stack.push(("TxqStatsAttrs", offset));
15367 return (
15368 stack,
15369 missing_type.and_then(|t| TxqStatsAttrs::attr_from_type(t)),
15370 );
15371 }
15372 if cur > offset || cur + self.buf.len() < offset {
15373 return (stack, None);
15374 }
15375 let mut attrs = self.clone();
15376 let mut last_off = cur + attrs.pos;
15377 while let Some(attr) = attrs.next() {
15378 let Ok(attr) = attr else { break };
15379 match attr {
15380 TxqStatsAttrs::BacklogBytes(val) => {
15381 if last_off == offset {
15382 stack.push(("BacklogBytes", last_off));
15383 break;
15384 }
15385 }
15386 TxqStatsAttrs::BacklogPackets(val) => {
15387 if last_off == offset {
15388 stack.push(("BacklogPackets", last_off));
15389 break;
15390 }
15391 }
15392 TxqStatsAttrs::Flows(val) => {
15393 if last_off == offset {
15394 stack.push(("Flows", last_off));
15395 break;
15396 }
15397 }
15398 TxqStatsAttrs::Drops(val) => {
15399 if last_off == offset {
15400 stack.push(("Drops", last_off));
15401 break;
15402 }
15403 }
15404 TxqStatsAttrs::EcnMarks(val) => {
15405 if last_off == offset {
15406 stack.push(("EcnMarks", last_off));
15407 break;
15408 }
15409 }
15410 TxqStatsAttrs::Overlimit(val) => {
15411 if last_off == offset {
15412 stack.push(("Overlimit", last_off));
15413 break;
15414 }
15415 }
15416 TxqStatsAttrs::Overmemory(val) => {
15417 if last_off == offset {
15418 stack.push(("Overmemory", last_off));
15419 break;
15420 }
15421 }
15422 TxqStatsAttrs::Collisions(val) => {
15423 if last_off == offset {
15424 stack.push(("Collisions", last_off));
15425 break;
15426 }
15427 }
15428 TxqStatsAttrs::TxBytes(val) => {
15429 if last_off == offset {
15430 stack.push(("TxBytes", last_off));
15431 break;
15432 }
15433 }
15434 TxqStatsAttrs::TxPackets(val) => {
15435 if last_off == offset {
15436 stack.push(("TxPackets", last_off));
15437 break;
15438 }
15439 }
15440 TxqStatsAttrs::MaxFlows(val) => {
15441 if last_off == offset {
15442 stack.push(("MaxFlows", last_off));
15443 break;
15444 }
15445 }
15446 _ => {}
15447 };
15448 last_off = cur + attrs.pos;
15449 }
15450 if !stack.is_empty() {
15451 stack.push(("TxqStatsAttrs", cur));
15452 }
15453 (stack, None)
15454 }
15455}
15456#[derive(Clone)]
15457pub enum WmmAttrs {
15458 CwMin(u16),
15459 CwMax(u16),
15460 Aifsn(u8),
15461 Txop(u16),
15462}
15463impl<'a> IterableWmmAttrs<'a> {
15464 pub fn get_cw_min(&self) -> Result<u16, ErrorContext> {
15465 let mut iter = self.clone();
15466 iter.pos = 0;
15467 for attr in iter {
15468 if let Ok(WmmAttrs::CwMin(val)) = attr {
15469 return Ok(val);
15470 }
15471 }
15472 Err(ErrorContext::new_missing(
15473 "WmmAttrs",
15474 "CwMin",
15475 self.orig_loc,
15476 self.buf.as_ptr() as usize,
15477 ))
15478 }
15479 pub fn get_cw_max(&self) -> Result<u16, ErrorContext> {
15480 let mut iter = self.clone();
15481 iter.pos = 0;
15482 for attr in iter {
15483 if let Ok(WmmAttrs::CwMax(val)) = attr {
15484 return Ok(val);
15485 }
15486 }
15487 Err(ErrorContext::new_missing(
15488 "WmmAttrs",
15489 "CwMax",
15490 self.orig_loc,
15491 self.buf.as_ptr() as usize,
15492 ))
15493 }
15494 pub fn get_aifsn(&self) -> Result<u8, ErrorContext> {
15495 let mut iter = self.clone();
15496 iter.pos = 0;
15497 for attr in iter {
15498 if let Ok(WmmAttrs::Aifsn(val)) = attr {
15499 return Ok(val);
15500 }
15501 }
15502 Err(ErrorContext::new_missing(
15503 "WmmAttrs",
15504 "Aifsn",
15505 self.orig_loc,
15506 self.buf.as_ptr() as usize,
15507 ))
15508 }
15509 pub fn get_txop(&self) -> Result<u16, ErrorContext> {
15510 let mut iter = self.clone();
15511 iter.pos = 0;
15512 for attr in iter {
15513 if let Ok(WmmAttrs::Txop(val)) = attr {
15514 return Ok(val);
15515 }
15516 }
15517 Err(ErrorContext::new_missing(
15518 "WmmAttrs",
15519 "Txop",
15520 self.orig_loc,
15521 self.buf.as_ptr() as usize,
15522 ))
15523 }
15524}
15525impl WmmAttrs {
15526 pub fn new<'a>(buf: &'a [u8]) -> IterableWmmAttrs<'a> {
15527 IterableWmmAttrs::with_loc(buf, buf.as_ptr() as usize)
15528 }
15529 fn attr_from_type(r#type: u16) -> Option<&'static str> {
15530 let res = match r#type {
15531 1u16 => "CwMin",
15532 2u16 => "CwMax",
15533 3u16 => "Aifsn",
15534 4u16 => "Txop",
15535 _ => return None,
15536 };
15537 Some(res)
15538 }
15539}
15540#[derive(Clone, Copy, Default)]
15541pub struct IterableWmmAttrs<'a> {
15542 buf: &'a [u8],
15543 pos: usize,
15544 orig_loc: usize,
15545}
15546impl<'a> IterableWmmAttrs<'a> {
15547 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
15548 Self {
15549 buf,
15550 pos: 0,
15551 orig_loc,
15552 }
15553 }
15554 pub fn get_buf(&self) -> &'a [u8] {
15555 self.buf
15556 }
15557}
15558impl<'a> Iterator for IterableWmmAttrs<'a> {
15559 type Item = Result<WmmAttrs, ErrorContext>;
15560 fn next(&mut self) -> Option<Self::Item> {
15561 let mut pos;
15562 let mut r#type;
15563 loop {
15564 pos = self.pos;
15565 r#type = None;
15566 if self.buf.len() == self.pos {
15567 return None;
15568 }
15569 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
15570 self.pos = self.buf.len();
15571 break;
15572 };
15573 r#type = Some(header.r#type);
15574 let res = match header.r#type {
15575 1u16 => WmmAttrs::CwMin({
15576 let res = parse_u16(next);
15577 let Some(val) = res else { break };
15578 val
15579 }),
15580 2u16 => WmmAttrs::CwMax({
15581 let res = parse_u16(next);
15582 let Some(val) = res else { break };
15583 val
15584 }),
15585 3u16 => WmmAttrs::Aifsn({
15586 let res = parse_u8(next);
15587 let Some(val) = res else { break };
15588 val
15589 }),
15590 4u16 => WmmAttrs::Txop({
15591 let res = parse_u16(next);
15592 let Some(val) = res else { break };
15593 val
15594 }),
15595 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
15596 n => continue,
15597 };
15598 return Some(Ok(res));
15599 }
15600 Some(Err(ErrorContext::new(
15601 "WmmAttrs",
15602 r#type.and_then(|t| WmmAttrs::attr_from_type(t)),
15603 self.orig_loc,
15604 self.buf.as_ptr().wrapping_add(pos) as usize,
15605 )))
15606 }
15607}
15608impl std::fmt::Debug for IterableWmmAttrs<'_> {
15609 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15610 let mut fmt = f.debug_struct("WmmAttrs");
15611 for attr in self.clone() {
15612 let attr = match attr {
15613 Ok(a) => a,
15614 Err(err) => {
15615 fmt.finish()?;
15616 f.write_str("Err(")?;
15617 err.fmt(f)?;
15618 return f.write_str(")");
15619 }
15620 };
15621 match attr {
15622 WmmAttrs::CwMin(val) => fmt.field("CwMin", &val),
15623 WmmAttrs::CwMax(val) => fmt.field("CwMax", &val),
15624 WmmAttrs::Aifsn(val) => fmt.field("Aifsn", &val),
15625 WmmAttrs::Txop(val) => fmt.field("Txop", &val),
15626 };
15627 }
15628 fmt.finish()
15629 }
15630}
15631impl IterableWmmAttrs<'_> {
15632 pub fn lookup_attr(
15633 &self,
15634 offset: usize,
15635 missing_type: Option<u16>,
15636 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
15637 let mut stack = Vec::new();
15638 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
15639 if missing_type.is_some() && cur == offset {
15640 stack.push(("WmmAttrs", offset));
15641 return (
15642 stack,
15643 missing_type.and_then(|t| WmmAttrs::attr_from_type(t)),
15644 );
15645 }
15646 if cur > offset || cur + self.buf.len() < offset {
15647 return (stack, None);
15648 }
15649 let mut attrs = self.clone();
15650 let mut last_off = cur + attrs.pos;
15651 while let Some(attr) = attrs.next() {
15652 let Ok(attr) = attr else { break };
15653 match attr {
15654 WmmAttrs::CwMin(val) => {
15655 if last_off == offset {
15656 stack.push(("CwMin", last_off));
15657 break;
15658 }
15659 }
15660 WmmAttrs::CwMax(val) => {
15661 if last_off == offset {
15662 stack.push(("CwMax", last_off));
15663 break;
15664 }
15665 }
15666 WmmAttrs::Aifsn(val) => {
15667 if last_off == offset {
15668 stack.push(("Aifsn", last_off));
15669 break;
15670 }
15671 }
15672 WmmAttrs::Txop(val) => {
15673 if last_off == offset {
15674 stack.push(("Txop", last_off));
15675 break;
15676 }
15677 }
15678 _ => {}
15679 };
15680 last_off = cur + attrs.pos;
15681 }
15682 if !stack.is_empty() {
15683 stack.push(("WmmAttrs", cur));
15684 }
15685 (stack, None)
15686 }
15687}
15688#[derive(Clone)]
15689pub enum WowlanTriggersAttrs {
15690 Any(()),
15691 Disconnect(()),
15692 MagicPkt(()),
15693 PktPattern(()),
15694 GtkRekeySupported(()),
15695 GtkRekeyFailure(()),
15696 EapIdentRequest(()),
15697 _4wayHandshake(()),
15698 RfkillRelease(()),
15699 WakeupPkt80211(()),
15700 WakeupPkt80211Len(()),
15701 WakeupPkt8023(()),
15702 WakeupPkt8023Len(()),
15703 TcpConnection(()),
15704 WakeupTcpMatch(()),
15705 WakeupTcpConnlost(()),
15706 WakeupTcpNomoretokens(()),
15707 NetDetect(()),
15708 NetDetectResults(()),
15709 UnprotectedDeauthDisassoc(()),
15710}
15711impl<'a> IterableWowlanTriggersAttrs<'a> {
15712 pub fn get_any(&self) -> Result<(), ErrorContext> {
15713 let mut iter = self.clone();
15714 iter.pos = 0;
15715 for attr in iter {
15716 if let Ok(WowlanTriggersAttrs::Any(val)) = attr {
15717 return Ok(val);
15718 }
15719 }
15720 Err(ErrorContext::new_missing(
15721 "WowlanTriggersAttrs",
15722 "Any",
15723 self.orig_loc,
15724 self.buf.as_ptr() as usize,
15725 ))
15726 }
15727 pub fn get_disconnect(&self) -> Result<(), ErrorContext> {
15728 let mut iter = self.clone();
15729 iter.pos = 0;
15730 for attr in iter {
15731 if let Ok(WowlanTriggersAttrs::Disconnect(val)) = attr {
15732 return Ok(val);
15733 }
15734 }
15735 Err(ErrorContext::new_missing(
15736 "WowlanTriggersAttrs",
15737 "Disconnect",
15738 self.orig_loc,
15739 self.buf.as_ptr() as usize,
15740 ))
15741 }
15742 pub fn get_magic_pkt(&self) -> Result<(), ErrorContext> {
15743 let mut iter = self.clone();
15744 iter.pos = 0;
15745 for attr in iter {
15746 if let Ok(WowlanTriggersAttrs::MagicPkt(val)) = attr {
15747 return Ok(val);
15748 }
15749 }
15750 Err(ErrorContext::new_missing(
15751 "WowlanTriggersAttrs",
15752 "MagicPkt",
15753 self.orig_loc,
15754 self.buf.as_ptr() as usize,
15755 ))
15756 }
15757 pub fn get_pkt_pattern(&self) -> Result<(), ErrorContext> {
15758 let mut iter = self.clone();
15759 iter.pos = 0;
15760 for attr in iter {
15761 if let Ok(WowlanTriggersAttrs::PktPattern(val)) = attr {
15762 return Ok(val);
15763 }
15764 }
15765 Err(ErrorContext::new_missing(
15766 "WowlanTriggersAttrs",
15767 "PktPattern",
15768 self.orig_loc,
15769 self.buf.as_ptr() as usize,
15770 ))
15771 }
15772 pub fn get_gtk_rekey_supported(&self) -> Result<(), ErrorContext> {
15773 let mut iter = self.clone();
15774 iter.pos = 0;
15775 for attr in iter {
15776 if let Ok(WowlanTriggersAttrs::GtkRekeySupported(val)) = attr {
15777 return Ok(val);
15778 }
15779 }
15780 Err(ErrorContext::new_missing(
15781 "WowlanTriggersAttrs",
15782 "GtkRekeySupported",
15783 self.orig_loc,
15784 self.buf.as_ptr() as usize,
15785 ))
15786 }
15787 pub fn get_gtk_rekey_failure(&self) -> Result<(), ErrorContext> {
15788 let mut iter = self.clone();
15789 iter.pos = 0;
15790 for attr in iter {
15791 if let Ok(WowlanTriggersAttrs::GtkRekeyFailure(val)) = attr {
15792 return Ok(val);
15793 }
15794 }
15795 Err(ErrorContext::new_missing(
15796 "WowlanTriggersAttrs",
15797 "GtkRekeyFailure",
15798 self.orig_loc,
15799 self.buf.as_ptr() as usize,
15800 ))
15801 }
15802 pub fn get_eap_ident_request(&self) -> Result<(), ErrorContext> {
15803 let mut iter = self.clone();
15804 iter.pos = 0;
15805 for attr in iter {
15806 if let Ok(WowlanTriggersAttrs::EapIdentRequest(val)) = attr {
15807 return Ok(val);
15808 }
15809 }
15810 Err(ErrorContext::new_missing(
15811 "WowlanTriggersAttrs",
15812 "EapIdentRequest",
15813 self.orig_loc,
15814 self.buf.as_ptr() as usize,
15815 ))
15816 }
15817 pub fn get_4way_handshake(&self) -> Result<(), ErrorContext> {
15818 let mut iter = self.clone();
15819 iter.pos = 0;
15820 for attr in iter {
15821 if let Ok(WowlanTriggersAttrs::_4wayHandshake(val)) = attr {
15822 return Ok(val);
15823 }
15824 }
15825 Err(ErrorContext::new_missing(
15826 "WowlanTriggersAttrs",
15827 "4wayHandshake",
15828 self.orig_loc,
15829 self.buf.as_ptr() as usize,
15830 ))
15831 }
15832 pub fn get_rfkill_release(&self) -> Result<(), ErrorContext> {
15833 let mut iter = self.clone();
15834 iter.pos = 0;
15835 for attr in iter {
15836 if let Ok(WowlanTriggersAttrs::RfkillRelease(val)) = attr {
15837 return Ok(val);
15838 }
15839 }
15840 Err(ErrorContext::new_missing(
15841 "WowlanTriggersAttrs",
15842 "RfkillRelease",
15843 self.orig_loc,
15844 self.buf.as_ptr() as usize,
15845 ))
15846 }
15847 pub fn get_wakeup_pkt_80211(&self) -> Result<(), ErrorContext> {
15848 let mut iter = self.clone();
15849 iter.pos = 0;
15850 for attr in iter {
15851 if let Ok(WowlanTriggersAttrs::WakeupPkt80211(val)) = attr {
15852 return Ok(val);
15853 }
15854 }
15855 Err(ErrorContext::new_missing(
15856 "WowlanTriggersAttrs",
15857 "WakeupPkt80211",
15858 self.orig_loc,
15859 self.buf.as_ptr() as usize,
15860 ))
15861 }
15862 pub fn get_wakeup_pkt_80211_len(&self) -> Result<(), ErrorContext> {
15863 let mut iter = self.clone();
15864 iter.pos = 0;
15865 for attr in iter {
15866 if let Ok(WowlanTriggersAttrs::WakeupPkt80211Len(val)) = attr {
15867 return Ok(val);
15868 }
15869 }
15870 Err(ErrorContext::new_missing(
15871 "WowlanTriggersAttrs",
15872 "WakeupPkt80211Len",
15873 self.orig_loc,
15874 self.buf.as_ptr() as usize,
15875 ))
15876 }
15877 pub fn get_wakeup_pkt_8023(&self) -> Result<(), ErrorContext> {
15878 let mut iter = self.clone();
15879 iter.pos = 0;
15880 for attr in iter {
15881 if let Ok(WowlanTriggersAttrs::WakeupPkt8023(val)) = attr {
15882 return Ok(val);
15883 }
15884 }
15885 Err(ErrorContext::new_missing(
15886 "WowlanTriggersAttrs",
15887 "WakeupPkt8023",
15888 self.orig_loc,
15889 self.buf.as_ptr() as usize,
15890 ))
15891 }
15892 pub fn get_wakeup_pkt_8023_len(&self) -> Result<(), ErrorContext> {
15893 let mut iter = self.clone();
15894 iter.pos = 0;
15895 for attr in iter {
15896 if let Ok(WowlanTriggersAttrs::WakeupPkt8023Len(val)) = attr {
15897 return Ok(val);
15898 }
15899 }
15900 Err(ErrorContext::new_missing(
15901 "WowlanTriggersAttrs",
15902 "WakeupPkt8023Len",
15903 self.orig_loc,
15904 self.buf.as_ptr() as usize,
15905 ))
15906 }
15907 pub fn get_tcp_connection(&self) -> Result<(), ErrorContext> {
15908 let mut iter = self.clone();
15909 iter.pos = 0;
15910 for attr in iter {
15911 if let Ok(WowlanTriggersAttrs::TcpConnection(val)) = attr {
15912 return Ok(val);
15913 }
15914 }
15915 Err(ErrorContext::new_missing(
15916 "WowlanTriggersAttrs",
15917 "TcpConnection",
15918 self.orig_loc,
15919 self.buf.as_ptr() as usize,
15920 ))
15921 }
15922 pub fn get_wakeup_tcp_match(&self) -> Result<(), ErrorContext> {
15923 let mut iter = self.clone();
15924 iter.pos = 0;
15925 for attr in iter {
15926 if let Ok(WowlanTriggersAttrs::WakeupTcpMatch(val)) = attr {
15927 return Ok(val);
15928 }
15929 }
15930 Err(ErrorContext::new_missing(
15931 "WowlanTriggersAttrs",
15932 "WakeupTcpMatch",
15933 self.orig_loc,
15934 self.buf.as_ptr() as usize,
15935 ))
15936 }
15937 pub fn get_wakeup_tcp_connlost(&self) -> Result<(), ErrorContext> {
15938 let mut iter = self.clone();
15939 iter.pos = 0;
15940 for attr in iter {
15941 if let Ok(WowlanTriggersAttrs::WakeupTcpConnlost(val)) = attr {
15942 return Ok(val);
15943 }
15944 }
15945 Err(ErrorContext::new_missing(
15946 "WowlanTriggersAttrs",
15947 "WakeupTcpConnlost",
15948 self.orig_loc,
15949 self.buf.as_ptr() as usize,
15950 ))
15951 }
15952 pub fn get_wakeup_tcp_nomoretokens(&self) -> Result<(), ErrorContext> {
15953 let mut iter = self.clone();
15954 iter.pos = 0;
15955 for attr in iter {
15956 if let Ok(WowlanTriggersAttrs::WakeupTcpNomoretokens(val)) = attr {
15957 return Ok(val);
15958 }
15959 }
15960 Err(ErrorContext::new_missing(
15961 "WowlanTriggersAttrs",
15962 "WakeupTcpNomoretokens",
15963 self.orig_loc,
15964 self.buf.as_ptr() as usize,
15965 ))
15966 }
15967 pub fn get_net_detect(&self) -> Result<(), ErrorContext> {
15968 let mut iter = self.clone();
15969 iter.pos = 0;
15970 for attr in iter {
15971 if let Ok(WowlanTriggersAttrs::NetDetect(val)) = attr {
15972 return Ok(val);
15973 }
15974 }
15975 Err(ErrorContext::new_missing(
15976 "WowlanTriggersAttrs",
15977 "NetDetect",
15978 self.orig_loc,
15979 self.buf.as_ptr() as usize,
15980 ))
15981 }
15982 pub fn get_net_detect_results(&self) -> Result<(), ErrorContext> {
15983 let mut iter = self.clone();
15984 iter.pos = 0;
15985 for attr in iter {
15986 if let Ok(WowlanTriggersAttrs::NetDetectResults(val)) = attr {
15987 return Ok(val);
15988 }
15989 }
15990 Err(ErrorContext::new_missing(
15991 "WowlanTriggersAttrs",
15992 "NetDetectResults",
15993 self.orig_loc,
15994 self.buf.as_ptr() as usize,
15995 ))
15996 }
15997 pub fn get_unprotected_deauth_disassoc(&self) -> Result<(), ErrorContext> {
15998 let mut iter = self.clone();
15999 iter.pos = 0;
16000 for attr in iter {
16001 if let Ok(WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val)) = attr {
16002 return Ok(val);
16003 }
16004 }
16005 Err(ErrorContext::new_missing(
16006 "WowlanTriggersAttrs",
16007 "UnprotectedDeauthDisassoc",
16008 self.orig_loc,
16009 self.buf.as_ptr() as usize,
16010 ))
16011 }
16012}
16013impl WowlanTriggersAttrs {
16014 pub fn new<'a>(buf: &'a [u8]) -> IterableWowlanTriggersAttrs<'a> {
16015 IterableWowlanTriggersAttrs::with_loc(buf, buf.as_ptr() as usize)
16016 }
16017 fn attr_from_type(r#type: u16) -> Option<&'static str> {
16018 let res = match r#type {
16019 1u16 => "Any",
16020 2u16 => "Disconnect",
16021 3u16 => "MagicPkt",
16022 4u16 => "PktPattern",
16023 5u16 => "GtkRekeySupported",
16024 6u16 => "GtkRekeyFailure",
16025 7u16 => "EapIdentRequest",
16026 8u16 => "4wayHandshake",
16027 9u16 => "RfkillRelease",
16028 10u16 => "WakeupPkt80211",
16029 11u16 => "WakeupPkt80211Len",
16030 12u16 => "WakeupPkt8023",
16031 13u16 => "WakeupPkt8023Len",
16032 14u16 => "TcpConnection",
16033 15u16 => "WakeupTcpMatch",
16034 16u16 => "WakeupTcpConnlost",
16035 17u16 => "WakeupTcpNomoretokens",
16036 18u16 => "NetDetect",
16037 19u16 => "NetDetectResults",
16038 20u16 => "UnprotectedDeauthDisassoc",
16039 _ => return None,
16040 };
16041 Some(res)
16042 }
16043}
16044#[derive(Clone, Copy, Default)]
16045pub struct IterableWowlanTriggersAttrs<'a> {
16046 buf: &'a [u8],
16047 pos: usize,
16048 orig_loc: usize,
16049}
16050impl<'a> IterableWowlanTriggersAttrs<'a> {
16051 fn with_loc(buf: &'a [u8], orig_loc: usize) -> Self {
16052 Self {
16053 buf,
16054 pos: 0,
16055 orig_loc,
16056 }
16057 }
16058 pub fn get_buf(&self) -> &'a [u8] {
16059 self.buf
16060 }
16061}
16062impl<'a> Iterator for IterableWowlanTriggersAttrs<'a> {
16063 type Item = Result<WowlanTriggersAttrs, ErrorContext>;
16064 fn next(&mut self) -> Option<Self::Item> {
16065 let mut pos;
16066 let mut r#type;
16067 loop {
16068 pos = self.pos;
16069 r#type = None;
16070 if self.buf.len() == self.pos {
16071 return None;
16072 }
16073 let Some((header, next)) = chop_header(self.buf, &mut self.pos) else {
16074 self.pos = self.buf.len();
16075 break;
16076 };
16077 r#type = Some(header.r#type);
16078 let res = match header.r#type {
16079 1u16 => WowlanTriggersAttrs::Any(()),
16080 2u16 => WowlanTriggersAttrs::Disconnect(()),
16081 3u16 => WowlanTriggersAttrs::MagicPkt(()),
16082 4u16 => WowlanTriggersAttrs::PktPattern(()),
16083 5u16 => WowlanTriggersAttrs::GtkRekeySupported(()),
16084 6u16 => WowlanTriggersAttrs::GtkRekeyFailure(()),
16085 7u16 => WowlanTriggersAttrs::EapIdentRequest(()),
16086 8u16 => WowlanTriggersAttrs::_4wayHandshake(()),
16087 9u16 => WowlanTriggersAttrs::RfkillRelease(()),
16088 10u16 => WowlanTriggersAttrs::WakeupPkt80211(()),
16089 11u16 => WowlanTriggersAttrs::WakeupPkt80211Len(()),
16090 12u16 => WowlanTriggersAttrs::WakeupPkt8023(()),
16091 13u16 => WowlanTriggersAttrs::WakeupPkt8023Len(()),
16092 14u16 => WowlanTriggersAttrs::TcpConnection(()),
16093 15u16 => WowlanTriggersAttrs::WakeupTcpMatch(()),
16094 16u16 => WowlanTriggersAttrs::WakeupTcpConnlost(()),
16095 17u16 => WowlanTriggersAttrs::WakeupTcpNomoretokens(()),
16096 18u16 => WowlanTriggersAttrs::NetDetect(()),
16097 19u16 => WowlanTriggersAttrs::NetDetectResults(()),
16098 20u16 => WowlanTriggersAttrs::UnprotectedDeauthDisassoc(()),
16099 n if cfg!(any(test, feature = "deny-unknown-attrs")) => break,
16100 n => continue,
16101 };
16102 return Some(Ok(res));
16103 }
16104 Some(Err(ErrorContext::new(
16105 "WowlanTriggersAttrs",
16106 r#type.and_then(|t| WowlanTriggersAttrs::attr_from_type(t)),
16107 self.orig_loc,
16108 self.buf.as_ptr().wrapping_add(pos) as usize,
16109 )))
16110 }
16111}
16112impl std::fmt::Debug for IterableWowlanTriggersAttrs<'_> {
16113 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16114 let mut fmt = f.debug_struct("WowlanTriggersAttrs");
16115 for attr in self.clone() {
16116 let attr = match attr {
16117 Ok(a) => a,
16118 Err(err) => {
16119 fmt.finish()?;
16120 f.write_str("Err(")?;
16121 err.fmt(f)?;
16122 return f.write_str(")");
16123 }
16124 };
16125 match attr {
16126 WowlanTriggersAttrs::Any(val) => fmt.field("Any", &val),
16127 WowlanTriggersAttrs::Disconnect(val) => fmt.field("Disconnect", &val),
16128 WowlanTriggersAttrs::MagicPkt(val) => fmt.field("MagicPkt", &val),
16129 WowlanTriggersAttrs::PktPattern(val) => fmt.field("PktPattern", &val),
16130 WowlanTriggersAttrs::GtkRekeySupported(val) => fmt.field("GtkRekeySupported", &val),
16131 WowlanTriggersAttrs::GtkRekeyFailure(val) => fmt.field("GtkRekeyFailure", &val),
16132 WowlanTriggersAttrs::EapIdentRequest(val) => fmt.field("EapIdentRequest", &val),
16133 WowlanTriggersAttrs::_4wayHandshake(val) => fmt.field("_4wayHandshake", &val),
16134 WowlanTriggersAttrs::RfkillRelease(val) => fmt.field("RfkillRelease", &val),
16135 WowlanTriggersAttrs::WakeupPkt80211(val) => fmt.field("WakeupPkt80211", &val),
16136 WowlanTriggersAttrs::WakeupPkt80211Len(val) => fmt.field("WakeupPkt80211Len", &val),
16137 WowlanTriggersAttrs::WakeupPkt8023(val) => fmt.field("WakeupPkt8023", &val),
16138 WowlanTriggersAttrs::WakeupPkt8023Len(val) => fmt.field("WakeupPkt8023Len", &val),
16139 WowlanTriggersAttrs::TcpConnection(val) => fmt.field("TcpConnection", &val),
16140 WowlanTriggersAttrs::WakeupTcpMatch(val) => fmt.field("WakeupTcpMatch", &val),
16141 WowlanTriggersAttrs::WakeupTcpConnlost(val) => fmt.field("WakeupTcpConnlost", &val),
16142 WowlanTriggersAttrs::WakeupTcpNomoretokens(val) => {
16143 fmt.field("WakeupTcpNomoretokens", &val)
16144 }
16145 WowlanTriggersAttrs::NetDetect(val) => fmt.field("NetDetect", &val),
16146 WowlanTriggersAttrs::NetDetectResults(val) => fmt.field("NetDetectResults", &val),
16147 WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) => {
16148 fmt.field("UnprotectedDeauthDisassoc", &val)
16149 }
16150 };
16151 }
16152 fmt.finish()
16153 }
16154}
16155impl IterableWowlanTriggersAttrs<'_> {
16156 pub fn lookup_attr(
16157 &self,
16158 offset: usize,
16159 missing_type: Option<u16>,
16160 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
16161 let mut stack = Vec::new();
16162 let cur = ErrorContext::calc_offset(self.orig_loc, self.buf.as_ptr() as usize);
16163 if missing_type.is_some() && cur == offset {
16164 stack.push(("WowlanTriggersAttrs", offset));
16165 return (
16166 stack,
16167 missing_type.and_then(|t| WowlanTriggersAttrs::attr_from_type(t)),
16168 );
16169 }
16170 if cur > offset || cur + self.buf.len() < offset {
16171 return (stack, None);
16172 }
16173 let mut attrs = self.clone();
16174 let mut last_off = cur + attrs.pos;
16175 while let Some(attr) = attrs.next() {
16176 let Ok(attr) = attr else { break };
16177 match attr {
16178 WowlanTriggersAttrs::Any(val) => {
16179 if last_off == offset {
16180 stack.push(("Any", last_off));
16181 break;
16182 }
16183 }
16184 WowlanTriggersAttrs::Disconnect(val) => {
16185 if last_off == offset {
16186 stack.push(("Disconnect", last_off));
16187 break;
16188 }
16189 }
16190 WowlanTriggersAttrs::MagicPkt(val) => {
16191 if last_off == offset {
16192 stack.push(("MagicPkt", last_off));
16193 break;
16194 }
16195 }
16196 WowlanTriggersAttrs::PktPattern(val) => {
16197 if last_off == offset {
16198 stack.push(("PktPattern", last_off));
16199 break;
16200 }
16201 }
16202 WowlanTriggersAttrs::GtkRekeySupported(val) => {
16203 if last_off == offset {
16204 stack.push(("GtkRekeySupported", last_off));
16205 break;
16206 }
16207 }
16208 WowlanTriggersAttrs::GtkRekeyFailure(val) => {
16209 if last_off == offset {
16210 stack.push(("GtkRekeyFailure", last_off));
16211 break;
16212 }
16213 }
16214 WowlanTriggersAttrs::EapIdentRequest(val) => {
16215 if last_off == offset {
16216 stack.push(("EapIdentRequest", last_off));
16217 break;
16218 }
16219 }
16220 WowlanTriggersAttrs::_4wayHandshake(val) => {
16221 if last_off == offset {
16222 stack.push(("4wayHandshake", last_off));
16223 break;
16224 }
16225 }
16226 WowlanTriggersAttrs::RfkillRelease(val) => {
16227 if last_off == offset {
16228 stack.push(("RfkillRelease", last_off));
16229 break;
16230 }
16231 }
16232 WowlanTriggersAttrs::WakeupPkt80211(val) => {
16233 if last_off == offset {
16234 stack.push(("WakeupPkt80211", last_off));
16235 break;
16236 }
16237 }
16238 WowlanTriggersAttrs::WakeupPkt80211Len(val) => {
16239 if last_off == offset {
16240 stack.push(("WakeupPkt80211Len", last_off));
16241 break;
16242 }
16243 }
16244 WowlanTriggersAttrs::WakeupPkt8023(val) => {
16245 if last_off == offset {
16246 stack.push(("WakeupPkt8023", last_off));
16247 break;
16248 }
16249 }
16250 WowlanTriggersAttrs::WakeupPkt8023Len(val) => {
16251 if last_off == offset {
16252 stack.push(("WakeupPkt8023Len", last_off));
16253 break;
16254 }
16255 }
16256 WowlanTriggersAttrs::TcpConnection(val) => {
16257 if last_off == offset {
16258 stack.push(("TcpConnection", last_off));
16259 break;
16260 }
16261 }
16262 WowlanTriggersAttrs::WakeupTcpMatch(val) => {
16263 if last_off == offset {
16264 stack.push(("WakeupTcpMatch", last_off));
16265 break;
16266 }
16267 }
16268 WowlanTriggersAttrs::WakeupTcpConnlost(val) => {
16269 if last_off == offset {
16270 stack.push(("WakeupTcpConnlost", last_off));
16271 break;
16272 }
16273 }
16274 WowlanTriggersAttrs::WakeupTcpNomoretokens(val) => {
16275 if last_off == offset {
16276 stack.push(("WakeupTcpNomoretokens", last_off));
16277 break;
16278 }
16279 }
16280 WowlanTriggersAttrs::NetDetect(val) => {
16281 if last_off == offset {
16282 stack.push(("NetDetect", last_off));
16283 break;
16284 }
16285 }
16286 WowlanTriggersAttrs::NetDetectResults(val) => {
16287 if last_off == offset {
16288 stack.push(("NetDetectResults", last_off));
16289 break;
16290 }
16291 }
16292 WowlanTriggersAttrs::UnprotectedDeauthDisassoc(val) => {
16293 if last_off == offset {
16294 stack.push(("UnprotectedDeauthDisassoc", last_off));
16295 break;
16296 }
16297 }
16298 _ => {}
16299 };
16300 last_off = cur + attrs.pos;
16301 }
16302 if !stack.is_empty() {
16303 stack.push(("WowlanTriggersAttrs", cur));
16304 }
16305 (stack, None)
16306 }
16307}
16308pub struct PushNl80211Attrs<Prev: Pusher> {
16309 pub(crate) prev: Option<Prev>,
16310 pub(crate) header_offset: Option<usize>,
16311}
16312impl<Prev: Pusher> Pusher for PushNl80211Attrs<Prev> {
16313 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
16314 self.prev.as_mut().unwrap().as_vec_mut()
16315 }
16316 fn as_vec(&self) -> &Vec<u8> {
16317 self.prev.as_ref().unwrap().as_vec()
16318 }
16319}
16320pub struct PushArrayU32<Prev: Pusher> {
16321 pub(crate) prev: Option<Prev>,
16322 pub(crate) header_offset: Option<usize>,
16323 pub(crate) counter: u16,
16324}
16325impl<Prev: Pusher> Pusher for PushArrayU32<Prev> {
16326 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
16327 self.prev.as_mut().unwrap().as_vec_mut()
16328 }
16329 fn as_vec(&self) -> &Vec<u8> {
16330 self.prev.as_ref().unwrap().as_vec()
16331 }
16332}
16333impl<Prev: Pusher> PushArrayU32<Prev> {
16334 pub fn new(prev: Prev) -> Self {
16335 Self {
16336 prev: Some(prev),
16337 header_offset: None,
16338 counter: 0,
16339 }
16340 }
16341 pub fn end_array(mut self) -> Prev {
16342 let mut prev = self.prev.take().unwrap();
16343 if let Some(header_offset) = &self.header_offset {
16344 finalize_nested_header(prev.as_vec_mut(), *header_offset);
16345 }
16346 prev
16347 }
16348 pub fn entry(mut self, value: u32) -> Self {
16349 let index = self.counter;
16350 self.counter += 1;
16351 push_header(self.as_vec_mut(), index, 4 as u16);
16352 self.as_vec_mut().extend(value.to_ne_bytes());
16353 self
16354 }
16355}
16356impl<Prev: Pusher> Drop for PushArrayU32<Prev> {
16357 fn drop(&mut self) {
16358 if let Some(prev) = &mut self.prev {
16359 if let Some(header_offset) = &self.header_offset {
16360 finalize_nested_header(prev.as_vec_mut(), *header_offset);
16361 }
16362 }
16363 }
16364}
16365pub struct PushArrayIfCombinationAttributes<Prev: Pusher> {
16366 pub(crate) prev: Option<Prev>,
16367 pub(crate) header_offset: Option<usize>,
16368 pub(crate) counter: u16,
16369}
16370impl<Prev: Pusher> Pusher for PushArrayIfCombinationAttributes<Prev> {
16371 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
16372 self.prev.as_mut().unwrap().as_vec_mut()
16373 }
16374 fn as_vec(&self) -> &Vec<u8> {
16375 self.prev.as_ref().unwrap().as_vec()
16376 }
16377}
16378impl<Prev: Pusher> PushArrayIfCombinationAttributes<Prev> {
16379 pub fn new(prev: Prev) -> Self {
16380 Self {
16381 prev: Some(prev),
16382 header_offset: None,
16383 counter: 0,
16384 }
16385 }
16386 pub fn end_array(mut self) -> Prev {
16387 let mut prev = self.prev.take().unwrap();
16388 if let Some(header_offset) = &self.header_offset {
16389 finalize_nested_header(prev.as_vec_mut(), *header_offset);
16390 }
16391 prev
16392 }
16393 pub fn entry_nested(mut self) -> PushIfCombinationAttributes<Self> {
16394 let index = self.counter;
16395 self.counter += 1;
16396 let header_offset = push_nested_header(self.as_vec_mut(), index);
16397 PushIfCombinationAttributes {
16398 prev: Some(self),
16399 header_offset: Some(header_offset),
16400 }
16401 }
16402}
16403impl<Prev: Pusher> Drop for PushArrayIfCombinationAttributes<Prev> {
16404 fn drop(&mut self) {
16405 if let Some(prev) = &mut self.prev {
16406 if let Some(header_offset) = &self.header_offset {
16407 finalize_nested_header(prev.as_vec_mut(), *header_offset);
16408 }
16409 }
16410 }
16411}
16412impl<Prev: Pusher> PushNl80211Attrs<Prev> {
16413 pub fn new(prev: Prev) -> Self {
16414 Self {
16415 prev: Some(prev),
16416 header_offset: None,
16417 }
16418 }
16419 pub fn end_nested(mut self) -> Prev {
16420 let mut prev = self.prev.take().unwrap();
16421 if let Some(header_offset) = &self.header_offset {
16422 finalize_nested_header(prev.as_vec_mut(), *header_offset);
16423 }
16424 prev
16425 }
16426 pub fn push_wiphy(mut self, value: u32) -> Self {
16427 push_header(self.as_vec_mut(), 1u16, 4 as u16);
16428 self.as_vec_mut().extend(value.to_ne_bytes());
16429 self
16430 }
16431 pub fn push_wiphy_name(mut self, value: &CStr) -> Self {
16432 push_header(
16433 self.as_vec_mut(),
16434 2u16,
16435 value.to_bytes_with_nul().len() as u16,
16436 );
16437 self.as_vec_mut().extend(value.to_bytes_with_nul());
16438 self
16439 }
16440 pub fn push_wiphy_name_bytes(mut self, value: &[u8]) -> Self {
16441 push_header(self.as_vec_mut(), 2u16, (value.len() + 1) as u16);
16442 self.as_vec_mut().extend(value);
16443 self.as_vec_mut().push(0);
16444 self
16445 }
16446 pub fn push_ifindex(mut self, value: u32) -> Self {
16447 push_header(self.as_vec_mut(), 3u16, 4 as u16);
16448 self.as_vec_mut().extend(value.to_ne_bytes());
16449 self
16450 }
16451 pub fn push_ifname(mut self, value: &CStr) -> Self {
16452 push_header(
16453 self.as_vec_mut(),
16454 4u16,
16455 value.to_bytes_with_nul().len() as u16,
16456 );
16457 self.as_vec_mut().extend(value.to_bytes_with_nul());
16458 self
16459 }
16460 pub fn push_ifname_bytes(mut self, value: &[u8]) -> Self {
16461 push_header(self.as_vec_mut(), 4u16, (value.len() + 1) as u16);
16462 self.as_vec_mut().extend(value);
16463 self.as_vec_mut().push(0);
16464 self
16465 }
16466 pub fn push_iftype(mut self, value: u32) -> Self {
16467 push_header(self.as_vec_mut(), 5u16, 4 as u16);
16468 self.as_vec_mut().extend(value.to_ne_bytes());
16469 self
16470 }
16471 pub fn push_mac(mut self, value: &[u8]) -> Self {
16472 push_header(self.as_vec_mut(), 6u16, value.len() as u16);
16473 self.as_vec_mut().extend(value);
16474 self
16475 }
16476 pub fn push_key_data(mut self, value: &[u8]) -> Self {
16477 push_header(self.as_vec_mut(), 7u16, value.len() as u16);
16478 self.as_vec_mut().extend(value);
16479 self
16480 }
16481 pub fn push_key_idx(mut self, value: u8) -> Self {
16482 push_header(self.as_vec_mut(), 8u16, 1 as u16);
16483 self.as_vec_mut().extend(value.to_ne_bytes());
16484 self
16485 }
16486 pub fn push_key_cipher(mut self, value: u32) -> Self {
16487 push_header(self.as_vec_mut(), 9u16, 4 as u16);
16488 self.as_vec_mut().extend(value.to_ne_bytes());
16489 self
16490 }
16491 pub fn push_key_seq(mut self, value: &[u8]) -> Self {
16492 push_header(self.as_vec_mut(), 10u16, value.len() as u16);
16493 self.as_vec_mut().extend(value);
16494 self
16495 }
16496 pub fn push_key_default(mut self, value: ()) -> Self {
16497 push_header(self.as_vec_mut(), 11u16, 0 as u16);
16498 self
16499 }
16500 pub fn push_beacon_interval(mut self, value: u32) -> Self {
16501 push_header(self.as_vec_mut(), 12u16, 4 as u16);
16502 self.as_vec_mut().extend(value.to_ne_bytes());
16503 self
16504 }
16505 pub fn push_dtim_period(mut self, value: u32) -> Self {
16506 push_header(self.as_vec_mut(), 13u16, 4 as u16);
16507 self.as_vec_mut().extend(value.to_ne_bytes());
16508 self
16509 }
16510 pub fn push_beacon_head(mut self, value: &[u8]) -> Self {
16511 push_header(self.as_vec_mut(), 14u16, value.len() as u16);
16512 self.as_vec_mut().extend(value);
16513 self
16514 }
16515 pub fn push_beacon_tail(mut self, value: &[u8]) -> Self {
16516 push_header(self.as_vec_mut(), 15u16, value.len() as u16);
16517 self.as_vec_mut().extend(value);
16518 self
16519 }
16520 pub fn push_sta_aid(mut self, value: u16) -> Self {
16521 push_header(self.as_vec_mut(), 16u16, 2 as u16);
16522 self.as_vec_mut().extend(value.to_ne_bytes());
16523 self
16524 }
16525 pub fn push_sta_flags(mut self, value: &[u8]) -> Self {
16526 push_header(self.as_vec_mut(), 17u16, value.len() as u16);
16527 self.as_vec_mut().extend(value);
16528 self
16529 }
16530 pub fn push_sta_listen_interval(mut self, value: u16) -> Self {
16531 push_header(self.as_vec_mut(), 18u16, 2 as u16);
16532 self.as_vec_mut().extend(value.to_ne_bytes());
16533 self
16534 }
16535 pub fn push_sta_supported_rates(mut self, value: &[u8]) -> Self {
16536 push_header(self.as_vec_mut(), 19u16, value.len() as u16);
16537 self.as_vec_mut().extend(value);
16538 self
16539 }
16540 pub fn push_sta_vlan(mut self, value: u32) -> Self {
16541 push_header(self.as_vec_mut(), 20u16, 4 as u16);
16542 self.as_vec_mut().extend(value.to_ne_bytes());
16543 self
16544 }
16545 pub fn push_sta_info(mut self, value: &[u8]) -> Self {
16546 push_header(self.as_vec_mut(), 21u16, value.len() as u16);
16547 self.as_vec_mut().extend(value);
16548 self
16549 }
16550 pub fn nested_wiphy_bands(mut self) -> PushWiphyBands<Self> {
16551 let header_offset = push_nested_header(self.as_vec_mut(), 22u16);
16552 PushWiphyBands {
16553 prev: Some(self),
16554 header_offset: Some(header_offset),
16555 }
16556 }
16557 pub fn push_mntr_flags(mut self, value: &[u8]) -> Self {
16558 push_header(self.as_vec_mut(), 23u16, value.len() as u16);
16559 self.as_vec_mut().extend(value);
16560 self
16561 }
16562 pub fn push_mesh_id(mut self, value: &[u8]) -> Self {
16563 push_header(self.as_vec_mut(), 24u16, value.len() as u16);
16564 self.as_vec_mut().extend(value);
16565 self
16566 }
16567 pub fn push_sta_plink_action(mut self, value: u8) -> Self {
16568 push_header(self.as_vec_mut(), 25u16, 1 as u16);
16569 self.as_vec_mut().extend(value.to_ne_bytes());
16570 self
16571 }
16572 pub fn push_mpath_next_hop(mut self, value: &[u8]) -> Self {
16573 push_header(self.as_vec_mut(), 26u16, value.len() as u16);
16574 self.as_vec_mut().extend(value);
16575 self
16576 }
16577 pub fn push_mpath_info(mut self, value: &[u8]) -> Self {
16578 push_header(self.as_vec_mut(), 27u16, value.len() as u16);
16579 self.as_vec_mut().extend(value);
16580 self
16581 }
16582 pub fn push_bss_cts_prot(mut self, value: u8) -> Self {
16583 push_header(self.as_vec_mut(), 28u16, 1 as u16);
16584 self.as_vec_mut().extend(value.to_ne_bytes());
16585 self
16586 }
16587 pub fn push_bss_short_preamble(mut self, value: u8) -> Self {
16588 push_header(self.as_vec_mut(), 29u16, 1 as u16);
16589 self.as_vec_mut().extend(value.to_ne_bytes());
16590 self
16591 }
16592 pub fn push_bss_short_slot_time(mut self, value: u8) -> Self {
16593 push_header(self.as_vec_mut(), 30u16, 1 as u16);
16594 self.as_vec_mut().extend(value.to_ne_bytes());
16595 self
16596 }
16597 pub fn push_ht_capability(mut self, value: &[u8]) -> Self {
16598 push_header(self.as_vec_mut(), 31u16, value.len() as u16);
16599 self.as_vec_mut().extend(value);
16600 self
16601 }
16602 pub fn nested_supported_iftypes(mut self) -> PushSupportedIftypes<Self> {
16603 let header_offset = push_nested_header(self.as_vec_mut(), 32u16);
16604 PushSupportedIftypes {
16605 prev: Some(self),
16606 header_offset: Some(header_offset),
16607 }
16608 }
16609 pub fn push_reg_alpha2(mut self, value: &[u8]) -> Self {
16610 push_header(self.as_vec_mut(), 33u16, value.len() as u16);
16611 self.as_vec_mut().extend(value);
16612 self
16613 }
16614 pub fn push_reg_rules(mut self, value: &[u8]) -> Self {
16615 push_header(self.as_vec_mut(), 34u16, value.len() as u16);
16616 self.as_vec_mut().extend(value);
16617 self
16618 }
16619 pub fn push_mesh_config(mut self, value: &[u8]) -> Self {
16620 push_header(self.as_vec_mut(), 35u16, value.len() as u16);
16621 self.as_vec_mut().extend(value);
16622 self
16623 }
16624 pub fn push_bss_basic_rates(mut self, value: &[u8]) -> Self {
16625 push_header(self.as_vec_mut(), 36u16, value.len() as u16);
16626 self.as_vec_mut().extend(value);
16627 self
16628 }
16629 pub fn push_wiphy_txq_params(mut self, value: &[u8]) -> Self {
16630 push_header(self.as_vec_mut(), 37u16, value.len() as u16);
16631 self.as_vec_mut().extend(value);
16632 self
16633 }
16634 pub fn push_wiphy_freq(mut self, value: u32) -> Self {
16635 push_header(self.as_vec_mut(), 38u16, 4 as u16);
16636 self.as_vec_mut().extend(value.to_ne_bytes());
16637 self
16638 }
16639 #[doc = "Associated type: [`ChannelType`] (enum)"]
16640 pub fn push_wiphy_channel_type(mut self, value: u32) -> Self {
16641 push_header(self.as_vec_mut(), 39u16, 4 as u16);
16642 self.as_vec_mut().extend(value.to_ne_bytes());
16643 self
16644 }
16645 pub fn push_key_default_mgmt(mut self, value: ()) -> Self {
16646 push_header(self.as_vec_mut(), 40u16, 0 as u16);
16647 self
16648 }
16649 pub fn push_mgmt_subtype(mut self, value: u8) -> Self {
16650 push_header(self.as_vec_mut(), 41u16, 1 as u16);
16651 self.as_vec_mut().extend(value.to_ne_bytes());
16652 self
16653 }
16654 pub fn push_ie(mut self, value: &[u8]) -> Self {
16655 push_header(self.as_vec_mut(), 42u16, value.len() as u16);
16656 self.as_vec_mut().extend(value);
16657 self
16658 }
16659 pub fn push_max_num_scan_ssids(mut self, value: u8) -> Self {
16660 push_header(self.as_vec_mut(), 43u16, 1 as u16);
16661 self.as_vec_mut().extend(value.to_ne_bytes());
16662 self
16663 }
16664 pub fn push_scan_frequencies(mut self, value: &[u8]) -> Self {
16665 push_header(self.as_vec_mut(), 44u16, value.len() as u16);
16666 self.as_vec_mut().extend(value);
16667 self
16668 }
16669 pub fn push_scan_ssids(mut self, value: &[u8]) -> Self {
16670 push_header(self.as_vec_mut(), 45u16, value.len() as u16);
16671 self.as_vec_mut().extend(value);
16672 self
16673 }
16674 pub fn push_generation(mut self, value: u32) -> Self {
16675 push_header(self.as_vec_mut(), 46u16, 4 as u16);
16676 self.as_vec_mut().extend(value.to_ne_bytes());
16677 self
16678 }
16679 pub fn push_bss(mut self, value: &[u8]) -> Self {
16680 push_header(self.as_vec_mut(), 47u16, value.len() as u16);
16681 self.as_vec_mut().extend(value);
16682 self
16683 }
16684 pub fn push_reg_initiator(mut self, value: u8) -> Self {
16685 push_header(self.as_vec_mut(), 48u16, 1 as u16);
16686 self.as_vec_mut().extend(value.to_ne_bytes());
16687 self
16688 }
16689 pub fn push_reg_type(mut self, value: u8) -> Self {
16690 push_header(self.as_vec_mut(), 49u16, 1 as u16);
16691 self.as_vec_mut().extend(value.to_ne_bytes());
16692 self
16693 }
16694 #[doc = "Associated type: [`Commands`] (enum)"]
16695 pub fn array_supported_commands(mut self) -> PushArrayU32<Self> {
16696 let header_offset = push_nested_header(self.as_vec_mut(), 50u16);
16697 PushArrayU32 {
16698 prev: Some(self),
16699 header_offset: Some(header_offset),
16700 counter: 0,
16701 }
16702 }
16703 pub fn push_frame(mut self, value: &[u8]) -> Self {
16704 push_header(self.as_vec_mut(), 51u16, value.len() as u16);
16705 self.as_vec_mut().extend(value);
16706 self
16707 }
16708 pub fn push_ssid(mut self, value: &[u8]) -> Self {
16709 push_header(self.as_vec_mut(), 52u16, value.len() as u16);
16710 self.as_vec_mut().extend(value);
16711 self
16712 }
16713 pub fn push_auth_type(mut self, value: u32) -> Self {
16714 push_header(self.as_vec_mut(), 53u16, 4 as u16);
16715 self.as_vec_mut().extend(value.to_ne_bytes());
16716 self
16717 }
16718 pub fn push_reason_code(mut self, value: u16) -> Self {
16719 push_header(self.as_vec_mut(), 54u16, 2 as u16);
16720 self.as_vec_mut().extend(value.to_ne_bytes());
16721 self
16722 }
16723 pub fn push_key_type(mut self, value: u32) -> Self {
16724 push_header(self.as_vec_mut(), 55u16, 4 as u16);
16725 self.as_vec_mut().extend(value.to_ne_bytes());
16726 self
16727 }
16728 pub fn push_max_scan_ie_len(mut self, value: u16) -> Self {
16729 push_header(self.as_vec_mut(), 56u16, 2 as u16);
16730 self.as_vec_mut().extend(value.to_ne_bytes());
16731 self
16732 }
16733 pub fn push_cipher_suites(mut self, value: &[u8]) -> Self {
16734 push_header(self.as_vec_mut(), 57u16, value.len() as u16);
16735 self.as_vec_mut().extend(value);
16736 self
16737 }
16738 pub fn push_freq_before(mut self, value: &[u8]) -> Self {
16739 push_header(self.as_vec_mut(), 58u16, value.len() as u16);
16740 self.as_vec_mut().extend(value);
16741 self
16742 }
16743 pub fn push_freq_after(mut self, value: &[u8]) -> Self {
16744 push_header(self.as_vec_mut(), 59u16, value.len() as u16);
16745 self.as_vec_mut().extend(value);
16746 self
16747 }
16748 pub fn push_freq_fixed(mut self, value: ()) -> Self {
16749 push_header(self.as_vec_mut(), 60u16, 0 as u16);
16750 self
16751 }
16752 pub fn push_wiphy_retry_short(mut self, value: u8) -> Self {
16753 push_header(self.as_vec_mut(), 61u16, 1 as u16);
16754 self.as_vec_mut().extend(value.to_ne_bytes());
16755 self
16756 }
16757 pub fn push_wiphy_retry_long(mut self, value: u8) -> Self {
16758 push_header(self.as_vec_mut(), 62u16, 1 as u16);
16759 self.as_vec_mut().extend(value.to_ne_bytes());
16760 self
16761 }
16762 pub fn push_wiphy_frag_threshold(mut self, value: u32) -> Self {
16763 push_header(self.as_vec_mut(), 63u16, 4 as u16);
16764 self.as_vec_mut().extend(value.to_ne_bytes());
16765 self
16766 }
16767 pub fn push_wiphy_rts_threshold(mut self, value: u32) -> Self {
16768 push_header(self.as_vec_mut(), 64u16, 4 as u16);
16769 self.as_vec_mut().extend(value.to_ne_bytes());
16770 self
16771 }
16772 pub fn push_timed_out(mut self, value: ()) -> Self {
16773 push_header(self.as_vec_mut(), 65u16, 0 as u16);
16774 self
16775 }
16776 pub fn push_use_mfp(mut self, value: u32) -> Self {
16777 push_header(self.as_vec_mut(), 66u16, 4 as u16);
16778 self.as_vec_mut().extend(value.to_ne_bytes());
16779 self
16780 }
16781 pub fn push_sta_flags2(mut self, value: StaFlagUpdate) -> Self {
16782 push_header(self.as_vec_mut(), 67u16, value.as_slice().len() as u16);
16783 self.as_vec_mut().extend(value.as_slice());
16784 self
16785 }
16786 pub fn push_control_port(mut self, value: ()) -> Self {
16787 push_header(self.as_vec_mut(), 68u16, 0 as u16);
16788 self
16789 }
16790 pub fn push_testdata(mut self, value: &[u8]) -> Self {
16791 push_header(self.as_vec_mut(), 69u16, value.len() as u16);
16792 self.as_vec_mut().extend(value);
16793 self
16794 }
16795 pub fn push_privacy(mut self, value: ()) -> Self {
16796 push_header(self.as_vec_mut(), 70u16, 0 as u16);
16797 self
16798 }
16799 pub fn push_disconnected_by_ap(mut self, value: ()) -> Self {
16800 push_header(self.as_vec_mut(), 71u16, 0 as u16);
16801 self
16802 }
16803 pub fn push_status_code(mut self, value: u16) -> Self {
16804 push_header(self.as_vec_mut(), 72u16, 2 as u16);
16805 self.as_vec_mut().extend(value.to_ne_bytes());
16806 self
16807 }
16808 pub fn push_cipher_suites_pairwise(mut self, value: &[u8]) -> Self {
16809 push_header(self.as_vec_mut(), 73u16, value.len() as u16);
16810 self.as_vec_mut().extend(value);
16811 self
16812 }
16813 pub fn push_cipher_suite_group(mut self, value: u32) -> Self {
16814 push_header(self.as_vec_mut(), 74u16, 4 as u16);
16815 self.as_vec_mut().extend(value.to_ne_bytes());
16816 self
16817 }
16818 pub fn push_wpa_versions(mut self, value: u32) -> Self {
16819 push_header(self.as_vec_mut(), 75u16, 4 as u16);
16820 self.as_vec_mut().extend(value.to_ne_bytes());
16821 self
16822 }
16823 pub fn push_akm_suites(mut self, value: &[u8]) -> Self {
16824 push_header(self.as_vec_mut(), 76u16, value.len() as u16);
16825 self.as_vec_mut().extend(value);
16826 self
16827 }
16828 pub fn push_req_ie(mut self, value: &[u8]) -> Self {
16829 push_header(self.as_vec_mut(), 77u16, value.len() as u16);
16830 self.as_vec_mut().extend(value);
16831 self
16832 }
16833 pub fn push_resp_ie(mut self, value: &[u8]) -> Self {
16834 push_header(self.as_vec_mut(), 78u16, value.len() as u16);
16835 self.as_vec_mut().extend(value);
16836 self
16837 }
16838 pub fn push_prev_bssid(mut self, value: &[u8]) -> Self {
16839 push_header(self.as_vec_mut(), 79u16, value.len() as u16);
16840 self.as_vec_mut().extend(value);
16841 self
16842 }
16843 pub fn push_key(mut self, value: &[u8]) -> Self {
16844 push_header(self.as_vec_mut(), 80u16, value.len() as u16);
16845 self.as_vec_mut().extend(value);
16846 self
16847 }
16848 pub fn push_keys(mut self, value: &[u8]) -> Self {
16849 push_header(self.as_vec_mut(), 81u16, value.len() as u16);
16850 self.as_vec_mut().extend(value);
16851 self
16852 }
16853 pub fn push_pid(mut self, value: u32) -> Self {
16854 push_header(self.as_vec_mut(), 82u16, 4 as u16);
16855 self.as_vec_mut().extend(value.to_ne_bytes());
16856 self
16857 }
16858 pub fn push_4addr(mut self, value: u8) -> Self {
16859 push_header(self.as_vec_mut(), 83u16, 1 as u16);
16860 self.as_vec_mut().extend(value.to_ne_bytes());
16861 self
16862 }
16863 pub fn push_survey_info(mut self, value: &[u8]) -> Self {
16864 push_header(self.as_vec_mut(), 84u16, value.len() as u16);
16865 self.as_vec_mut().extend(value);
16866 self
16867 }
16868 pub fn push_pmkid(mut self, value: &[u8]) -> Self {
16869 push_header(self.as_vec_mut(), 85u16, value.len() as u16);
16870 self.as_vec_mut().extend(value);
16871 self
16872 }
16873 pub fn push_max_num_pmkids(mut self, value: u8) -> Self {
16874 push_header(self.as_vec_mut(), 86u16, 1 as u16);
16875 self.as_vec_mut().extend(value.to_ne_bytes());
16876 self
16877 }
16878 pub fn push_duration(mut self, value: u32) -> Self {
16879 push_header(self.as_vec_mut(), 87u16, 4 as u16);
16880 self.as_vec_mut().extend(value.to_ne_bytes());
16881 self
16882 }
16883 pub fn push_cookie(mut self, value: u64) -> Self {
16884 push_header(self.as_vec_mut(), 88u16, 8 as u16);
16885 self.as_vec_mut().extend(value.to_ne_bytes());
16886 self
16887 }
16888 pub fn push_wiphy_coverage_class(mut self, value: u8) -> Self {
16889 push_header(self.as_vec_mut(), 89u16, 1 as u16);
16890 self.as_vec_mut().extend(value.to_ne_bytes());
16891 self
16892 }
16893 pub fn push_tx_rates(mut self, value: &[u8]) -> Self {
16894 push_header(self.as_vec_mut(), 90u16, value.len() as u16);
16895 self.as_vec_mut().extend(value);
16896 self
16897 }
16898 pub fn push_frame_match(mut self, value: &[u8]) -> Self {
16899 push_header(self.as_vec_mut(), 91u16, value.len() as u16);
16900 self.as_vec_mut().extend(value);
16901 self
16902 }
16903 pub fn push_ack(mut self, value: ()) -> Self {
16904 push_header(self.as_vec_mut(), 92u16, 0 as u16);
16905 self
16906 }
16907 pub fn push_ps_state(mut self, value: u32) -> Self {
16908 push_header(self.as_vec_mut(), 93u16, 4 as u16);
16909 self.as_vec_mut().extend(value.to_ne_bytes());
16910 self
16911 }
16912 pub fn push_cqm(mut self, value: &[u8]) -> Self {
16913 push_header(self.as_vec_mut(), 94u16, value.len() as u16);
16914 self.as_vec_mut().extend(value);
16915 self
16916 }
16917 pub fn push_local_state_change(mut self, value: ()) -> Self {
16918 push_header(self.as_vec_mut(), 95u16, 0 as u16);
16919 self
16920 }
16921 pub fn push_ap_isolate(mut self, value: u8) -> Self {
16922 push_header(self.as_vec_mut(), 96u16, 1 as u16);
16923 self.as_vec_mut().extend(value.to_ne_bytes());
16924 self
16925 }
16926 pub fn push_wiphy_tx_power_setting(mut self, value: u32) -> Self {
16927 push_header(self.as_vec_mut(), 97u16, 4 as u16);
16928 self.as_vec_mut().extend(value.to_ne_bytes());
16929 self
16930 }
16931 pub fn push_wiphy_tx_power_level(mut self, value: u32) -> Self {
16932 push_header(self.as_vec_mut(), 98u16, 4 as u16);
16933 self.as_vec_mut().extend(value.to_ne_bytes());
16934 self
16935 }
16936 pub fn nested_tx_frame_types(mut self) -> PushIftypeAttrs<Self> {
16937 let header_offset = push_nested_header(self.as_vec_mut(), 99u16);
16938 PushIftypeAttrs {
16939 prev: Some(self),
16940 header_offset: Some(header_offset),
16941 }
16942 }
16943 pub fn nested_rx_frame_types(mut self) -> PushIftypeAttrs<Self> {
16944 let header_offset = push_nested_header(self.as_vec_mut(), 100u16);
16945 PushIftypeAttrs {
16946 prev: Some(self),
16947 header_offset: Some(header_offset),
16948 }
16949 }
16950 pub fn push_frame_type(mut self, value: u16) -> Self {
16951 push_header(self.as_vec_mut(), 101u16, 2 as u16);
16952 self.as_vec_mut().extend(value.to_ne_bytes());
16953 self
16954 }
16955 pub fn push_control_port_ethertype(mut self, value: ()) -> Self {
16956 push_header(self.as_vec_mut(), 102u16, 0 as u16);
16957 self
16958 }
16959 pub fn push_control_port_no_encrypt(mut self, value: ()) -> Self {
16960 push_header(self.as_vec_mut(), 103u16, 0 as u16);
16961 self
16962 }
16963 pub fn push_support_ibss_rsn(mut self, value: ()) -> Self {
16964 push_header(self.as_vec_mut(), 104u16, 0 as u16);
16965 self
16966 }
16967 pub fn push_wiphy_antenna_tx(mut self, value: u32) -> Self {
16968 push_header(self.as_vec_mut(), 105u16, 4 as u16);
16969 self.as_vec_mut().extend(value.to_ne_bytes());
16970 self
16971 }
16972 pub fn push_wiphy_antenna_rx(mut self, value: u32) -> Self {
16973 push_header(self.as_vec_mut(), 106u16, 4 as u16);
16974 self.as_vec_mut().extend(value.to_ne_bytes());
16975 self
16976 }
16977 pub fn push_mcast_rate(mut self, value: u32) -> Self {
16978 push_header(self.as_vec_mut(), 107u16, 4 as u16);
16979 self.as_vec_mut().extend(value.to_ne_bytes());
16980 self
16981 }
16982 pub fn push_offchannel_tx_ok(mut self, value: ()) -> Self {
16983 push_header(self.as_vec_mut(), 108u16, 0 as u16);
16984 self
16985 }
16986 pub fn push_bss_ht_opmode(mut self, value: u16) -> Self {
16987 push_header(self.as_vec_mut(), 109u16, 2 as u16);
16988 self.as_vec_mut().extend(value.to_ne_bytes());
16989 self
16990 }
16991 pub fn push_key_default_types(mut self, value: &[u8]) -> Self {
16992 push_header(self.as_vec_mut(), 110u16, value.len() as u16);
16993 self.as_vec_mut().extend(value);
16994 self
16995 }
16996 pub fn push_max_remain_on_channel_duration(mut self, value: u32) -> Self {
16997 push_header(self.as_vec_mut(), 111u16, 4 as u16);
16998 self.as_vec_mut().extend(value.to_ne_bytes());
16999 self
17000 }
17001 pub fn push_mesh_setup(mut self, value: &[u8]) -> Self {
17002 push_header(self.as_vec_mut(), 112u16, value.len() as u16);
17003 self.as_vec_mut().extend(value);
17004 self
17005 }
17006 pub fn push_wiphy_antenna_avail_tx(mut self, value: u32) -> Self {
17007 push_header(self.as_vec_mut(), 113u16, 4 as u16);
17008 self.as_vec_mut().extend(value.to_ne_bytes());
17009 self
17010 }
17011 pub fn push_wiphy_antenna_avail_rx(mut self, value: u32) -> Self {
17012 push_header(self.as_vec_mut(), 114u16, 4 as u16);
17013 self.as_vec_mut().extend(value.to_ne_bytes());
17014 self
17015 }
17016 pub fn push_support_mesh_auth(mut self, value: ()) -> Self {
17017 push_header(self.as_vec_mut(), 115u16, 0 as u16);
17018 self
17019 }
17020 pub fn push_sta_plink_state(mut self, value: u8) -> Self {
17021 push_header(self.as_vec_mut(), 116u16, 1 as u16);
17022 self.as_vec_mut().extend(value.to_ne_bytes());
17023 self
17024 }
17025 pub fn push_wowlan_triggers(mut self, value: &[u8]) -> Self {
17026 push_header(self.as_vec_mut(), 117u16, value.len() as u16);
17027 self.as_vec_mut().extend(value);
17028 self
17029 }
17030 pub fn nested_wowlan_triggers_supported(mut self) -> PushWowlanTriggersAttrs<Self> {
17031 let header_offset = push_nested_header(self.as_vec_mut(), 118u16);
17032 PushWowlanTriggersAttrs {
17033 prev: Some(self),
17034 header_offset: Some(header_offset),
17035 }
17036 }
17037 pub fn push_sched_scan_interval(mut self, value: u32) -> Self {
17038 push_header(self.as_vec_mut(), 119u16, 4 as u16);
17039 self.as_vec_mut().extend(value.to_ne_bytes());
17040 self
17041 }
17042 pub fn array_interface_combinations(mut self) -> PushArrayIfCombinationAttributes<Self> {
17043 let header_offset = push_nested_header(self.as_vec_mut(), 120u16);
17044 PushArrayIfCombinationAttributes {
17045 prev: Some(self),
17046 header_offset: Some(header_offset),
17047 counter: 0,
17048 }
17049 }
17050 pub fn nested_software_iftypes(mut self) -> PushSupportedIftypes<Self> {
17051 let header_offset = push_nested_header(self.as_vec_mut(), 121u16);
17052 PushSupportedIftypes {
17053 prev: Some(self),
17054 header_offset: Some(header_offset),
17055 }
17056 }
17057 pub fn push_rekey_data(mut self, value: &[u8]) -> Self {
17058 push_header(self.as_vec_mut(), 122u16, value.len() as u16);
17059 self.as_vec_mut().extend(value);
17060 self
17061 }
17062 pub fn push_max_num_sched_scan_ssids(mut self, value: u8) -> Self {
17063 push_header(self.as_vec_mut(), 123u16, 1 as u16);
17064 self.as_vec_mut().extend(value.to_ne_bytes());
17065 self
17066 }
17067 pub fn push_max_sched_scan_ie_len(mut self, value: u16) -> Self {
17068 push_header(self.as_vec_mut(), 124u16, 2 as u16);
17069 self.as_vec_mut().extend(value.to_ne_bytes());
17070 self
17071 }
17072 pub fn push_scan_supp_rates(mut self, value: &[u8]) -> Self {
17073 push_header(self.as_vec_mut(), 125u16, value.len() as u16);
17074 self.as_vec_mut().extend(value);
17075 self
17076 }
17077 pub fn push_hidden_ssid(mut self, value: u32) -> Self {
17078 push_header(self.as_vec_mut(), 126u16, 4 as u16);
17079 self.as_vec_mut().extend(value.to_ne_bytes());
17080 self
17081 }
17082 pub fn push_ie_probe_resp(mut self, value: &[u8]) -> Self {
17083 push_header(self.as_vec_mut(), 127u16, value.len() as u16);
17084 self.as_vec_mut().extend(value);
17085 self
17086 }
17087 pub fn push_ie_assoc_resp(mut self, value: &[u8]) -> Self {
17088 push_header(self.as_vec_mut(), 128u16, value.len() as u16);
17089 self.as_vec_mut().extend(value);
17090 self
17091 }
17092 pub fn push_sta_wme(mut self, value: &[u8]) -> Self {
17093 push_header(self.as_vec_mut(), 129u16, value.len() as u16);
17094 self.as_vec_mut().extend(value);
17095 self
17096 }
17097 pub fn push_support_ap_uapsd(mut self, value: ()) -> Self {
17098 push_header(self.as_vec_mut(), 130u16, 0 as u16);
17099 self
17100 }
17101 pub fn push_roam_support(mut self, value: ()) -> Self {
17102 push_header(self.as_vec_mut(), 131u16, 0 as u16);
17103 self
17104 }
17105 pub fn push_sched_scan_match(mut self, value: &[u8]) -> Self {
17106 push_header(self.as_vec_mut(), 132u16, value.len() as u16);
17107 self.as_vec_mut().extend(value);
17108 self
17109 }
17110 pub fn push_max_match_sets(mut self, value: u8) -> Self {
17111 push_header(self.as_vec_mut(), 133u16, 1 as u16);
17112 self.as_vec_mut().extend(value.to_ne_bytes());
17113 self
17114 }
17115 pub fn push_pmksa_candidate(mut self, value: &[u8]) -> Self {
17116 push_header(self.as_vec_mut(), 134u16, value.len() as u16);
17117 self.as_vec_mut().extend(value);
17118 self
17119 }
17120 pub fn push_tx_no_cck_rate(mut self, value: ()) -> Self {
17121 push_header(self.as_vec_mut(), 135u16, 0 as u16);
17122 self
17123 }
17124 pub fn push_tdls_action(mut self, value: u8) -> Self {
17125 push_header(self.as_vec_mut(), 136u16, 1 as u16);
17126 self.as_vec_mut().extend(value.to_ne_bytes());
17127 self
17128 }
17129 pub fn push_tdls_dialog_token(mut self, value: u8) -> Self {
17130 push_header(self.as_vec_mut(), 137u16, 1 as u16);
17131 self.as_vec_mut().extend(value.to_ne_bytes());
17132 self
17133 }
17134 pub fn push_tdls_operation(mut self, value: u8) -> Self {
17135 push_header(self.as_vec_mut(), 138u16, 1 as u16);
17136 self.as_vec_mut().extend(value.to_ne_bytes());
17137 self
17138 }
17139 pub fn push_tdls_support(mut self, value: ()) -> Self {
17140 push_header(self.as_vec_mut(), 139u16, 0 as u16);
17141 self
17142 }
17143 pub fn push_tdls_external_setup(mut self, value: ()) -> Self {
17144 push_header(self.as_vec_mut(), 140u16, 0 as u16);
17145 self
17146 }
17147 pub fn push_device_ap_sme(mut self, value: u32) -> Self {
17148 push_header(self.as_vec_mut(), 141u16, 4 as u16);
17149 self.as_vec_mut().extend(value.to_ne_bytes());
17150 self
17151 }
17152 pub fn push_dont_wait_for_ack(mut self, value: ()) -> Self {
17153 push_header(self.as_vec_mut(), 142u16, 0 as u16);
17154 self
17155 }
17156 #[doc = "Associated type: [`FeatureFlags`] (1 bit per enumeration)"]
17157 pub fn push_feature_flags(mut self, value: u32) -> Self {
17158 push_header(self.as_vec_mut(), 143u16, 4 as u16);
17159 self.as_vec_mut().extend(value.to_ne_bytes());
17160 self
17161 }
17162 pub fn push_probe_resp_offload(mut self, value: u32) -> Self {
17163 push_header(self.as_vec_mut(), 144u16, 4 as u16);
17164 self.as_vec_mut().extend(value.to_ne_bytes());
17165 self
17166 }
17167 pub fn push_probe_resp(mut self, value: &[u8]) -> Self {
17168 push_header(self.as_vec_mut(), 145u16, value.len() as u16);
17169 self.as_vec_mut().extend(value);
17170 self
17171 }
17172 pub fn push_dfs_region(mut self, value: u8) -> Self {
17173 push_header(self.as_vec_mut(), 146u16, 1 as u16);
17174 self.as_vec_mut().extend(value.to_ne_bytes());
17175 self
17176 }
17177 pub fn push_disable_ht(mut self, value: ()) -> Self {
17178 push_header(self.as_vec_mut(), 147u16, 0 as u16);
17179 self
17180 }
17181 pub fn push_ht_capability_mask(mut self, value: &[u8]) -> Self {
17182 push_header(self.as_vec_mut(), 148u16, value.len() as u16);
17183 self.as_vec_mut().extend(value);
17184 self
17185 }
17186 pub fn push_noack_map(mut self, value: u16) -> Self {
17187 push_header(self.as_vec_mut(), 149u16, 2 as u16);
17188 self.as_vec_mut().extend(value.to_ne_bytes());
17189 self
17190 }
17191 pub fn push_inactivity_timeout(mut self, value: u16) -> Self {
17192 push_header(self.as_vec_mut(), 150u16, 2 as u16);
17193 self.as_vec_mut().extend(value.to_ne_bytes());
17194 self
17195 }
17196 pub fn push_rx_signal_dbm(mut self, value: u32) -> Self {
17197 push_header(self.as_vec_mut(), 151u16, 4 as u16);
17198 self.as_vec_mut().extend(value.to_ne_bytes());
17199 self
17200 }
17201 pub fn push_bg_scan_period(mut self, value: u16) -> Self {
17202 push_header(self.as_vec_mut(), 152u16, 2 as u16);
17203 self.as_vec_mut().extend(value.to_ne_bytes());
17204 self
17205 }
17206 pub fn push_wdev(mut self, value: u64) -> Self {
17207 push_header(self.as_vec_mut(), 153u16, 8 as u16);
17208 self.as_vec_mut().extend(value.to_ne_bytes());
17209 self
17210 }
17211 pub fn push_user_reg_hint_type(mut self, value: u32) -> Self {
17212 push_header(self.as_vec_mut(), 154u16, 4 as u16);
17213 self.as_vec_mut().extend(value.to_ne_bytes());
17214 self
17215 }
17216 pub fn push_conn_failed_reason(mut self, value: u32) -> Self {
17217 push_header(self.as_vec_mut(), 155u16, 4 as u16);
17218 self.as_vec_mut().extend(value.to_ne_bytes());
17219 self
17220 }
17221 pub fn push_auth_data(mut self, value: &[u8]) -> Self {
17222 push_header(self.as_vec_mut(), 156u16, value.len() as u16);
17223 self.as_vec_mut().extend(value);
17224 self
17225 }
17226 pub fn push_vht_capability(mut self, value: &[u8]) -> Self {
17227 push_header(self.as_vec_mut(), 157u16, value.len() as u16);
17228 self.as_vec_mut().extend(value);
17229 self
17230 }
17231 pub fn push_scan_flags(mut self, value: u32) -> Self {
17232 push_header(self.as_vec_mut(), 158u16, 4 as u16);
17233 self.as_vec_mut().extend(value.to_ne_bytes());
17234 self
17235 }
17236 pub fn push_channel_width(mut self, value: u32) -> Self {
17237 push_header(self.as_vec_mut(), 159u16, 4 as u16);
17238 self.as_vec_mut().extend(value.to_ne_bytes());
17239 self
17240 }
17241 pub fn push_center_freq1(mut self, value: u32) -> Self {
17242 push_header(self.as_vec_mut(), 160u16, 4 as u16);
17243 self.as_vec_mut().extend(value.to_ne_bytes());
17244 self
17245 }
17246 pub fn push_center_freq2(mut self, value: u32) -> Self {
17247 push_header(self.as_vec_mut(), 161u16, 4 as u16);
17248 self.as_vec_mut().extend(value.to_ne_bytes());
17249 self
17250 }
17251 pub fn push_p2p_ctwindow(mut self, value: u8) -> Self {
17252 push_header(self.as_vec_mut(), 162u16, 1 as u16);
17253 self.as_vec_mut().extend(value.to_ne_bytes());
17254 self
17255 }
17256 pub fn push_p2p_oppps(mut self, value: u8) -> Self {
17257 push_header(self.as_vec_mut(), 163u16, 1 as u16);
17258 self.as_vec_mut().extend(value.to_ne_bytes());
17259 self
17260 }
17261 pub fn push_local_mesh_power_mode(mut self, value: u32) -> Self {
17262 push_header(self.as_vec_mut(), 164u16, 4 as u16);
17263 self.as_vec_mut().extend(value.to_ne_bytes());
17264 self
17265 }
17266 pub fn push_acl_policy(mut self, value: u32) -> Self {
17267 push_header(self.as_vec_mut(), 165u16, 4 as u16);
17268 self.as_vec_mut().extend(value.to_ne_bytes());
17269 self
17270 }
17271 pub fn push_mac_addrs(mut self, value: &[u8]) -> Self {
17272 push_header(self.as_vec_mut(), 166u16, value.len() as u16);
17273 self.as_vec_mut().extend(value);
17274 self
17275 }
17276 pub fn push_mac_acl_max(mut self, value: u32) -> Self {
17277 push_header(self.as_vec_mut(), 167u16, 4 as u16);
17278 self.as_vec_mut().extend(value.to_ne_bytes());
17279 self
17280 }
17281 pub fn push_radar_event(mut self, value: u32) -> Self {
17282 push_header(self.as_vec_mut(), 168u16, 4 as u16);
17283 self.as_vec_mut().extend(value.to_ne_bytes());
17284 self
17285 }
17286 pub fn push_ext_capa(mut self, value: &[u8]) -> Self {
17287 push_header(self.as_vec_mut(), 169u16, value.len() as u16);
17288 self.as_vec_mut().extend(value);
17289 self
17290 }
17291 pub fn push_ext_capa_mask(mut self, value: &[u8]) -> Self {
17292 push_header(self.as_vec_mut(), 170u16, value.len() as u16);
17293 self.as_vec_mut().extend(value);
17294 self
17295 }
17296 pub fn push_sta_capability(mut self, value: u16) -> Self {
17297 push_header(self.as_vec_mut(), 171u16, 2 as u16);
17298 self.as_vec_mut().extend(value.to_ne_bytes());
17299 self
17300 }
17301 pub fn push_sta_ext_capability(mut self, value: &[u8]) -> Self {
17302 push_header(self.as_vec_mut(), 172u16, value.len() as u16);
17303 self.as_vec_mut().extend(value);
17304 self
17305 }
17306 #[doc = "Associated type: [`ProtocolFeatures`] (enum)"]
17307 pub fn push_protocol_features(mut self, value: u32) -> Self {
17308 push_header(self.as_vec_mut(), 173u16, 4 as u16);
17309 self.as_vec_mut().extend(value.to_ne_bytes());
17310 self
17311 }
17312 pub fn push_split_wiphy_dump(mut self, value: ()) -> Self {
17313 push_header(self.as_vec_mut(), 174u16, 0 as u16);
17314 self
17315 }
17316 pub fn push_disable_vht(mut self, value: ()) -> Self {
17317 push_header(self.as_vec_mut(), 175u16, 0 as u16);
17318 self
17319 }
17320 pub fn push_vht_capability_mask(mut self, value: &[u8]) -> Self {
17321 push_header(self.as_vec_mut(), 176u16, value.len() as u16);
17322 self.as_vec_mut().extend(value);
17323 self
17324 }
17325 pub fn push_mdid(mut self, value: u16) -> Self {
17326 push_header(self.as_vec_mut(), 177u16, 2 as u16);
17327 self.as_vec_mut().extend(value.to_ne_bytes());
17328 self
17329 }
17330 pub fn push_ie_ric(mut self, value: &[u8]) -> Self {
17331 push_header(self.as_vec_mut(), 178u16, value.len() as u16);
17332 self.as_vec_mut().extend(value);
17333 self
17334 }
17335 pub fn push_crit_prot_id(mut self, value: u16) -> Self {
17336 push_header(self.as_vec_mut(), 179u16, 2 as u16);
17337 self.as_vec_mut().extend(value.to_ne_bytes());
17338 self
17339 }
17340 pub fn push_max_crit_prot_duration(mut self, value: u16) -> Self {
17341 push_header(self.as_vec_mut(), 180u16, 2 as u16);
17342 self.as_vec_mut().extend(value.to_ne_bytes());
17343 self
17344 }
17345 pub fn push_peer_aid(mut self, value: u16) -> Self {
17346 push_header(self.as_vec_mut(), 181u16, 2 as u16);
17347 self.as_vec_mut().extend(value.to_ne_bytes());
17348 self
17349 }
17350 pub fn push_coalesce_rule(mut self, value: &[u8]) -> Self {
17351 push_header(self.as_vec_mut(), 182u16, value.len() as u16);
17352 self.as_vec_mut().extend(value);
17353 self
17354 }
17355 pub fn push_ch_switch_count(mut self, value: u32) -> Self {
17356 push_header(self.as_vec_mut(), 183u16, 4 as u16);
17357 self.as_vec_mut().extend(value.to_ne_bytes());
17358 self
17359 }
17360 pub fn push_ch_switch_block_tx(mut self, value: ()) -> Self {
17361 push_header(self.as_vec_mut(), 184u16, 0 as u16);
17362 self
17363 }
17364 pub fn push_csa_ies(mut self, value: &[u8]) -> Self {
17365 push_header(self.as_vec_mut(), 185u16, value.len() as u16);
17366 self.as_vec_mut().extend(value);
17367 self
17368 }
17369 pub fn push_cntdwn_offs_beacon(mut self, value: &[u8]) -> Self {
17370 push_header(self.as_vec_mut(), 186u16, value.len() as u16);
17371 self.as_vec_mut().extend(value);
17372 self
17373 }
17374 pub fn push_cntdwn_offs_presp(mut self, value: &[u8]) -> Self {
17375 push_header(self.as_vec_mut(), 187u16, value.len() as u16);
17376 self.as_vec_mut().extend(value);
17377 self
17378 }
17379 pub fn push_rxmgmt_flags(mut self, value: &[u8]) -> Self {
17380 push_header(self.as_vec_mut(), 188u16, value.len() as u16);
17381 self.as_vec_mut().extend(value);
17382 self
17383 }
17384 pub fn push_sta_supported_channels(mut self, value: &[u8]) -> Self {
17385 push_header(self.as_vec_mut(), 189u16, value.len() as u16);
17386 self.as_vec_mut().extend(value);
17387 self
17388 }
17389 pub fn push_sta_supported_oper_classes(mut self, value: &[u8]) -> Self {
17390 push_header(self.as_vec_mut(), 190u16, value.len() as u16);
17391 self.as_vec_mut().extend(value);
17392 self
17393 }
17394 pub fn push_handle_dfs(mut self, value: ()) -> Self {
17395 push_header(self.as_vec_mut(), 191u16, 0 as u16);
17396 self
17397 }
17398 pub fn push_support_5_mhz(mut self, value: ()) -> Self {
17399 push_header(self.as_vec_mut(), 192u16, 0 as u16);
17400 self
17401 }
17402 pub fn push_support_10_mhz(mut self, value: ()) -> Self {
17403 push_header(self.as_vec_mut(), 193u16, 0 as u16);
17404 self
17405 }
17406 pub fn push_opmode_notif(mut self, value: u8) -> Self {
17407 push_header(self.as_vec_mut(), 194u16, 1 as u16);
17408 self.as_vec_mut().extend(value.to_ne_bytes());
17409 self
17410 }
17411 pub fn push_vendor_id(mut self, value: u32) -> Self {
17412 push_header(self.as_vec_mut(), 195u16, 4 as u16);
17413 self.as_vec_mut().extend(value.to_ne_bytes());
17414 self
17415 }
17416 pub fn push_vendor_subcmd(mut self, value: u32) -> Self {
17417 push_header(self.as_vec_mut(), 196u16, 4 as u16);
17418 self.as_vec_mut().extend(value.to_ne_bytes());
17419 self
17420 }
17421 pub fn push_vendor_data(mut self, value: &[u8]) -> Self {
17422 push_header(self.as_vec_mut(), 197u16, value.len() as u16);
17423 self.as_vec_mut().extend(value);
17424 self
17425 }
17426 pub fn push_vendor_events(mut self, value: &[u8]) -> Self {
17427 push_header(self.as_vec_mut(), 198u16, value.len() as u16);
17428 self.as_vec_mut().extend(value);
17429 self
17430 }
17431 pub fn push_qos_map(mut self, value: &[u8]) -> Self {
17432 push_header(self.as_vec_mut(), 199u16, value.len() as u16);
17433 self.as_vec_mut().extend(value);
17434 self
17435 }
17436 pub fn push_mac_hint(mut self, value: &[u8]) -> Self {
17437 push_header(self.as_vec_mut(), 200u16, value.len() as u16);
17438 self.as_vec_mut().extend(value);
17439 self
17440 }
17441 pub fn push_wiphy_freq_hint(mut self, value: u32) -> Self {
17442 push_header(self.as_vec_mut(), 201u16, 4 as u16);
17443 self.as_vec_mut().extend(value.to_ne_bytes());
17444 self
17445 }
17446 pub fn push_max_ap_assoc_sta(mut self, value: u32) -> Self {
17447 push_header(self.as_vec_mut(), 202u16, 4 as u16);
17448 self.as_vec_mut().extend(value.to_ne_bytes());
17449 self
17450 }
17451 pub fn push_tdls_peer_capability(mut self, value: u32) -> Self {
17452 push_header(self.as_vec_mut(), 203u16, 4 as u16);
17453 self.as_vec_mut().extend(value.to_ne_bytes());
17454 self
17455 }
17456 pub fn push_socket_owner(mut self, value: ()) -> Self {
17457 push_header(self.as_vec_mut(), 204u16, 0 as u16);
17458 self
17459 }
17460 pub fn push_csa_c_offsets_tx(mut self, value: &[u8]) -> Self {
17461 push_header(self.as_vec_mut(), 205u16, value.len() as u16);
17462 self.as_vec_mut().extend(value);
17463 self
17464 }
17465 pub fn push_max_csa_counters(mut self, value: u8) -> Self {
17466 push_header(self.as_vec_mut(), 206u16, 1 as u16);
17467 self.as_vec_mut().extend(value.to_ne_bytes());
17468 self
17469 }
17470 pub fn push_tdls_initiator(mut self, value: ()) -> Self {
17471 push_header(self.as_vec_mut(), 207u16, 0 as u16);
17472 self
17473 }
17474 pub fn push_use_rrm(mut self, value: ()) -> Self {
17475 push_header(self.as_vec_mut(), 208u16, 0 as u16);
17476 self
17477 }
17478 pub fn push_wiphy_dyn_ack(mut self, value: ()) -> Self {
17479 push_header(self.as_vec_mut(), 209u16, 0 as u16);
17480 self
17481 }
17482 pub fn push_tsid(mut self, value: u8) -> Self {
17483 push_header(self.as_vec_mut(), 210u16, 1 as u16);
17484 self.as_vec_mut().extend(value.to_ne_bytes());
17485 self
17486 }
17487 pub fn push_user_prio(mut self, value: u8) -> Self {
17488 push_header(self.as_vec_mut(), 211u16, 1 as u16);
17489 self.as_vec_mut().extend(value.to_ne_bytes());
17490 self
17491 }
17492 pub fn push_admitted_time(mut self, value: u16) -> Self {
17493 push_header(self.as_vec_mut(), 212u16, 2 as u16);
17494 self.as_vec_mut().extend(value.to_ne_bytes());
17495 self
17496 }
17497 pub fn push_smps_mode(mut self, value: u8) -> Self {
17498 push_header(self.as_vec_mut(), 213u16, 1 as u16);
17499 self.as_vec_mut().extend(value.to_ne_bytes());
17500 self
17501 }
17502 pub fn push_oper_class(mut self, value: u8) -> Self {
17503 push_header(self.as_vec_mut(), 214u16, 1 as u16);
17504 self.as_vec_mut().extend(value.to_ne_bytes());
17505 self
17506 }
17507 pub fn push_mac_mask(mut self, value: &[u8]) -> Self {
17508 push_header(self.as_vec_mut(), 215u16, value.len() as u16);
17509 self.as_vec_mut().extend(value);
17510 self
17511 }
17512 pub fn push_wiphy_self_managed_reg(mut self, value: ()) -> Self {
17513 push_header(self.as_vec_mut(), 216u16, 0 as u16);
17514 self
17515 }
17516 pub fn push_ext_features(mut self, value: &[u8]) -> Self {
17517 push_header(self.as_vec_mut(), 217u16, value.len() as u16);
17518 self.as_vec_mut().extend(value);
17519 self
17520 }
17521 pub fn push_survey_radio_stats(mut self, value: &[u8]) -> Self {
17522 push_header(self.as_vec_mut(), 218u16, value.len() as u16);
17523 self.as_vec_mut().extend(value);
17524 self
17525 }
17526 pub fn push_netns_fd(mut self, value: u32) -> Self {
17527 push_header(self.as_vec_mut(), 219u16, 4 as u16);
17528 self.as_vec_mut().extend(value.to_ne_bytes());
17529 self
17530 }
17531 pub fn push_sched_scan_delay(mut self, value: u32) -> Self {
17532 push_header(self.as_vec_mut(), 220u16, 4 as u16);
17533 self.as_vec_mut().extend(value.to_ne_bytes());
17534 self
17535 }
17536 pub fn push_reg_indoor(mut self, value: ()) -> Self {
17537 push_header(self.as_vec_mut(), 221u16, 0 as u16);
17538 self
17539 }
17540 pub fn push_max_num_sched_scan_plans(mut self, value: u32) -> Self {
17541 push_header(self.as_vec_mut(), 222u16, 4 as u16);
17542 self.as_vec_mut().extend(value.to_ne_bytes());
17543 self
17544 }
17545 pub fn push_max_scan_plan_interval(mut self, value: u32) -> Self {
17546 push_header(self.as_vec_mut(), 223u16, 4 as u16);
17547 self.as_vec_mut().extend(value.to_ne_bytes());
17548 self
17549 }
17550 pub fn push_max_scan_plan_iterations(mut self, value: u32) -> Self {
17551 push_header(self.as_vec_mut(), 224u16, 4 as u16);
17552 self.as_vec_mut().extend(value.to_ne_bytes());
17553 self
17554 }
17555 pub fn push_sched_scan_plans(mut self, value: &[u8]) -> Self {
17556 push_header(self.as_vec_mut(), 225u16, value.len() as u16);
17557 self.as_vec_mut().extend(value);
17558 self
17559 }
17560 pub fn push_pbss(mut self, value: ()) -> Self {
17561 push_header(self.as_vec_mut(), 226u16, 0 as u16);
17562 self
17563 }
17564 pub fn push_bss_select(mut self, value: &[u8]) -> Self {
17565 push_header(self.as_vec_mut(), 227u16, value.len() as u16);
17566 self.as_vec_mut().extend(value);
17567 self
17568 }
17569 pub fn push_sta_support_p2p_ps(mut self, value: u8) -> Self {
17570 push_header(self.as_vec_mut(), 228u16, 1 as u16);
17571 self.as_vec_mut().extend(value.to_ne_bytes());
17572 self
17573 }
17574 pub fn push_pad(mut self, value: &[u8]) -> Self {
17575 push_header(self.as_vec_mut(), 229u16, value.len() as u16);
17576 self.as_vec_mut().extend(value);
17577 self
17578 }
17579 pub fn push_iftype_ext_capa(mut self, value: &[u8]) -> Self {
17580 push_header(self.as_vec_mut(), 230u16, value.len() as u16);
17581 self.as_vec_mut().extend(value);
17582 self
17583 }
17584 pub fn push_mu_mimo_group_data(mut self, value: &[u8]) -> Self {
17585 push_header(self.as_vec_mut(), 231u16, value.len() as u16);
17586 self.as_vec_mut().extend(value);
17587 self
17588 }
17589 pub fn push_mu_mimo_follow_mac_addr(mut self, value: &[u8]) -> Self {
17590 push_header(self.as_vec_mut(), 232u16, value.len() as u16);
17591 self.as_vec_mut().extend(value);
17592 self
17593 }
17594 pub fn push_scan_start_time_tsf(mut self, value: u64) -> Self {
17595 push_header(self.as_vec_mut(), 233u16, 8 as u16);
17596 self.as_vec_mut().extend(value.to_ne_bytes());
17597 self
17598 }
17599 pub fn push_scan_start_time_tsf_bssid(mut self, value: &[u8]) -> Self {
17600 push_header(self.as_vec_mut(), 234u16, value.len() as u16);
17601 self.as_vec_mut().extend(value);
17602 self
17603 }
17604 pub fn push_measurement_duration(mut self, value: u16) -> Self {
17605 push_header(self.as_vec_mut(), 235u16, 2 as u16);
17606 self.as_vec_mut().extend(value.to_ne_bytes());
17607 self
17608 }
17609 pub fn push_measurement_duration_mandatory(mut self, value: ()) -> Self {
17610 push_header(self.as_vec_mut(), 236u16, 0 as u16);
17611 self
17612 }
17613 pub fn push_mesh_peer_aid(mut self, value: u16) -> Self {
17614 push_header(self.as_vec_mut(), 237u16, 2 as u16);
17615 self.as_vec_mut().extend(value.to_ne_bytes());
17616 self
17617 }
17618 pub fn push_nan_master_pref(mut self, value: u8) -> Self {
17619 push_header(self.as_vec_mut(), 238u16, 1 as u16);
17620 self.as_vec_mut().extend(value.to_ne_bytes());
17621 self
17622 }
17623 pub fn push_bands(mut self, value: u32) -> Self {
17624 push_header(self.as_vec_mut(), 239u16, 4 as u16);
17625 self.as_vec_mut().extend(value.to_ne_bytes());
17626 self
17627 }
17628 pub fn push_nan_func(mut self, value: &[u8]) -> Self {
17629 push_header(self.as_vec_mut(), 240u16, value.len() as u16);
17630 self.as_vec_mut().extend(value);
17631 self
17632 }
17633 pub fn push_nan_match(mut self, value: &[u8]) -> Self {
17634 push_header(self.as_vec_mut(), 241u16, value.len() as u16);
17635 self.as_vec_mut().extend(value);
17636 self
17637 }
17638 pub fn push_fils_kek(mut self, value: &[u8]) -> Self {
17639 push_header(self.as_vec_mut(), 242u16, value.len() as u16);
17640 self.as_vec_mut().extend(value);
17641 self
17642 }
17643 pub fn push_fils_nonces(mut self, value: &[u8]) -> Self {
17644 push_header(self.as_vec_mut(), 243u16, value.len() as u16);
17645 self.as_vec_mut().extend(value);
17646 self
17647 }
17648 pub fn push_multicast_to_unicast_enabled(mut self, value: ()) -> Self {
17649 push_header(self.as_vec_mut(), 244u16, 0 as u16);
17650 self
17651 }
17652 pub fn push_bssid(mut self, value: &[u8]) -> Self {
17653 push_header(self.as_vec_mut(), 245u16, value.len() as u16);
17654 self.as_vec_mut().extend(value);
17655 self
17656 }
17657 pub fn push_sched_scan_relative_rssi(mut self, value: i8) -> Self {
17658 push_header(self.as_vec_mut(), 246u16, 1 as u16);
17659 self.as_vec_mut().extend(value.to_ne_bytes());
17660 self
17661 }
17662 pub fn push_sched_scan_rssi_adjust(mut self, value: &[u8]) -> Self {
17663 push_header(self.as_vec_mut(), 247u16, value.len() as u16);
17664 self.as_vec_mut().extend(value);
17665 self
17666 }
17667 pub fn push_timeout_reason(mut self, value: u32) -> Self {
17668 push_header(self.as_vec_mut(), 248u16, 4 as u16);
17669 self.as_vec_mut().extend(value.to_ne_bytes());
17670 self
17671 }
17672 pub fn push_fils_erp_username(mut self, value: &[u8]) -> Self {
17673 push_header(self.as_vec_mut(), 249u16, value.len() as u16);
17674 self.as_vec_mut().extend(value);
17675 self
17676 }
17677 pub fn push_fils_erp_realm(mut self, value: &[u8]) -> Self {
17678 push_header(self.as_vec_mut(), 250u16, value.len() as u16);
17679 self.as_vec_mut().extend(value);
17680 self
17681 }
17682 pub fn push_fils_erp_next_seq_num(mut self, value: u16) -> Self {
17683 push_header(self.as_vec_mut(), 251u16, 2 as u16);
17684 self.as_vec_mut().extend(value.to_ne_bytes());
17685 self
17686 }
17687 pub fn push_fils_erp_rrk(mut self, value: &[u8]) -> Self {
17688 push_header(self.as_vec_mut(), 252u16, value.len() as u16);
17689 self.as_vec_mut().extend(value);
17690 self
17691 }
17692 pub fn push_fils_cache_id(mut self, value: &[u8]) -> Self {
17693 push_header(self.as_vec_mut(), 253u16, value.len() as u16);
17694 self.as_vec_mut().extend(value);
17695 self
17696 }
17697 pub fn push_pmk(mut self, value: &[u8]) -> Self {
17698 push_header(self.as_vec_mut(), 254u16, value.len() as u16);
17699 self.as_vec_mut().extend(value);
17700 self
17701 }
17702 pub fn push_sched_scan_multi(mut self, value: ()) -> Self {
17703 push_header(self.as_vec_mut(), 255u16, 0 as u16);
17704 self
17705 }
17706 pub fn push_sched_scan_max_reqs(mut self, value: u32) -> Self {
17707 push_header(self.as_vec_mut(), 256u16, 4 as u16);
17708 self.as_vec_mut().extend(value.to_ne_bytes());
17709 self
17710 }
17711 pub fn push_want_1x_4way_hs(mut self, value: ()) -> Self {
17712 push_header(self.as_vec_mut(), 257u16, 0 as u16);
17713 self
17714 }
17715 pub fn push_pmkr0_name(mut self, value: &[u8]) -> Self {
17716 push_header(self.as_vec_mut(), 258u16, value.len() as u16);
17717 self.as_vec_mut().extend(value);
17718 self
17719 }
17720 pub fn push_port_authorized(mut self, value: &[u8]) -> Self {
17721 push_header(self.as_vec_mut(), 259u16, value.len() as u16);
17722 self.as_vec_mut().extend(value);
17723 self
17724 }
17725 pub fn push_external_auth_action(mut self, value: u32) -> Self {
17726 push_header(self.as_vec_mut(), 260u16, 4 as u16);
17727 self.as_vec_mut().extend(value.to_ne_bytes());
17728 self
17729 }
17730 pub fn push_external_auth_support(mut self, value: ()) -> Self {
17731 push_header(self.as_vec_mut(), 261u16, 0 as u16);
17732 self
17733 }
17734 pub fn push_nss(mut self, value: u8) -> Self {
17735 push_header(self.as_vec_mut(), 262u16, 1 as u16);
17736 self.as_vec_mut().extend(value.to_ne_bytes());
17737 self
17738 }
17739 pub fn push_ack_signal(mut self, value: i32) -> Self {
17740 push_header(self.as_vec_mut(), 263u16, 4 as u16);
17741 self.as_vec_mut().extend(value.to_ne_bytes());
17742 self
17743 }
17744 pub fn push_control_port_over_nl80211(mut self, value: ()) -> Self {
17745 push_header(self.as_vec_mut(), 264u16, 0 as u16);
17746 self
17747 }
17748 pub fn nested_txq_stats(mut self) -> PushTxqStatsAttrs<Self> {
17749 let header_offset = push_nested_header(self.as_vec_mut(), 265u16);
17750 PushTxqStatsAttrs {
17751 prev: Some(self),
17752 header_offset: Some(header_offset),
17753 }
17754 }
17755 pub fn push_txq_limit(mut self, value: u32) -> Self {
17756 push_header(self.as_vec_mut(), 266u16, 4 as u16);
17757 self.as_vec_mut().extend(value.to_ne_bytes());
17758 self
17759 }
17760 pub fn push_txq_memory_limit(mut self, value: u32) -> Self {
17761 push_header(self.as_vec_mut(), 267u16, 4 as u16);
17762 self.as_vec_mut().extend(value.to_ne_bytes());
17763 self
17764 }
17765 pub fn push_txq_quantum(mut self, value: u32) -> Self {
17766 push_header(self.as_vec_mut(), 268u16, 4 as u16);
17767 self.as_vec_mut().extend(value.to_ne_bytes());
17768 self
17769 }
17770 pub fn push_he_capability(mut self, value: &[u8]) -> Self {
17771 push_header(self.as_vec_mut(), 269u16, value.len() as u16);
17772 self.as_vec_mut().extend(value);
17773 self
17774 }
17775 pub fn push_ftm_responder(mut self, value: &[u8]) -> Self {
17776 push_header(self.as_vec_mut(), 270u16, value.len() as u16);
17777 self.as_vec_mut().extend(value);
17778 self
17779 }
17780 pub fn push_ftm_responder_stats(mut self, value: &[u8]) -> Self {
17781 push_header(self.as_vec_mut(), 271u16, value.len() as u16);
17782 self.as_vec_mut().extend(value);
17783 self
17784 }
17785 pub fn push_timeout(mut self, value: u32) -> Self {
17786 push_header(self.as_vec_mut(), 272u16, 4 as u16);
17787 self.as_vec_mut().extend(value.to_ne_bytes());
17788 self
17789 }
17790 pub fn push_peer_measurements(mut self, value: &[u8]) -> Self {
17791 push_header(self.as_vec_mut(), 273u16, value.len() as u16);
17792 self.as_vec_mut().extend(value);
17793 self
17794 }
17795 pub fn push_airtime_weight(mut self, value: u16) -> Self {
17796 push_header(self.as_vec_mut(), 274u16, 2 as u16);
17797 self.as_vec_mut().extend(value.to_ne_bytes());
17798 self
17799 }
17800 pub fn push_sta_tx_power_setting(mut self, value: u8) -> Self {
17801 push_header(self.as_vec_mut(), 275u16, 1 as u16);
17802 self.as_vec_mut().extend(value.to_ne_bytes());
17803 self
17804 }
17805 pub fn push_sta_tx_power(mut self, value: i16) -> Self {
17806 push_header(self.as_vec_mut(), 276u16, 2 as u16);
17807 self.as_vec_mut().extend(value.to_ne_bytes());
17808 self
17809 }
17810 pub fn push_sae_password(mut self, value: &[u8]) -> Self {
17811 push_header(self.as_vec_mut(), 277u16, value.len() as u16);
17812 self.as_vec_mut().extend(value);
17813 self
17814 }
17815 pub fn push_twt_responder(mut self, value: ()) -> Self {
17816 push_header(self.as_vec_mut(), 278u16, 0 as u16);
17817 self
17818 }
17819 pub fn push_he_obss_pd(mut self, value: &[u8]) -> Self {
17820 push_header(self.as_vec_mut(), 279u16, value.len() as u16);
17821 self.as_vec_mut().extend(value);
17822 self
17823 }
17824 pub fn push_wiphy_edmg_channels(mut self, value: u8) -> Self {
17825 push_header(self.as_vec_mut(), 280u16, 1 as u16);
17826 self.as_vec_mut().extend(value.to_ne_bytes());
17827 self
17828 }
17829 pub fn push_wiphy_edmg_bw_config(mut self, value: u8) -> Self {
17830 push_header(self.as_vec_mut(), 281u16, 1 as u16);
17831 self.as_vec_mut().extend(value.to_ne_bytes());
17832 self
17833 }
17834 pub fn push_vlan_id(mut self, value: u16) -> Self {
17835 push_header(self.as_vec_mut(), 282u16, 2 as u16);
17836 self.as_vec_mut().extend(value.to_ne_bytes());
17837 self
17838 }
17839 pub fn push_he_bss_color(mut self, value: &[u8]) -> Self {
17840 push_header(self.as_vec_mut(), 283u16, value.len() as u16);
17841 self.as_vec_mut().extend(value);
17842 self
17843 }
17844 pub fn push_iftype_akm_suites(mut self, value: &[u8]) -> Self {
17845 push_header(self.as_vec_mut(), 284u16, value.len() as u16);
17846 self.as_vec_mut().extend(value);
17847 self
17848 }
17849 pub fn push_tid_config(mut self, value: &[u8]) -> Self {
17850 push_header(self.as_vec_mut(), 285u16, value.len() as u16);
17851 self.as_vec_mut().extend(value);
17852 self
17853 }
17854 pub fn push_control_port_no_preauth(mut self, value: ()) -> Self {
17855 push_header(self.as_vec_mut(), 286u16, 0 as u16);
17856 self
17857 }
17858 pub fn push_pmk_lifetime(mut self, value: u32) -> Self {
17859 push_header(self.as_vec_mut(), 287u16, 4 as u16);
17860 self.as_vec_mut().extend(value.to_ne_bytes());
17861 self
17862 }
17863 pub fn push_pmk_reauth_threshold(mut self, value: u8) -> Self {
17864 push_header(self.as_vec_mut(), 288u16, 1 as u16);
17865 self.as_vec_mut().extend(value.to_ne_bytes());
17866 self
17867 }
17868 pub fn push_receive_multicast(mut self, value: ()) -> Self {
17869 push_header(self.as_vec_mut(), 289u16, 0 as u16);
17870 self
17871 }
17872 pub fn push_wiphy_freq_offset(mut self, value: u32) -> Self {
17873 push_header(self.as_vec_mut(), 290u16, 4 as u16);
17874 self.as_vec_mut().extend(value.to_ne_bytes());
17875 self
17876 }
17877 pub fn push_center_freq1_offset(mut self, value: u32) -> Self {
17878 push_header(self.as_vec_mut(), 291u16, 4 as u16);
17879 self.as_vec_mut().extend(value.to_ne_bytes());
17880 self
17881 }
17882 pub fn push_scan_freq_khz(mut self, value: &[u8]) -> Self {
17883 push_header(self.as_vec_mut(), 292u16, value.len() as u16);
17884 self.as_vec_mut().extend(value);
17885 self
17886 }
17887 pub fn push_he_6ghz_capability(mut self, value: &[u8]) -> Self {
17888 push_header(self.as_vec_mut(), 293u16, value.len() as u16);
17889 self.as_vec_mut().extend(value);
17890 self
17891 }
17892 pub fn push_fils_discovery(mut self, value: &[u8]) -> Self {
17893 push_header(self.as_vec_mut(), 294u16, value.len() as u16);
17894 self.as_vec_mut().extend(value);
17895 self
17896 }
17897 pub fn push_unsol_bcast_probe_resp(mut self, value: &[u8]) -> Self {
17898 push_header(self.as_vec_mut(), 295u16, value.len() as u16);
17899 self.as_vec_mut().extend(value);
17900 self
17901 }
17902 pub fn push_s1g_capability(mut self, value: &[u8]) -> Self {
17903 push_header(self.as_vec_mut(), 296u16, value.len() as u16);
17904 self.as_vec_mut().extend(value);
17905 self
17906 }
17907 pub fn push_s1g_capability_mask(mut self, value: &[u8]) -> Self {
17908 push_header(self.as_vec_mut(), 297u16, value.len() as u16);
17909 self.as_vec_mut().extend(value);
17910 self
17911 }
17912 pub fn push_sae_pwe(mut self, value: u8) -> Self {
17913 push_header(self.as_vec_mut(), 298u16, 1 as u16);
17914 self.as_vec_mut().extend(value.to_ne_bytes());
17915 self
17916 }
17917 pub fn push_reconnect_requested(mut self, value: &[u8]) -> Self {
17918 push_header(self.as_vec_mut(), 299u16, value.len() as u16);
17919 self.as_vec_mut().extend(value);
17920 self
17921 }
17922 pub fn nested_sar_spec(mut self) -> PushSarAttributes<Self> {
17923 let header_offset = push_nested_header(self.as_vec_mut(), 300u16);
17924 PushSarAttributes {
17925 prev: Some(self),
17926 header_offset: Some(header_offset),
17927 }
17928 }
17929 pub fn push_disable_he(mut self, value: ()) -> Self {
17930 push_header(self.as_vec_mut(), 301u16, 0 as u16);
17931 self
17932 }
17933 pub fn push_obss_color_bitmap(mut self, value: u64) -> Self {
17934 push_header(self.as_vec_mut(), 302u16, 8 as u16);
17935 self.as_vec_mut().extend(value.to_ne_bytes());
17936 self
17937 }
17938 pub fn push_color_change_count(mut self, value: u8) -> Self {
17939 push_header(self.as_vec_mut(), 303u16, 1 as u16);
17940 self.as_vec_mut().extend(value.to_ne_bytes());
17941 self
17942 }
17943 pub fn push_color_change_color(mut self, value: u8) -> Self {
17944 push_header(self.as_vec_mut(), 304u16, 1 as u16);
17945 self.as_vec_mut().extend(value.to_ne_bytes());
17946 self
17947 }
17948 pub fn push_color_change_elems(mut self, value: &[u8]) -> Self {
17949 push_header(self.as_vec_mut(), 305u16, value.len() as u16);
17950 self.as_vec_mut().extend(value);
17951 self
17952 }
17953 pub fn push_mbssid_config(mut self, value: &[u8]) -> Self {
17954 push_header(self.as_vec_mut(), 306u16, value.len() as u16);
17955 self.as_vec_mut().extend(value);
17956 self
17957 }
17958 pub fn push_mbssid_elems(mut self, value: &[u8]) -> Self {
17959 push_header(self.as_vec_mut(), 307u16, value.len() as u16);
17960 self.as_vec_mut().extend(value);
17961 self
17962 }
17963 pub fn push_radar_background(mut self, value: ()) -> Self {
17964 push_header(self.as_vec_mut(), 308u16, 0 as u16);
17965 self
17966 }
17967 pub fn push_ap_settings_flags(mut self, value: u32) -> Self {
17968 push_header(self.as_vec_mut(), 309u16, 4 as u16);
17969 self.as_vec_mut().extend(value.to_ne_bytes());
17970 self
17971 }
17972 pub fn push_eht_capability(mut self, value: &[u8]) -> Self {
17973 push_header(self.as_vec_mut(), 310u16, value.len() as u16);
17974 self.as_vec_mut().extend(value);
17975 self
17976 }
17977 pub fn push_disable_eht(mut self, value: ()) -> Self {
17978 push_header(self.as_vec_mut(), 311u16, 0 as u16);
17979 self
17980 }
17981 pub fn push_mlo_links(mut self, value: &[u8]) -> Self {
17982 push_header(self.as_vec_mut(), 312u16, value.len() as u16);
17983 self.as_vec_mut().extend(value);
17984 self
17985 }
17986 pub fn push_mlo_link_id(mut self, value: u8) -> Self {
17987 push_header(self.as_vec_mut(), 313u16, 1 as u16);
17988 self.as_vec_mut().extend(value.to_ne_bytes());
17989 self
17990 }
17991 pub fn push_mld_addr(mut self, value: &[u8]) -> Self {
17992 push_header(self.as_vec_mut(), 314u16, value.len() as u16);
17993 self.as_vec_mut().extend(value);
17994 self
17995 }
17996 pub fn push_mlo_support(mut self, value: ()) -> Self {
17997 push_header(self.as_vec_mut(), 315u16, 0 as u16);
17998 self
17999 }
18000 pub fn push_max_num_akm_suites(mut self, value: &[u8]) -> Self {
18001 push_header(self.as_vec_mut(), 316u16, value.len() as u16);
18002 self.as_vec_mut().extend(value);
18003 self
18004 }
18005 pub fn push_eml_capability(mut self, value: u16) -> Self {
18006 push_header(self.as_vec_mut(), 317u16, 2 as u16);
18007 self.as_vec_mut().extend(value.to_ne_bytes());
18008 self
18009 }
18010 pub fn push_mld_capa_and_ops(mut self, value: u16) -> Self {
18011 push_header(self.as_vec_mut(), 318u16, 2 as u16);
18012 self.as_vec_mut().extend(value.to_ne_bytes());
18013 self
18014 }
18015 pub fn push_tx_hw_timestamp(mut self, value: u64) -> Self {
18016 push_header(self.as_vec_mut(), 319u16, 8 as u16);
18017 self.as_vec_mut().extend(value.to_ne_bytes());
18018 self
18019 }
18020 pub fn push_rx_hw_timestamp(mut self, value: u64) -> Self {
18021 push_header(self.as_vec_mut(), 320u16, 8 as u16);
18022 self.as_vec_mut().extend(value.to_ne_bytes());
18023 self
18024 }
18025 pub fn push_td_bitmap(mut self, value: &[u8]) -> Self {
18026 push_header(self.as_vec_mut(), 321u16, value.len() as u16);
18027 self.as_vec_mut().extend(value);
18028 self
18029 }
18030 pub fn push_punct_bitmap(mut self, value: u32) -> Self {
18031 push_header(self.as_vec_mut(), 322u16, 4 as u16);
18032 self.as_vec_mut().extend(value.to_ne_bytes());
18033 self
18034 }
18035 pub fn push_max_hw_timestamp_peers(mut self, value: u16) -> Self {
18036 push_header(self.as_vec_mut(), 323u16, 2 as u16);
18037 self.as_vec_mut().extend(value.to_ne_bytes());
18038 self
18039 }
18040 pub fn push_hw_timestamp_enabled(mut self, value: ()) -> Self {
18041 push_header(self.as_vec_mut(), 324u16, 0 as u16);
18042 self
18043 }
18044 pub fn push_ema_rnr_elems(mut self, value: &[u8]) -> Self {
18045 push_header(self.as_vec_mut(), 325u16, value.len() as u16);
18046 self.as_vec_mut().extend(value);
18047 self
18048 }
18049 pub fn push_mlo_link_disabled(mut self, value: ()) -> Self {
18050 push_header(self.as_vec_mut(), 326u16, 0 as u16);
18051 self
18052 }
18053 pub fn push_bss_dump_include_use_data(mut self, value: ()) -> Self {
18054 push_header(self.as_vec_mut(), 327u16, 0 as u16);
18055 self
18056 }
18057 pub fn push_mlo_ttlm_dlink(mut self, value: u16) -> Self {
18058 push_header(self.as_vec_mut(), 328u16, 2 as u16);
18059 self.as_vec_mut().extend(value.to_ne_bytes());
18060 self
18061 }
18062 pub fn push_mlo_ttlm_ulink(mut self, value: u16) -> Self {
18063 push_header(self.as_vec_mut(), 329u16, 2 as u16);
18064 self.as_vec_mut().extend(value.to_ne_bytes());
18065 self
18066 }
18067 pub fn push_assoc_spp_amsdu(mut self, value: ()) -> Self {
18068 push_header(self.as_vec_mut(), 330u16, 0 as u16);
18069 self
18070 }
18071 pub fn push_wiphy_radios(mut self, value: &[u8]) -> Self {
18072 push_header(self.as_vec_mut(), 331u16, value.len() as u16);
18073 self.as_vec_mut().extend(value);
18074 self
18075 }
18076 pub fn push_wiphy_interface_combinations(mut self, value: &[u8]) -> Self {
18077 push_header(self.as_vec_mut(), 332u16, value.len() as u16);
18078 self.as_vec_mut().extend(value);
18079 self
18080 }
18081 pub fn push_vif_radio_mask(mut self, value: u32) -> Self {
18082 push_header(self.as_vec_mut(), 333u16, 4 as u16);
18083 self.as_vec_mut().extend(value.to_ne_bytes());
18084 self
18085 }
18086}
18087impl<Prev: Pusher> Drop for PushNl80211Attrs<Prev> {
18088 fn drop(&mut self) {
18089 if let Some(prev) = &mut self.prev {
18090 if let Some(header_offset) = &self.header_offset {
18091 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18092 }
18093 }
18094 }
18095}
18096pub struct PushFrameTypeAttrs<Prev: Pusher> {
18097 pub(crate) prev: Option<Prev>,
18098 pub(crate) header_offset: Option<usize>,
18099}
18100impl<Prev: Pusher> Pusher for PushFrameTypeAttrs<Prev> {
18101 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18102 self.prev.as_mut().unwrap().as_vec_mut()
18103 }
18104 fn as_vec(&self) -> &Vec<u8> {
18105 self.prev.as_ref().unwrap().as_vec()
18106 }
18107}
18108impl<Prev: Pusher> PushFrameTypeAttrs<Prev> {
18109 pub fn new(prev: Prev) -> Self {
18110 Self {
18111 prev: Some(prev),
18112 header_offset: None,
18113 }
18114 }
18115 pub fn end_nested(mut self) -> Prev {
18116 let mut prev = self.prev.take().unwrap();
18117 if let Some(header_offset) = &self.header_offset {
18118 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18119 }
18120 prev
18121 }
18122 pub fn push_frame_type(mut self, value: u16) -> Self {
18123 push_header(self.as_vec_mut(), 101u16, 2 as u16);
18124 self.as_vec_mut().extend(value.to_ne_bytes());
18125 self
18126 }
18127}
18128impl<Prev: Pusher> Drop for PushFrameTypeAttrs<Prev> {
18129 fn drop(&mut self) {
18130 if let Some(prev) = &mut self.prev {
18131 if let Some(header_offset) = &self.header_offset {
18132 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18133 }
18134 }
18135 }
18136}
18137pub struct PushWiphyBands<Prev: Pusher> {
18138 pub(crate) prev: Option<Prev>,
18139 pub(crate) header_offset: Option<usize>,
18140}
18141impl<Prev: Pusher> Pusher for PushWiphyBands<Prev> {
18142 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18143 self.prev.as_mut().unwrap().as_vec_mut()
18144 }
18145 fn as_vec(&self) -> &Vec<u8> {
18146 self.prev.as_ref().unwrap().as_vec()
18147 }
18148}
18149impl<Prev: Pusher> PushWiphyBands<Prev> {
18150 pub fn new(prev: Prev) -> Self {
18151 Self {
18152 prev: Some(prev),
18153 header_offset: None,
18154 }
18155 }
18156 pub fn end_nested(mut self) -> Prev {
18157 let mut prev = self.prev.take().unwrap();
18158 if let Some(header_offset) = &self.header_offset {
18159 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18160 }
18161 prev
18162 }
18163 #[doc = "2.4 GHz ISM band\n"]
18164 pub fn nested_2ghz(mut self) -> PushBandAttrs<Self> {
18165 let header_offset = push_nested_header(self.as_vec_mut(), 0u16);
18166 PushBandAttrs {
18167 prev: Some(self),
18168 header_offset: Some(header_offset),
18169 }
18170 }
18171 #[doc = "around 5 GHz band (4.9 - 5.7 GHz)\n"]
18172 pub fn nested_5ghz(mut self) -> PushBandAttrs<Self> {
18173 let header_offset = push_nested_header(self.as_vec_mut(), 1u16);
18174 PushBandAttrs {
18175 prev: Some(self),
18176 header_offset: Some(header_offset),
18177 }
18178 }
18179 #[doc = "around 60 GHz band (58.32 - 69.12 GHz)\n"]
18180 pub fn nested_60ghz(mut self) -> PushBandAttrs<Self> {
18181 let header_offset = push_nested_header(self.as_vec_mut(), 2u16);
18182 PushBandAttrs {
18183 prev: Some(self),
18184 header_offset: Some(header_offset),
18185 }
18186 }
18187 pub fn nested_6ghz(mut self) -> PushBandAttrs<Self> {
18188 let header_offset = push_nested_header(self.as_vec_mut(), 3u16);
18189 PushBandAttrs {
18190 prev: Some(self),
18191 header_offset: Some(header_offset),
18192 }
18193 }
18194 pub fn nested_s1ghz(mut self) -> PushBandAttrs<Self> {
18195 let header_offset = push_nested_header(self.as_vec_mut(), 4u16);
18196 PushBandAttrs {
18197 prev: Some(self),
18198 header_offset: Some(header_offset),
18199 }
18200 }
18201 pub fn nested_lc(mut self) -> PushBandAttrs<Self> {
18202 let header_offset = push_nested_header(self.as_vec_mut(), 5u16);
18203 PushBandAttrs {
18204 prev: Some(self),
18205 header_offset: Some(header_offset),
18206 }
18207 }
18208}
18209impl<Prev: Pusher> Drop for PushWiphyBands<Prev> {
18210 fn drop(&mut self) {
18211 if let Some(prev) = &mut self.prev {
18212 if let Some(header_offset) = &self.header_offset {
18213 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18214 }
18215 }
18216 }
18217}
18218pub struct PushBandAttrs<Prev: Pusher> {
18219 pub(crate) prev: Option<Prev>,
18220 pub(crate) header_offset: Option<usize>,
18221}
18222impl<Prev: Pusher> Pusher for PushBandAttrs<Prev> {
18223 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18224 self.prev.as_mut().unwrap().as_vec_mut()
18225 }
18226 fn as_vec(&self) -> &Vec<u8> {
18227 self.prev.as_ref().unwrap().as_vec()
18228 }
18229}
18230pub struct PushArrayFrequencyAttrs<Prev: Pusher> {
18231 pub(crate) prev: Option<Prev>,
18232 pub(crate) header_offset: Option<usize>,
18233 pub(crate) counter: u16,
18234}
18235impl<Prev: Pusher> Pusher for PushArrayFrequencyAttrs<Prev> {
18236 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18237 self.prev.as_mut().unwrap().as_vec_mut()
18238 }
18239 fn as_vec(&self) -> &Vec<u8> {
18240 self.prev.as_ref().unwrap().as_vec()
18241 }
18242}
18243impl<Prev: Pusher> PushArrayFrequencyAttrs<Prev> {
18244 pub fn new(prev: Prev) -> Self {
18245 Self {
18246 prev: Some(prev),
18247 header_offset: None,
18248 counter: 0,
18249 }
18250 }
18251 pub fn end_array(mut self) -> Prev {
18252 let mut prev = self.prev.take().unwrap();
18253 if let Some(header_offset) = &self.header_offset {
18254 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18255 }
18256 prev
18257 }
18258 pub fn entry_nested(mut self) -> PushFrequencyAttrs<Self> {
18259 let index = self.counter;
18260 self.counter += 1;
18261 let header_offset = push_nested_header(self.as_vec_mut(), index);
18262 PushFrequencyAttrs {
18263 prev: Some(self),
18264 header_offset: Some(header_offset),
18265 }
18266 }
18267}
18268impl<Prev: Pusher> Drop for PushArrayFrequencyAttrs<Prev> {
18269 fn drop(&mut self) {
18270 if let Some(prev) = &mut self.prev {
18271 if let Some(header_offset) = &self.header_offset {
18272 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18273 }
18274 }
18275 }
18276}
18277pub struct PushArrayBitrateAttrs<Prev: Pusher> {
18278 pub(crate) prev: Option<Prev>,
18279 pub(crate) header_offset: Option<usize>,
18280 pub(crate) counter: u16,
18281}
18282impl<Prev: Pusher> Pusher for PushArrayBitrateAttrs<Prev> {
18283 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18284 self.prev.as_mut().unwrap().as_vec_mut()
18285 }
18286 fn as_vec(&self) -> &Vec<u8> {
18287 self.prev.as_ref().unwrap().as_vec()
18288 }
18289}
18290impl<Prev: Pusher> PushArrayBitrateAttrs<Prev> {
18291 pub fn new(prev: Prev) -> Self {
18292 Self {
18293 prev: Some(prev),
18294 header_offset: None,
18295 counter: 0,
18296 }
18297 }
18298 pub fn end_array(mut self) -> Prev {
18299 let mut prev = self.prev.take().unwrap();
18300 if let Some(header_offset) = &self.header_offset {
18301 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18302 }
18303 prev
18304 }
18305 pub fn entry_nested(mut self) -> PushBitrateAttrs<Self> {
18306 let index = self.counter;
18307 self.counter += 1;
18308 let header_offset = push_nested_header(self.as_vec_mut(), index);
18309 PushBitrateAttrs {
18310 prev: Some(self),
18311 header_offset: Some(header_offset),
18312 }
18313 }
18314}
18315impl<Prev: Pusher> Drop for PushArrayBitrateAttrs<Prev> {
18316 fn drop(&mut self) {
18317 if let Some(prev) = &mut self.prev {
18318 if let Some(header_offset) = &self.header_offset {
18319 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18320 }
18321 }
18322 }
18323}
18324pub struct PushArrayIftypeDataAttrs<Prev: Pusher> {
18325 pub(crate) prev: Option<Prev>,
18326 pub(crate) header_offset: Option<usize>,
18327 pub(crate) counter: u16,
18328}
18329impl<Prev: Pusher> Pusher for PushArrayIftypeDataAttrs<Prev> {
18330 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18331 self.prev.as_mut().unwrap().as_vec_mut()
18332 }
18333 fn as_vec(&self) -> &Vec<u8> {
18334 self.prev.as_ref().unwrap().as_vec()
18335 }
18336}
18337impl<Prev: Pusher> PushArrayIftypeDataAttrs<Prev> {
18338 pub fn new(prev: Prev) -> Self {
18339 Self {
18340 prev: Some(prev),
18341 header_offset: None,
18342 counter: 0,
18343 }
18344 }
18345 pub fn end_array(mut self) -> Prev {
18346 let mut prev = self.prev.take().unwrap();
18347 if let Some(header_offset) = &self.header_offset {
18348 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18349 }
18350 prev
18351 }
18352 pub fn entry_nested(mut self) -> PushIftypeDataAttrs<Self> {
18353 let index = self.counter;
18354 self.counter += 1;
18355 let header_offset = push_nested_header(self.as_vec_mut(), index);
18356 PushIftypeDataAttrs {
18357 prev: Some(self),
18358 header_offset: Some(header_offset),
18359 }
18360 }
18361}
18362impl<Prev: Pusher> Drop for PushArrayIftypeDataAttrs<Prev> {
18363 fn drop(&mut self) {
18364 if let Some(prev) = &mut self.prev {
18365 if let Some(header_offset) = &self.header_offset {
18366 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18367 }
18368 }
18369 }
18370}
18371impl<Prev: Pusher> PushBandAttrs<Prev> {
18372 pub fn new(prev: Prev) -> Self {
18373 Self {
18374 prev: Some(prev),
18375 header_offset: None,
18376 }
18377 }
18378 pub fn end_nested(mut self) -> Prev {
18379 let mut prev = self.prev.take().unwrap();
18380 if let Some(header_offset) = &self.header_offset {
18381 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18382 }
18383 prev
18384 }
18385 pub fn array_freqs(mut self) -> PushArrayFrequencyAttrs<Self> {
18386 let header_offset = push_nested_header(self.as_vec_mut(), 1u16);
18387 PushArrayFrequencyAttrs {
18388 prev: Some(self),
18389 header_offset: Some(header_offset),
18390 counter: 0,
18391 }
18392 }
18393 pub fn array_rates(mut self) -> PushArrayBitrateAttrs<Self> {
18394 let header_offset = push_nested_header(self.as_vec_mut(), 2u16);
18395 PushArrayBitrateAttrs {
18396 prev: Some(self),
18397 header_offset: Some(header_offset),
18398 counter: 0,
18399 }
18400 }
18401 pub fn push_ht_mcs_set(mut self, value: &[u8]) -> Self {
18402 push_header(self.as_vec_mut(), 3u16, value.len() as u16);
18403 self.as_vec_mut().extend(value);
18404 self
18405 }
18406 pub fn push_ht_capa(mut self, value: u16) -> Self {
18407 push_header(self.as_vec_mut(), 4u16, 2 as u16);
18408 self.as_vec_mut().extend(value.to_ne_bytes());
18409 self
18410 }
18411 pub fn push_ht_ampdu_factor(mut self, value: u8) -> Self {
18412 push_header(self.as_vec_mut(), 5u16, 1 as u16);
18413 self.as_vec_mut().extend(value.to_ne_bytes());
18414 self
18415 }
18416 pub fn push_ht_ampdu_density(mut self, value: u8) -> Self {
18417 push_header(self.as_vec_mut(), 6u16, 1 as u16);
18418 self.as_vec_mut().extend(value.to_ne_bytes());
18419 self
18420 }
18421 pub fn push_vht_mcs_set(mut self, value: &[u8]) -> Self {
18422 push_header(self.as_vec_mut(), 7u16, value.len() as u16);
18423 self.as_vec_mut().extend(value);
18424 self
18425 }
18426 pub fn push_vht_capa(mut self, value: u32) -> Self {
18427 push_header(self.as_vec_mut(), 8u16, 4 as u16);
18428 self.as_vec_mut().extend(value.to_ne_bytes());
18429 self
18430 }
18431 pub fn array_iftype_data(mut self) -> PushArrayIftypeDataAttrs<Self> {
18432 let header_offset = push_nested_header(self.as_vec_mut(), 9u16);
18433 PushArrayIftypeDataAttrs {
18434 prev: Some(self),
18435 header_offset: Some(header_offset),
18436 counter: 0,
18437 }
18438 }
18439 pub fn push_edmg_channels(mut self, value: &[u8]) -> Self {
18440 push_header(self.as_vec_mut(), 10u16, value.len() as u16);
18441 self.as_vec_mut().extend(value);
18442 self
18443 }
18444 pub fn push_edmg_bw_config(mut self, value: &[u8]) -> Self {
18445 push_header(self.as_vec_mut(), 11u16, value.len() as u16);
18446 self.as_vec_mut().extend(value);
18447 self
18448 }
18449 pub fn push_s1g_mcs_nss_set(mut self, value: &[u8]) -> Self {
18450 push_header(self.as_vec_mut(), 12u16, value.len() as u16);
18451 self.as_vec_mut().extend(value);
18452 self
18453 }
18454 pub fn push_s1g_capa(mut self, value: &[u8]) -> Self {
18455 push_header(self.as_vec_mut(), 13u16, value.len() as u16);
18456 self.as_vec_mut().extend(value);
18457 self
18458 }
18459}
18460impl<Prev: Pusher> Drop for PushBandAttrs<Prev> {
18461 fn drop(&mut self) {
18462 if let Some(prev) = &mut self.prev {
18463 if let Some(header_offset) = &self.header_offset {
18464 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18465 }
18466 }
18467 }
18468}
18469pub struct PushBitrateAttrs<Prev: Pusher> {
18470 pub(crate) prev: Option<Prev>,
18471 pub(crate) header_offset: Option<usize>,
18472}
18473impl<Prev: Pusher> Pusher for PushBitrateAttrs<Prev> {
18474 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18475 self.prev.as_mut().unwrap().as_vec_mut()
18476 }
18477 fn as_vec(&self) -> &Vec<u8> {
18478 self.prev.as_ref().unwrap().as_vec()
18479 }
18480}
18481impl<Prev: Pusher> PushBitrateAttrs<Prev> {
18482 pub fn new(prev: Prev) -> Self {
18483 Self {
18484 prev: Some(prev),
18485 header_offset: None,
18486 }
18487 }
18488 pub fn end_nested(mut self) -> Prev {
18489 let mut prev = self.prev.take().unwrap();
18490 if let Some(header_offset) = &self.header_offset {
18491 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18492 }
18493 prev
18494 }
18495 pub fn push_rate(mut self, value: u32) -> Self {
18496 push_header(self.as_vec_mut(), 1u16, 4 as u16);
18497 self.as_vec_mut().extend(value.to_ne_bytes());
18498 self
18499 }
18500 pub fn push_2ghz_shortpreamble(mut self, value: ()) -> Self {
18501 push_header(self.as_vec_mut(), 2u16, 0 as u16);
18502 self
18503 }
18504}
18505impl<Prev: Pusher> Drop for PushBitrateAttrs<Prev> {
18506 fn drop(&mut self) {
18507 if let Some(prev) = &mut self.prev {
18508 if let Some(header_offset) = &self.header_offset {
18509 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18510 }
18511 }
18512 }
18513}
18514pub struct PushFrequencyAttrs<Prev: Pusher> {
18515 pub(crate) prev: Option<Prev>,
18516 pub(crate) header_offset: Option<usize>,
18517}
18518impl<Prev: Pusher> Pusher for PushFrequencyAttrs<Prev> {
18519 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18520 self.prev.as_mut().unwrap().as_vec_mut()
18521 }
18522 fn as_vec(&self) -> &Vec<u8> {
18523 self.prev.as_ref().unwrap().as_vec()
18524 }
18525}
18526pub struct PushArrayWmmAttrs<Prev: Pusher> {
18527 pub(crate) prev: Option<Prev>,
18528 pub(crate) header_offset: Option<usize>,
18529 pub(crate) counter: u16,
18530}
18531impl<Prev: Pusher> Pusher for PushArrayWmmAttrs<Prev> {
18532 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18533 self.prev.as_mut().unwrap().as_vec_mut()
18534 }
18535 fn as_vec(&self) -> &Vec<u8> {
18536 self.prev.as_ref().unwrap().as_vec()
18537 }
18538}
18539impl<Prev: Pusher> PushArrayWmmAttrs<Prev> {
18540 pub fn new(prev: Prev) -> Self {
18541 Self {
18542 prev: Some(prev),
18543 header_offset: None,
18544 counter: 0,
18545 }
18546 }
18547 pub fn end_array(mut self) -> Prev {
18548 let mut prev = self.prev.take().unwrap();
18549 if let Some(header_offset) = &self.header_offset {
18550 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18551 }
18552 prev
18553 }
18554 pub fn entry_nested(mut self) -> PushWmmAttrs<Self> {
18555 let index = self.counter;
18556 self.counter += 1;
18557 let header_offset = push_nested_header(self.as_vec_mut(), index);
18558 PushWmmAttrs {
18559 prev: Some(self),
18560 header_offset: Some(header_offset),
18561 }
18562 }
18563}
18564impl<Prev: Pusher> Drop for PushArrayWmmAttrs<Prev> {
18565 fn drop(&mut self) {
18566 if let Some(prev) = &mut self.prev {
18567 if let Some(header_offset) = &self.header_offset {
18568 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18569 }
18570 }
18571 }
18572}
18573impl<Prev: Pusher> PushFrequencyAttrs<Prev> {
18574 pub fn new(prev: Prev) -> Self {
18575 Self {
18576 prev: Some(prev),
18577 header_offset: None,
18578 }
18579 }
18580 pub fn end_nested(mut self) -> Prev {
18581 let mut prev = self.prev.take().unwrap();
18582 if let Some(header_offset) = &self.header_offset {
18583 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18584 }
18585 prev
18586 }
18587 pub fn push_freq(mut self, value: u32) -> Self {
18588 push_header(self.as_vec_mut(), 1u16, 4 as u16);
18589 self.as_vec_mut().extend(value.to_ne_bytes());
18590 self
18591 }
18592 pub fn push_disabled(mut self, value: ()) -> Self {
18593 push_header(self.as_vec_mut(), 2u16, 0 as u16);
18594 self
18595 }
18596 pub fn push_no_ir(mut self, value: ()) -> Self {
18597 push_header(self.as_vec_mut(), 3u16, 0 as u16);
18598 self
18599 }
18600 pub fn push_no_ibss(mut self, value: ()) -> Self {
18601 push_header(self.as_vec_mut(), 4u16, 0 as u16);
18602 self
18603 }
18604 pub fn push_radar(mut self, value: ()) -> Self {
18605 push_header(self.as_vec_mut(), 5u16, 0 as u16);
18606 self
18607 }
18608 pub fn push_max_tx_power(mut self, value: u32) -> Self {
18609 push_header(self.as_vec_mut(), 6u16, 4 as u16);
18610 self.as_vec_mut().extend(value.to_ne_bytes());
18611 self
18612 }
18613 pub fn push_dfs_state(mut self, value: u32) -> Self {
18614 push_header(self.as_vec_mut(), 7u16, 4 as u16);
18615 self.as_vec_mut().extend(value.to_ne_bytes());
18616 self
18617 }
18618 pub fn push_dfs_time(mut self, value: &[u8]) -> Self {
18619 push_header(self.as_vec_mut(), 8u16, value.len() as u16);
18620 self.as_vec_mut().extend(value);
18621 self
18622 }
18623 pub fn push_no_ht40_minus(mut self, value: &[u8]) -> Self {
18624 push_header(self.as_vec_mut(), 9u16, value.len() as u16);
18625 self.as_vec_mut().extend(value);
18626 self
18627 }
18628 pub fn push_no_ht40_plus(mut self, value: &[u8]) -> Self {
18629 push_header(self.as_vec_mut(), 10u16, value.len() as u16);
18630 self.as_vec_mut().extend(value);
18631 self
18632 }
18633 pub fn push_no_80mhz(mut self, value: &[u8]) -> Self {
18634 push_header(self.as_vec_mut(), 11u16, value.len() as u16);
18635 self.as_vec_mut().extend(value);
18636 self
18637 }
18638 pub fn push_no_160mhz(mut self, value: &[u8]) -> Self {
18639 push_header(self.as_vec_mut(), 12u16, value.len() as u16);
18640 self.as_vec_mut().extend(value);
18641 self
18642 }
18643 pub fn push_dfs_cac_time(mut self, value: &[u8]) -> Self {
18644 push_header(self.as_vec_mut(), 13u16, value.len() as u16);
18645 self.as_vec_mut().extend(value);
18646 self
18647 }
18648 pub fn push_indoor_only(mut self, value: &[u8]) -> Self {
18649 push_header(self.as_vec_mut(), 14u16, value.len() as u16);
18650 self.as_vec_mut().extend(value);
18651 self
18652 }
18653 pub fn push_ir_concurrent(mut self, value: &[u8]) -> Self {
18654 push_header(self.as_vec_mut(), 15u16, value.len() as u16);
18655 self.as_vec_mut().extend(value);
18656 self
18657 }
18658 pub fn push_no_20mhz(mut self, value: &[u8]) -> Self {
18659 push_header(self.as_vec_mut(), 16u16, value.len() as u16);
18660 self.as_vec_mut().extend(value);
18661 self
18662 }
18663 pub fn push_no_10mhz(mut self, value: &[u8]) -> Self {
18664 push_header(self.as_vec_mut(), 17u16, value.len() as u16);
18665 self.as_vec_mut().extend(value);
18666 self
18667 }
18668 pub fn array_wmm(mut self) -> PushArrayWmmAttrs<Self> {
18669 let header_offset = push_nested_header(self.as_vec_mut(), 18u16);
18670 PushArrayWmmAttrs {
18671 prev: Some(self),
18672 header_offset: Some(header_offset),
18673 counter: 0,
18674 }
18675 }
18676 pub fn push_no_he(mut self, value: &[u8]) -> Self {
18677 push_header(self.as_vec_mut(), 19u16, value.len() as u16);
18678 self.as_vec_mut().extend(value);
18679 self
18680 }
18681 pub fn push_offset(mut self, value: u32) -> Self {
18682 push_header(self.as_vec_mut(), 20u16, 4 as u16);
18683 self.as_vec_mut().extend(value.to_ne_bytes());
18684 self
18685 }
18686 pub fn push_1mhz(mut self, value: &[u8]) -> Self {
18687 push_header(self.as_vec_mut(), 21u16, value.len() as u16);
18688 self.as_vec_mut().extend(value);
18689 self
18690 }
18691 pub fn push_2mhz(mut self, value: &[u8]) -> Self {
18692 push_header(self.as_vec_mut(), 22u16, value.len() as u16);
18693 self.as_vec_mut().extend(value);
18694 self
18695 }
18696 pub fn push_4mhz(mut self, value: &[u8]) -> Self {
18697 push_header(self.as_vec_mut(), 23u16, value.len() as u16);
18698 self.as_vec_mut().extend(value);
18699 self
18700 }
18701 pub fn push_8mhz(mut self, value: &[u8]) -> Self {
18702 push_header(self.as_vec_mut(), 24u16, value.len() as u16);
18703 self.as_vec_mut().extend(value);
18704 self
18705 }
18706 pub fn push_16mhz(mut self, value: &[u8]) -> Self {
18707 push_header(self.as_vec_mut(), 25u16, value.len() as u16);
18708 self.as_vec_mut().extend(value);
18709 self
18710 }
18711 pub fn push_no_320mhz(mut self, value: &[u8]) -> Self {
18712 push_header(self.as_vec_mut(), 26u16, value.len() as u16);
18713 self.as_vec_mut().extend(value);
18714 self
18715 }
18716 pub fn push_no_eht(mut self, value: &[u8]) -> Self {
18717 push_header(self.as_vec_mut(), 27u16, value.len() as u16);
18718 self.as_vec_mut().extend(value);
18719 self
18720 }
18721 pub fn push_psd(mut self, value: &[u8]) -> Self {
18722 push_header(self.as_vec_mut(), 28u16, value.len() as u16);
18723 self.as_vec_mut().extend(value);
18724 self
18725 }
18726 pub fn push_dfs_concurrent(mut self, value: &[u8]) -> Self {
18727 push_header(self.as_vec_mut(), 29u16, value.len() as u16);
18728 self.as_vec_mut().extend(value);
18729 self
18730 }
18731 pub fn push_no_6ghz_vlp_client(mut self, value: &[u8]) -> Self {
18732 push_header(self.as_vec_mut(), 30u16, value.len() as u16);
18733 self.as_vec_mut().extend(value);
18734 self
18735 }
18736 pub fn push_no_6ghz_afc_client(mut self, value: &[u8]) -> Self {
18737 push_header(self.as_vec_mut(), 31u16, value.len() as u16);
18738 self.as_vec_mut().extend(value);
18739 self
18740 }
18741 pub fn push_can_monitor(mut self, value: &[u8]) -> Self {
18742 push_header(self.as_vec_mut(), 32u16, value.len() as u16);
18743 self.as_vec_mut().extend(value);
18744 self
18745 }
18746 pub fn push_allow_6ghz_vlp_ap(mut self, value: &[u8]) -> Self {
18747 push_header(self.as_vec_mut(), 33u16, value.len() as u16);
18748 self.as_vec_mut().extend(value);
18749 self
18750 }
18751}
18752impl<Prev: Pusher> Drop for PushFrequencyAttrs<Prev> {
18753 fn drop(&mut self) {
18754 if let Some(prev) = &mut self.prev {
18755 if let Some(header_offset) = &self.header_offset {
18756 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18757 }
18758 }
18759 }
18760}
18761pub struct PushIfCombinationAttributes<Prev: Pusher> {
18762 pub(crate) prev: Option<Prev>,
18763 pub(crate) header_offset: Option<usize>,
18764}
18765impl<Prev: Pusher> Pusher for PushIfCombinationAttributes<Prev> {
18766 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18767 self.prev.as_mut().unwrap().as_vec_mut()
18768 }
18769 fn as_vec(&self) -> &Vec<u8> {
18770 self.prev.as_ref().unwrap().as_vec()
18771 }
18772}
18773pub struct PushArrayIfaceLimitAttributes<Prev: Pusher> {
18774 pub(crate) prev: Option<Prev>,
18775 pub(crate) header_offset: Option<usize>,
18776 pub(crate) counter: u16,
18777}
18778impl<Prev: Pusher> Pusher for PushArrayIfaceLimitAttributes<Prev> {
18779 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18780 self.prev.as_mut().unwrap().as_vec_mut()
18781 }
18782 fn as_vec(&self) -> &Vec<u8> {
18783 self.prev.as_ref().unwrap().as_vec()
18784 }
18785}
18786impl<Prev: Pusher> PushArrayIfaceLimitAttributes<Prev> {
18787 pub fn new(prev: Prev) -> Self {
18788 Self {
18789 prev: Some(prev),
18790 header_offset: None,
18791 counter: 0,
18792 }
18793 }
18794 pub fn end_array(mut self) -> Prev {
18795 let mut prev = self.prev.take().unwrap();
18796 if let Some(header_offset) = &self.header_offset {
18797 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18798 }
18799 prev
18800 }
18801 pub fn entry_nested(mut self) -> PushIfaceLimitAttributes<Self> {
18802 let index = self.counter;
18803 self.counter += 1;
18804 let header_offset = push_nested_header(self.as_vec_mut(), index);
18805 PushIfaceLimitAttributes {
18806 prev: Some(self),
18807 header_offset: Some(header_offset),
18808 }
18809 }
18810}
18811impl<Prev: Pusher> Drop for PushArrayIfaceLimitAttributes<Prev> {
18812 fn drop(&mut self) {
18813 if let Some(prev) = &mut self.prev {
18814 if let Some(header_offset) = &self.header_offset {
18815 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18816 }
18817 }
18818 }
18819}
18820impl<Prev: Pusher> PushIfCombinationAttributes<Prev> {
18821 pub fn new(prev: Prev) -> Self {
18822 Self {
18823 prev: Some(prev),
18824 header_offset: None,
18825 }
18826 }
18827 pub fn end_nested(mut self) -> Prev {
18828 let mut prev = self.prev.take().unwrap();
18829 if let Some(header_offset) = &self.header_offset {
18830 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18831 }
18832 prev
18833 }
18834 pub fn array_limits(mut self) -> PushArrayIfaceLimitAttributes<Self> {
18835 let header_offset = push_nested_header(self.as_vec_mut(), 1u16);
18836 PushArrayIfaceLimitAttributes {
18837 prev: Some(self),
18838 header_offset: Some(header_offset),
18839 counter: 0,
18840 }
18841 }
18842 pub fn push_maxnum(mut self, value: u32) -> Self {
18843 push_header(self.as_vec_mut(), 2u16, 4 as u16);
18844 self.as_vec_mut().extend(value.to_ne_bytes());
18845 self
18846 }
18847 pub fn push_sta_ap_bi_match(mut self, value: ()) -> Self {
18848 push_header(self.as_vec_mut(), 3u16, 0 as u16);
18849 self
18850 }
18851 pub fn push_num_channels(mut self, value: u32) -> Self {
18852 push_header(self.as_vec_mut(), 4u16, 4 as u16);
18853 self.as_vec_mut().extend(value.to_ne_bytes());
18854 self
18855 }
18856 pub fn push_radar_detect_widths(mut self, value: u32) -> Self {
18857 push_header(self.as_vec_mut(), 5u16, 4 as u16);
18858 self.as_vec_mut().extend(value.to_ne_bytes());
18859 self
18860 }
18861 pub fn push_radar_detect_regions(mut self, value: u32) -> Self {
18862 push_header(self.as_vec_mut(), 6u16, 4 as u16);
18863 self.as_vec_mut().extend(value.to_ne_bytes());
18864 self
18865 }
18866 pub fn push_bi_min_gcd(mut self, value: u32) -> Self {
18867 push_header(self.as_vec_mut(), 7u16, 4 as u16);
18868 self.as_vec_mut().extend(value.to_ne_bytes());
18869 self
18870 }
18871}
18872impl<Prev: Pusher> Drop for PushIfCombinationAttributes<Prev> {
18873 fn drop(&mut self) {
18874 if let Some(prev) = &mut self.prev {
18875 if let Some(header_offset) = &self.header_offset {
18876 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18877 }
18878 }
18879 }
18880}
18881pub struct PushIfaceLimitAttributes<Prev: Pusher> {
18882 pub(crate) prev: Option<Prev>,
18883 pub(crate) header_offset: Option<usize>,
18884}
18885impl<Prev: Pusher> Pusher for PushIfaceLimitAttributes<Prev> {
18886 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18887 self.prev.as_mut().unwrap().as_vec_mut()
18888 }
18889 fn as_vec(&self) -> &Vec<u8> {
18890 self.prev.as_ref().unwrap().as_vec()
18891 }
18892}
18893impl<Prev: Pusher> PushIfaceLimitAttributes<Prev> {
18894 pub fn new(prev: Prev) -> Self {
18895 Self {
18896 prev: Some(prev),
18897 header_offset: None,
18898 }
18899 }
18900 pub fn end_nested(mut self) -> Prev {
18901 let mut prev = self.prev.take().unwrap();
18902 if let Some(header_offset) = &self.header_offset {
18903 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18904 }
18905 prev
18906 }
18907 pub fn push_max(mut self, value: u32) -> Self {
18908 push_header(self.as_vec_mut(), 1u16, 4 as u16);
18909 self.as_vec_mut().extend(value.to_ne_bytes());
18910 self
18911 }
18912 pub fn nested_types(mut self) -> PushSupportedIftypes<Self> {
18913 let header_offset = push_nested_header(self.as_vec_mut(), 2u16);
18914 PushSupportedIftypes {
18915 prev: Some(self),
18916 header_offset: Some(header_offset),
18917 }
18918 }
18919}
18920impl<Prev: Pusher> Drop for PushIfaceLimitAttributes<Prev> {
18921 fn drop(&mut self) {
18922 if let Some(prev) = &mut self.prev {
18923 if let Some(header_offset) = &self.header_offset {
18924 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18925 }
18926 }
18927 }
18928}
18929pub struct PushIftypeDataAttrs<Prev: Pusher> {
18930 pub(crate) prev: Option<Prev>,
18931 pub(crate) header_offset: Option<usize>,
18932}
18933impl<Prev: Pusher> Pusher for PushIftypeDataAttrs<Prev> {
18934 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
18935 self.prev.as_mut().unwrap().as_vec_mut()
18936 }
18937 fn as_vec(&self) -> &Vec<u8> {
18938 self.prev.as_ref().unwrap().as_vec()
18939 }
18940}
18941impl<Prev: Pusher> PushIftypeDataAttrs<Prev> {
18942 pub fn new(prev: Prev) -> Self {
18943 Self {
18944 prev: Some(prev),
18945 header_offset: None,
18946 }
18947 }
18948 pub fn end_nested(mut self) -> Prev {
18949 let mut prev = self.prev.take().unwrap();
18950 if let Some(header_offset) = &self.header_offset {
18951 finalize_nested_header(prev.as_vec_mut(), *header_offset);
18952 }
18953 prev
18954 }
18955 pub fn push_iftypes(mut self, value: &[u8]) -> Self {
18956 push_header(self.as_vec_mut(), 1u16, value.len() as u16);
18957 self.as_vec_mut().extend(value);
18958 self
18959 }
18960 pub fn push_he_cap_mac(mut self, value: &[u8]) -> Self {
18961 push_header(self.as_vec_mut(), 2u16, value.len() as u16);
18962 self.as_vec_mut().extend(value);
18963 self
18964 }
18965 pub fn push_he_cap_phy(mut self, value: &[u8]) -> Self {
18966 push_header(self.as_vec_mut(), 3u16, value.len() as u16);
18967 self.as_vec_mut().extend(value);
18968 self
18969 }
18970 pub fn push_he_cap_mcs_set(mut self, value: &[u8]) -> Self {
18971 push_header(self.as_vec_mut(), 4u16, value.len() as u16);
18972 self.as_vec_mut().extend(value);
18973 self
18974 }
18975 pub fn push_he_cap_ppe(mut self, value: &[u8]) -> Self {
18976 push_header(self.as_vec_mut(), 5u16, value.len() as u16);
18977 self.as_vec_mut().extend(value);
18978 self
18979 }
18980 pub fn push_he_6ghz_capa(mut self, value: &[u8]) -> Self {
18981 push_header(self.as_vec_mut(), 6u16, value.len() as u16);
18982 self.as_vec_mut().extend(value);
18983 self
18984 }
18985 pub fn push_vendor_elems(mut self, value: &[u8]) -> Self {
18986 push_header(self.as_vec_mut(), 7u16, value.len() as u16);
18987 self.as_vec_mut().extend(value);
18988 self
18989 }
18990 pub fn push_eht_cap_mac(mut self, value: &[u8]) -> Self {
18991 push_header(self.as_vec_mut(), 8u16, value.len() as u16);
18992 self.as_vec_mut().extend(value);
18993 self
18994 }
18995 pub fn push_eht_cap_phy(mut self, value: &[u8]) -> Self {
18996 push_header(self.as_vec_mut(), 9u16, value.len() as u16);
18997 self.as_vec_mut().extend(value);
18998 self
18999 }
19000 pub fn push_eht_cap_mcs_set(mut self, value: &[u8]) -> Self {
19001 push_header(self.as_vec_mut(), 10u16, value.len() as u16);
19002 self.as_vec_mut().extend(value);
19003 self
19004 }
19005 pub fn push_eht_cap_ppe(mut self, value: &[u8]) -> Self {
19006 push_header(self.as_vec_mut(), 11u16, value.len() as u16);
19007 self.as_vec_mut().extend(value);
19008 self
19009 }
19010}
19011impl<Prev: Pusher> Drop for PushIftypeDataAttrs<Prev> {
19012 fn drop(&mut self) {
19013 if let Some(prev) = &mut self.prev {
19014 if let Some(header_offset) = &self.header_offset {
19015 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19016 }
19017 }
19018 }
19019}
19020pub struct PushIftypeAttrs<Prev: Pusher> {
19021 pub(crate) prev: Option<Prev>,
19022 pub(crate) header_offset: Option<usize>,
19023}
19024impl<Prev: Pusher> Pusher for PushIftypeAttrs<Prev> {
19025 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19026 self.prev.as_mut().unwrap().as_vec_mut()
19027 }
19028 fn as_vec(&self) -> &Vec<u8> {
19029 self.prev.as_ref().unwrap().as_vec()
19030 }
19031}
19032impl<Prev: Pusher> PushIftypeAttrs<Prev> {
19033 pub fn new(prev: Prev) -> Self {
19034 Self {
19035 prev: Some(prev),
19036 header_offset: None,
19037 }
19038 }
19039 pub fn end_nested(mut self) -> Prev {
19040 let mut prev = self.prev.take().unwrap();
19041 if let Some(header_offset) = &self.header_offset {
19042 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19043 }
19044 prev
19045 }
19046 pub fn nested_unspecified(mut self) -> PushFrameTypeAttrs<Self> {
19047 let header_offset = push_nested_header(self.as_vec_mut(), 0u16);
19048 PushFrameTypeAttrs {
19049 prev: Some(self),
19050 header_offset: Some(header_offset),
19051 }
19052 }
19053 pub fn nested_adhoc(mut self) -> PushFrameTypeAttrs<Self> {
19054 let header_offset = push_nested_header(self.as_vec_mut(), 1u16);
19055 PushFrameTypeAttrs {
19056 prev: Some(self),
19057 header_offset: Some(header_offset),
19058 }
19059 }
19060 pub fn nested_station(mut self) -> PushFrameTypeAttrs<Self> {
19061 let header_offset = push_nested_header(self.as_vec_mut(), 2u16);
19062 PushFrameTypeAttrs {
19063 prev: Some(self),
19064 header_offset: Some(header_offset),
19065 }
19066 }
19067 pub fn nested_ap(mut self) -> PushFrameTypeAttrs<Self> {
19068 let header_offset = push_nested_header(self.as_vec_mut(), 3u16);
19069 PushFrameTypeAttrs {
19070 prev: Some(self),
19071 header_offset: Some(header_offset),
19072 }
19073 }
19074 pub fn nested_ap_vlan(mut self) -> PushFrameTypeAttrs<Self> {
19075 let header_offset = push_nested_header(self.as_vec_mut(), 4u16);
19076 PushFrameTypeAttrs {
19077 prev: Some(self),
19078 header_offset: Some(header_offset),
19079 }
19080 }
19081 pub fn nested_wds(mut self) -> PushFrameTypeAttrs<Self> {
19082 let header_offset = push_nested_header(self.as_vec_mut(), 5u16);
19083 PushFrameTypeAttrs {
19084 prev: Some(self),
19085 header_offset: Some(header_offset),
19086 }
19087 }
19088 pub fn nested_monitor(mut self) -> PushFrameTypeAttrs<Self> {
19089 let header_offset = push_nested_header(self.as_vec_mut(), 6u16);
19090 PushFrameTypeAttrs {
19091 prev: Some(self),
19092 header_offset: Some(header_offset),
19093 }
19094 }
19095 pub fn nested_mesh_point(mut self) -> PushFrameTypeAttrs<Self> {
19096 let header_offset = push_nested_header(self.as_vec_mut(), 7u16);
19097 PushFrameTypeAttrs {
19098 prev: Some(self),
19099 header_offset: Some(header_offset),
19100 }
19101 }
19102 pub fn nested_p2p_client(mut self) -> PushFrameTypeAttrs<Self> {
19103 let header_offset = push_nested_header(self.as_vec_mut(), 8u16);
19104 PushFrameTypeAttrs {
19105 prev: Some(self),
19106 header_offset: Some(header_offset),
19107 }
19108 }
19109 pub fn nested_p2p_go(mut self) -> PushFrameTypeAttrs<Self> {
19110 let header_offset = push_nested_header(self.as_vec_mut(), 9u16);
19111 PushFrameTypeAttrs {
19112 prev: Some(self),
19113 header_offset: Some(header_offset),
19114 }
19115 }
19116 pub fn nested_p2p_device(mut self) -> PushFrameTypeAttrs<Self> {
19117 let header_offset = push_nested_header(self.as_vec_mut(), 10u16);
19118 PushFrameTypeAttrs {
19119 prev: Some(self),
19120 header_offset: Some(header_offset),
19121 }
19122 }
19123 pub fn nested_ocb(mut self) -> PushFrameTypeAttrs<Self> {
19124 let header_offset = push_nested_header(self.as_vec_mut(), 11u16);
19125 PushFrameTypeAttrs {
19126 prev: Some(self),
19127 header_offset: Some(header_offset),
19128 }
19129 }
19130 pub fn nested_nan(mut self) -> PushFrameTypeAttrs<Self> {
19131 let header_offset = push_nested_header(self.as_vec_mut(), 12u16);
19132 PushFrameTypeAttrs {
19133 prev: Some(self),
19134 header_offset: Some(header_offset),
19135 }
19136 }
19137}
19138impl<Prev: Pusher> Drop for PushIftypeAttrs<Prev> {
19139 fn drop(&mut self) {
19140 if let Some(prev) = &mut self.prev {
19141 if let Some(header_offset) = &self.header_offset {
19142 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19143 }
19144 }
19145 }
19146}
19147pub struct PushSarAttributes<Prev: Pusher> {
19148 pub(crate) prev: Option<Prev>,
19149 pub(crate) header_offset: Option<usize>,
19150}
19151impl<Prev: Pusher> Pusher for PushSarAttributes<Prev> {
19152 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19153 self.prev.as_mut().unwrap().as_vec_mut()
19154 }
19155 fn as_vec(&self) -> &Vec<u8> {
19156 self.prev.as_ref().unwrap().as_vec()
19157 }
19158}
19159pub struct PushArraySarSpecs<Prev: Pusher> {
19160 pub(crate) prev: Option<Prev>,
19161 pub(crate) header_offset: Option<usize>,
19162 pub(crate) counter: u16,
19163}
19164impl<Prev: Pusher> Pusher for PushArraySarSpecs<Prev> {
19165 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19166 self.prev.as_mut().unwrap().as_vec_mut()
19167 }
19168 fn as_vec(&self) -> &Vec<u8> {
19169 self.prev.as_ref().unwrap().as_vec()
19170 }
19171}
19172impl<Prev: Pusher> PushArraySarSpecs<Prev> {
19173 pub fn new(prev: Prev) -> Self {
19174 Self {
19175 prev: Some(prev),
19176 header_offset: None,
19177 counter: 0,
19178 }
19179 }
19180 pub fn end_array(mut self) -> Prev {
19181 let mut prev = self.prev.take().unwrap();
19182 if let Some(header_offset) = &self.header_offset {
19183 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19184 }
19185 prev
19186 }
19187 pub fn entry_nested(mut self) -> PushSarSpecs<Self> {
19188 let index = self.counter;
19189 self.counter += 1;
19190 let header_offset = push_nested_header(self.as_vec_mut(), index);
19191 PushSarSpecs {
19192 prev: Some(self),
19193 header_offset: Some(header_offset),
19194 }
19195 }
19196}
19197impl<Prev: Pusher> Drop for PushArraySarSpecs<Prev> {
19198 fn drop(&mut self) {
19199 if let Some(prev) = &mut self.prev {
19200 if let Some(header_offset) = &self.header_offset {
19201 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19202 }
19203 }
19204 }
19205}
19206impl<Prev: Pusher> PushSarAttributes<Prev> {
19207 pub fn new(prev: Prev) -> Self {
19208 Self {
19209 prev: Some(prev),
19210 header_offset: None,
19211 }
19212 }
19213 pub fn end_nested(mut self) -> Prev {
19214 let mut prev = self.prev.take().unwrap();
19215 if let Some(header_offset) = &self.header_offset {
19216 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19217 }
19218 prev
19219 }
19220 pub fn push_type(mut self, value: u32) -> Self {
19221 push_header(self.as_vec_mut(), 1u16, 4 as u16);
19222 self.as_vec_mut().extend(value.to_ne_bytes());
19223 self
19224 }
19225 pub fn array_specs(mut self) -> PushArraySarSpecs<Self> {
19226 let header_offset = push_nested_header(self.as_vec_mut(), 2u16);
19227 PushArraySarSpecs {
19228 prev: Some(self),
19229 header_offset: Some(header_offset),
19230 counter: 0,
19231 }
19232 }
19233}
19234impl<Prev: Pusher> Drop for PushSarAttributes<Prev> {
19235 fn drop(&mut self) {
19236 if let Some(prev) = &mut self.prev {
19237 if let Some(header_offset) = &self.header_offset {
19238 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19239 }
19240 }
19241 }
19242}
19243pub struct PushSarSpecs<Prev: Pusher> {
19244 pub(crate) prev: Option<Prev>,
19245 pub(crate) header_offset: Option<usize>,
19246}
19247impl<Prev: Pusher> Pusher for PushSarSpecs<Prev> {
19248 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19249 self.prev.as_mut().unwrap().as_vec_mut()
19250 }
19251 fn as_vec(&self) -> &Vec<u8> {
19252 self.prev.as_ref().unwrap().as_vec()
19253 }
19254}
19255impl<Prev: Pusher> PushSarSpecs<Prev> {
19256 pub fn new(prev: Prev) -> Self {
19257 Self {
19258 prev: Some(prev),
19259 header_offset: None,
19260 }
19261 }
19262 pub fn end_nested(mut self) -> Prev {
19263 let mut prev = self.prev.take().unwrap();
19264 if let Some(header_offset) = &self.header_offset {
19265 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19266 }
19267 prev
19268 }
19269 pub fn push_power(mut self, value: i32) -> Self {
19270 push_header(self.as_vec_mut(), 1u16, 4 as u16);
19271 self.as_vec_mut().extend(value.to_ne_bytes());
19272 self
19273 }
19274 pub fn push_range_index(mut self, value: u32) -> Self {
19275 push_header(self.as_vec_mut(), 2u16, 4 as u16);
19276 self.as_vec_mut().extend(value.to_ne_bytes());
19277 self
19278 }
19279 pub fn push_start_freq(mut self, value: u32) -> Self {
19280 push_header(self.as_vec_mut(), 3u16, 4 as u16);
19281 self.as_vec_mut().extend(value.to_ne_bytes());
19282 self
19283 }
19284 pub fn push_end_freq(mut self, value: u32) -> Self {
19285 push_header(self.as_vec_mut(), 4u16, 4 as u16);
19286 self.as_vec_mut().extend(value.to_ne_bytes());
19287 self
19288 }
19289}
19290impl<Prev: Pusher> Drop for PushSarSpecs<Prev> {
19291 fn drop(&mut self) {
19292 if let Some(prev) = &mut self.prev {
19293 if let Some(header_offset) = &self.header_offset {
19294 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19295 }
19296 }
19297 }
19298}
19299pub struct PushSupportedIftypes<Prev: Pusher> {
19300 pub(crate) prev: Option<Prev>,
19301 pub(crate) header_offset: Option<usize>,
19302}
19303impl<Prev: Pusher> Pusher for PushSupportedIftypes<Prev> {
19304 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19305 self.prev.as_mut().unwrap().as_vec_mut()
19306 }
19307 fn as_vec(&self) -> &Vec<u8> {
19308 self.prev.as_ref().unwrap().as_vec()
19309 }
19310}
19311impl<Prev: Pusher> PushSupportedIftypes<Prev> {
19312 pub fn new(prev: Prev) -> Self {
19313 Self {
19314 prev: Some(prev),
19315 header_offset: None,
19316 }
19317 }
19318 pub fn end_nested(mut self) -> Prev {
19319 let mut prev = self.prev.take().unwrap();
19320 if let Some(header_offset) = &self.header_offset {
19321 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19322 }
19323 prev
19324 }
19325 pub fn push_adhoc(mut self, value: ()) -> Self {
19326 push_header(self.as_vec_mut(), 1u16, 0 as u16);
19327 self
19328 }
19329 pub fn push_station(mut self, value: ()) -> Self {
19330 push_header(self.as_vec_mut(), 2u16, 0 as u16);
19331 self
19332 }
19333 pub fn push_ap(mut self, value: ()) -> Self {
19334 push_header(self.as_vec_mut(), 3u16, 0 as u16);
19335 self
19336 }
19337 pub fn push_ap_vlan(mut self, value: ()) -> Self {
19338 push_header(self.as_vec_mut(), 4u16, 0 as u16);
19339 self
19340 }
19341 pub fn push_wds(mut self, value: ()) -> Self {
19342 push_header(self.as_vec_mut(), 5u16, 0 as u16);
19343 self
19344 }
19345 pub fn push_monitor(mut self, value: ()) -> Self {
19346 push_header(self.as_vec_mut(), 6u16, 0 as u16);
19347 self
19348 }
19349 pub fn push_mesh_point(mut self, value: ()) -> Self {
19350 push_header(self.as_vec_mut(), 7u16, 0 as u16);
19351 self
19352 }
19353 pub fn push_p2p_client(mut self, value: ()) -> Self {
19354 push_header(self.as_vec_mut(), 8u16, 0 as u16);
19355 self
19356 }
19357 pub fn push_p2p_go(mut self, value: ()) -> Self {
19358 push_header(self.as_vec_mut(), 9u16, 0 as u16);
19359 self
19360 }
19361 pub fn push_p2p_device(mut self, value: ()) -> Self {
19362 push_header(self.as_vec_mut(), 10u16, 0 as u16);
19363 self
19364 }
19365 pub fn push_ocb(mut self, value: ()) -> Self {
19366 push_header(self.as_vec_mut(), 11u16, 0 as u16);
19367 self
19368 }
19369 pub fn push_nan(mut self, value: ()) -> Self {
19370 push_header(self.as_vec_mut(), 12u16, 0 as u16);
19371 self
19372 }
19373}
19374impl<Prev: Pusher> Drop for PushSupportedIftypes<Prev> {
19375 fn drop(&mut self) {
19376 if let Some(prev) = &mut self.prev {
19377 if let Some(header_offset) = &self.header_offset {
19378 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19379 }
19380 }
19381 }
19382}
19383pub struct PushTxqStatsAttrs<Prev: Pusher> {
19384 pub(crate) prev: Option<Prev>,
19385 pub(crate) header_offset: Option<usize>,
19386}
19387impl<Prev: Pusher> Pusher for PushTxqStatsAttrs<Prev> {
19388 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19389 self.prev.as_mut().unwrap().as_vec_mut()
19390 }
19391 fn as_vec(&self) -> &Vec<u8> {
19392 self.prev.as_ref().unwrap().as_vec()
19393 }
19394}
19395impl<Prev: Pusher> PushTxqStatsAttrs<Prev> {
19396 pub fn new(prev: Prev) -> Self {
19397 Self {
19398 prev: Some(prev),
19399 header_offset: None,
19400 }
19401 }
19402 pub fn end_nested(mut self) -> Prev {
19403 let mut prev = self.prev.take().unwrap();
19404 if let Some(header_offset) = &self.header_offset {
19405 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19406 }
19407 prev
19408 }
19409 pub fn push_backlog_bytes(mut self, value: u32) -> Self {
19410 push_header(self.as_vec_mut(), 1u16, 4 as u16);
19411 self.as_vec_mut().extend(value.to_ne_bytes());
19412 self
19413 }
19414 pub fn push_backlog_packets(mut self, value: u32) -> Self {
19415 push_header(self.as_vec_mut(), 2u16, 4 as u16);
19416 self.as_vec_mut().extend(value.to_ne_bytes());
19417 self
19418 }
19419 pub fn push_flows(mut self, value: u32) -> Self {
19420 push_header(self.as_vec_mut(), 3u16, 4 as u16);
19421 self.as_vec_mut().extend(value.to_ne_bytes());
19422 self
19423 }
19424 pub fn push_drops(mut self, value: u32) -> Self {
19425 push_header(self.as_vec_mut(), 4u16, 4 as u16);
19426 self.as_vec_mut().extend(value.to_ne_bytes());
19427 self
19428 }
19429 pub fn push_ecn_marks(mut self, value: u32) -> Self {
19430 push_header(self.as_vec_mut(), 5u16, 4 as u16);
19431 self.as_vec_mut().extend(value.to_ne_bytes());
19432 self
19433 }
19434 pub fn push_overlimit(mut self, value: u32) -> Self {
19435 push_header(self.as_vec_mut(), 6u16, 4 as u16);
19436 self.as_vec_mut().extend(value.to_ne_bytes());
19437 self
19438 }
19439 pub fn push_overmemory(mut self, value: u32) -> Self {
19440 push_header(self.as_vec_mut(), 7u16, 4 as u16);
19441 self.as_vec_mut().extend(value.to_ne_bytes());
19442 self
19443 }
19444 pub fn push_collisions(mut self, value: u32) -> Self {
19445 push_header(self.as_vec_mut(), 8u16, 4 as u16);
19446 self.as_vec_mut().extend(value.to_ne_bytes());
19447 self
19448 }
19449 pub fn push_tx_bytes(mut self, value: u32) -> Self {
19450 push_header(self.as_vec_mut(), 9u16, 4 as u16);
19451 self.as_vec_mut().extend(value.to_ne_bytes());
19452 self
19453 }
19454 pub fn push_tx_packets(mut self, value: u32) -> Self {
19455 push_header(self.as_vec_mut(), 10u16, 4 as u16);
19456 self.as_vec_mut().extend(value.to_ne_bytes());
19457 self
19458 }
19459 pub fn push_max_flows(mut self, value: u32) -> Self {
19460 push_header(self.as_vec_mut(), 11u16, 4 as u16);
19461 self.as_vec_mut().extend(value.to_ne_bytes());
19462 self
19463 }
19464}
19465impl<Prev: Pusher> Drop for PushTxqStatsAttrs<Prev> {
19466 fn drop(&mut self) {
19467 if let Some(prev) = &mut self.prev {
19468 if let Some(header_offset) = &self.header_offset {
19469 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19470 }
19471 }
19472 }
19473}
19474pub struct PushWmmAttrs<Prev: Pusher> {
19475 pub(crate) prev: Option<Prev>,
19476 pub(crate) header_offset: Option<usize>,
19477}
19478impl<Prev: Pusher> Pusher for PushWmmAttrs<Prev> {
19479 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19480 self.prev.as_mut().unwrap().as_vec_mut()
19481 }
19482 fn as_vec(&self) -> &Vec<u8> {
19483 self.prev.as_ref().unwrap().as_vec()
19484 }
19485}
19486impl<Prev: Pusher> PushWmmAttrs<Prev> {
19487 pub fn new(prev: Prev) -> Self {
19488 Self {
19489 prev: Some(prev),
19490 header_offset: None,
19491 }
19492 }
19493 pub fn end_nested(mut self) -> Prev {
19494 let mut prev = self.prev.take().unwrap();
19495 if let Some(header_offset) = &self.header_offset {
19496 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19497 }
19498 prev
19499 }
19500 pub fn push_cw_min(mut self, value: u16) -> Self {
19501 push_header(self.as_vec_mut(), 1u16, 2 as u16);
19502 self.as_vec_mut().extend(value.to_ne_bytes());
19503 self
19504 }
19505 pub fn push_cw_max(mut self, value: u16) -> Self {
19506 push_header(self.as_vec_mut(), 2u16, 2 as u16);
19507 self.as_vec_mut().extend(value.to_ne_bytes());
19508 self
19509 }
19510 pub fn push_aifsn(mut self, value: u8) -> Self {
19511 push_header(self.as_vec_mut(), 3u16, 1 as u16);
19512 self.as_vec_mut().extend(value.to_ne_bytes());
19513 self
19514 }
19515 pub fn push_txop(mut self, value: u16) -> Self {
19516 push_header(self.as_vec_mut(), 4u16, 2 as u16);
19517 self.as_vec_mut().extend(value.to_ne_bytes());
19518 self
19519 }
19520}
19521impl<Prev: Pusher> Drop for PushWmmAttrs<Prev> {
19522 fn drop(&mut self) {
19523 if let Some(prev) = &mut self.prev {
19524 if let Some(header_offset) = &self.header_offset {
19525 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19526 }
19527 }
19528 }
19529}
19530pub struct PushWowlanTriggersAttrs<Prev: Pusher> {
19531 pub(crate) prev: Option<Prev>,
19532 pub(crate) header_offset: Option<usize>,
19533}
19534impl<Prev: Pusher> Pusher for PushWowlanTriggersAttrs<Prev> {
19535 fn as_vec_mut(&mut self) -> &mut Vec<u8> {
19536 self.prev.as_mut().unwrap().as_vec_mut()
19537 }
19538 fn as_vec(&self) -> &Vec<u8> {
19539 self.prev.as_ref().unwrap().as_vec()
19540 }
19541}
19542impl<Prev: Pusher> PushWowlanTriggersAttrs<Prev> {
19543 pub fn new(prev: Prev) -> Self {
19544 Self {
19545 prev: Some(prev),
19546 header_offset: None,
19547 }
19548 }
19549 pub fn end_nested(mut self) -> Prev {
19550 let mut prev = self.prev.take().unwrap();
19551 if let Some(header_offset) = &self.header_offset {
19552 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19553 }
19554 prev
19555 }
19556 pub fn push_any(mut self, value: ()) -> Self {
19557 push_header(self.as_vec_mut(), 1u16, 0 as u16);
19558 self
19559 }
19560 pub fn push_disconnect(mut self, value: ()) -> Self {
19561 push_header(self.as_vec_mut(), 2u16, 0 as u16);
19562 self
19563 }
19564 pub fn push_magic_pkt(mut self, value: ()) -> Self {
19565 push_header(self.as_vec_mut(), 3u16, 0 as u16);
19566 self
19567 }
19568 pub fn push_pkt_pattern(mut self, value: ()) -> Self {
19569 push_header(self.as_vec_mut(), 4u16, 0 as u16);
19570 self
19571 }
19572 pub fn push_gtk_rekey_supported(mut self, value: ()) -> Self {
19573 push_header(self.as_vec_mut(), 5u16, 0 as u16);
19574 self
19575 }
19576 pub fn push_gtk_rekey_failure(mut self, value: ()) -> Self {
19577 push_header(self.as_vec_mut(), 6u16, 0 as u16);
19578 self
19579 }
19580 pub fn push_eap_ident_request(mut self, value: ()) -> Self {
19581 push_header(self.as_vec_mut(), 7u16, 0 as u16);
19582 self
19583 }
19584 pub fn push_4way_handshake(mut self, value: ()) -> Self {
19585 push_header(self.as_vec_mut(), 8u16, 0 as u16);
19586 self
19587 }
19588 pub fn push_rfkill_release(mut self, value: ()) -> Self {
19589 push_header(self.as_vec_mut(), 9u16, 0 as u16);
19590 self
19591 }
19592 pub fn push_wakeup_pkt_80211(mut self, value: ()) -> Self {
19593 push_header(self.as_vec_mut(), 10u16, 0 as u16);
19594 self
19595 }
19596 pub fn push_wakeup_pkt_80211_len(mut self, value: ()) -> Self {
19597 push_header(self.as_vec_mut(), 11u16, 0 as u16);
19598 self
19599 }
19600 pub fn push_wakeup_pkt_8023(mut self, value: ()) -> Self {
19601 push_header(self.as_vec_mut(), 12u16, 0 as u16);
19602 self
19603 }
19604 pub fn push_wakeup_pkt_8023_len(mut self, value: ()) -> Self {
19605 push_header(self.as_vec_mut(), 13u16, 0 as u16);
19606 self
19607 }
19608 pub fn push_tcp_connection(mut self, value: ()) -> Self {
19609 push_header(self.as_vec_mut(), 14u16, 0 as u16);
19610 self
19611 }
19612 pub fn push_wakeup_tcp_match(mut self, value: ()) -> Self {
19613 push_header(self.as_vec_mut(), 15u16, 0 as u16);
19614 self
19615 }
19616 pub fn push_wakeup_tcp_connlost(mut self, value: ()) -> Self {
19617 push_header(self.as_vec_mut(), 16u16, 0 as u16);
19618 self
19619 }
19620 pub fn push_wakeup_tcp_nomoretokens(mut self, value: ()) -> Self {
19621 push_header(self.as_vec_mut(), 17u16, 0 as u16);
19622 self
19623 }
19624 pub fn push_net_detect(mut self, value: ()) -> Self {
19625 push_header(self.as_vec_mut(), 18u16, 0 as u16);
19626 self
19627 }
19628 pub fn push_net_detect_results(mut self, value: ()) -> Self {
19629 push_header(self.as_vec_mut(), 19u16, 0 as u16);
19630 self
19631 }
19632 pub fn push_unprotected_deauth_disassoc(mut self, value: ()) -> Self {
19633 push_header(self.as_vec_mut(), 20u16, 0 as u16);
19634 self
19635 }
19636}
19637impl<Prev: Pusher> Drop for PushWowlanTriggersAttrs<Prev> {
19638 fn drop(&mut self) {
19639 if let Some(prev) = &mut self.prev {
19640 if let Some(header_offset) = &self.header_offset {
19641 finalize_nested_header(prev.as_vec_mut(), *header_offset);
19642 }
19643 }
19644 }
19645}
19646pub struct NotifGroup;
19647impl NotifGroup {
19648 pub const CONFIG: &str = "config";
19649 pub const CONFIG_CSTR: &CStr = c"config";
19650 pub const SCAN: &str = "scan";
19651 pub const SCAN_CSTR: &CStr = c"scan";
19652 pub const REGULATORY: &str = "regulatory";
19653 pub const REGULATORY_CSTR: &CStr = c"regulatory";
19654 pub const MLME: &str = "mlme";
19655 pub const MLME_CSTR: &CStr = c"mlme";
19656 pub const VENDOR: &str = "vendor";
19657 pub const VENDOR_CSTR: &CStr = c"vendor";
19658 pub const NAN: &str = "nan";
19659 pub const NAN_CSTR: &CStr = c"nan";
19660 pub const TESTMODE: &str = "testmode";
19661 pub const TESTMODE_CSTR: &CStr = c"testmode";
19662}
19663#[doc = "Get information about a wiphy or dump a list of all wiphys. Requests to\ndump get-wiphy should unconditionally include the split-wiphy-dump flag\nin the request.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n- [.push_split_wiphy_dump()](PushNl80211Attrs::push_split_wiphy_dump)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n\n"]
19664#[derive(Debug)]
19665pub struct OpGetWiphyDump<'r> {
19666 request: Request<'r>,
19667}
19668impl<'r> OpGetWiphyDump<'r> {
19669 pub fn new(mut request: Request<'r>) -> Self {
19670 Self::write_header(request.buf_mut());
19671 Self {
19672 request: request.set_dump(),
19673 }
19674 }
19675 pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19676 Self::write_header(buf);
19677 PushNl80211Attrs::new(buf)
19678 }
19679 pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19680 PushNl80211Attrs::new(self.request.buf_mut())
19681 }
19682 pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19683 PushNl80211Attrs::new(self.request.buf)
19684 }
19685 pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19686 let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19687 IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19688 }
19689 fn write_header<Prev: Pusher>(prev: &mut Prev) {
19690 let mut header = BuiltinNfgenmsg::new();
19691 header.cmd = 1u8;
19692 header.version = 1u8;
19693 prev.as_vec_mut().extend(header.as_slice());
19694 }
19695}
19696impl NetlinkRequest for OpGetWiphyDump<'_> {
19697 fn protocol(&self) -> Protocol {
19698 Protocol::Generic("nl80211".as_bytes())
19699 }
19700 fn flags(&self) -> u16 {
19701 self.request.flags
19702 }
19703 fn payload(&self) -> &[u8] {
19704 self.request.buf()
19705 }
19706 type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19707 fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19708 Self::decode_request(buf)
19709 }
19710 fn lookup(
19711 buf: &[u8],
19712 offset: usize,
19713 missing_type: Option<u16>,
19714 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19715 Self::decode_request(buf).lookup_attr(offset, missing_type)
19716 }
19717}
19718#[doc = "Get information about a wiphy or dump a list of all wiphys. Requests to\ndump get-wiphy should unconditionally include the split-wiphy-dump flag\nin the request.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n\n"]
19719#[derive(Debug)]
19720pub struct OpGetWiphyDo<'r> {
19721 request: Request<'r>,
19722}
19723impl<'r> OpGetWiphyDo<'r> {
19724 pub fn new(mut request: Request<'r>) -> Self {
19725 Self::write_header(request.buf_mut());
19726 Self { request: request }
19727 }
19728 pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19729 Self::write_header(buf);
19730 PushNl80211Attrs::new(buf)
19731 }
19732 pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19733 PushNl80211Attrs::new(self.request.buf_mut())
19734 }
19735 pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19736 PushNl80211Attrs::new(self.request.buf)
19737 }
19738 pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19739 let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19740 IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19741 }
19742 fn write_header<Prev: Pusher>(prev: &mut Prev) {
19743 let mut header = BuiltinNfgenmsg::new();
19744 header.cmd = 1u8;
19745 header.version = 1u8;
19746 prev.as_vec_mut().extend(header.as_slice());
19747 }
19748}
19749impl NetlinkRequest for OpGetWiphyDo<'_> {
19750 fn protocol(&self) -> Protocol {
19751 Protocol::Generic("nl80211".as_bytes())
19752 }
19753 fn flags(&self) -> u16 {
19754 self.request.flags
19755 }
19756 fn payload(&self) -> &[u8] {
19757 self.request.buf()
19758 }
19759 type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19760 fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19761 Self::decode_request(buf)
19762 }
19763 fn lookup(
19764 buf: &[u8],
19765 offset: usize,
19766 missing_type: Option<u16>,
19767 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19768 Self::decode_request(buf).lookup_attr(offset, missing_type)
19769 }
19770}
19771#[doc = "Get information about an interface or dump a list of all interfaces\n\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n\n"]
19772#[derive(Debug)]
19773pub struct OpGetInterfaceDump<'r> {
19774 request: Request<'r>,
19775}
19776impl<'r> OpGetInterfaceDump<'r> {
19777 pub fn new(mut request: Request<'r>) -> Self {
19778 Self::write_header(request.buf_mut());
19779 Self {
19780 request: request.set_dump(),
19781 }
19782 }
19783 pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19784 Self::write_header(buf);
19785 PushNl80211Attrs::new(buf)
19786 }
19787 pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19788 PushNl80211Attrs::new(self.request.buf_mut())
19789 }
19790 pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19791 PushNl80211Attrs::new(self.request.buf)
19792 }
19793 pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19794 let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19795 IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19796 }
19797 fn write_header<Prev: Pusher>(prev: &mut Prev) {
19798 let mut header = BuiltinNfgenmsg::new();
19799 header.cmd = 5u8;
19800 header.version = 1u8;
19801 prev.as_vec_mut().extend(header.as_slice());
19802 }
19803}
19804impl NetlinkRequest for OpGetInterfaceDump<'_> {
19805 fn protocol(&self) -> Protocol {
19806 Protocol::Generic("nl80211".as_bytes())
19807 }
19808 fn flags(&self) -> u16 {
19809 self.request.flags
19810 }
19811 fn payload(&self) -> &[u8] {
19812 self.request.buf()
19813 }
19814 type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19815 fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19816 Self::decode_request(buf)
19817 }
19818 fn lookup(
19819 buf: &[u8],
19820 offset: usize,
19821 missing_type: Option<u16>,
19822 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19823 Self::decode_request(buf).lookup_attr(offset, missing_type)
19824 }
19825}
19826#[doc = "Get information about an interface or dump a list of all interfaces\n\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n\n"]
19827#[derive(Debug)]
19828pub struct OpGetInterfaceDo<'r> {
19829 request: Request<'r>,
19830}
19831impl<'r> OpGetInterfaceDo<'r> {
19832 pub fn new(mut request: Request<'r>) -> Self {
19833 Self::write_header(request.buf_mut());
19834 Self { request: request }
19835 }
19836 pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19837 Self::write_header(buf);
19838 PushNl80211Attrs::new(buf)
19839 }
19840 pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19841 PushNl80211Attrs::new(self.request.buf_mut())
19842 }
19843 pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19844 PushNl80211Attrs::new(self.request.buf)
19845 }
19846 pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19847 let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19848 IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19849 }
19850 fn write_header<Prev: Pusher>(prev: &mut Prev) {
19851 let mut header = BuiltinNfgenmsg::new();
19852 header.cmd = 5u8;
19853 header.version = 1u8;
19854 prev.as_vec_mut().extend(header.as_slice());
19855 }
19856}
19857impl NetlinkRequest for OpGetInterfaceDo<'_> {
19858 fn protocol(&self) -> Protocol {
19859 Protocol::Generic("nl80211".as_bytes())
19860 }
19861 fn flags(&self) -> u16 {
19862 self.request.flags
19863 }
19864 fn payload(&self) -> &[u8] {
19865 self.request.buf()
19866 }
19867 type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19868 fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19869 Self::decode_request(buf)
19870 }
19871 fn lookup(
19872 buf: &[u8],
19873 offset: usize,
19874 missing_type: Option<u16>,
19875 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19876 Self::decode_request(buf).lookup_attr(offset, missing_type)
19877 }
19878}
19879#[doc = "Get information about supported protocol features\n\nRequest attributes:\n- [.push_protocol_features()](PushNl80211Attrs::push_protocol_features)\n\nReply attributes:\n- [.get_protocol_features()](IterableNl80211Attrs::get_protocol_features)\n\n"]
19880#[derive(Debug)]
19881pub struct OpGetProtocolFeaturesDo<'r> {
19882 request: Request<'r>,
19883}
19884impl<'r> OpGetProtocolFeaturesDo<'r> {
19885 pub fn new(mut request: Request<'r>) -> Self {
19886 Self::write_header(request.buf_mut());
19887 Self { request: request }
19888 }
19889 pub fn encode_request<'buf>(buf: &'buf mut Vec<u8>) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19890 Self::write_header(buf);
19891 PushNl80211Attrs::new(buf)
19892 }
19893 pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19894 PushNl80211Attrs::new(self.request.buf_mut())
19895 }
19896 pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19897 PushNl80211Attrs::new(self.request.buf)
19898 }
19899 pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19900 let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19901 IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19902 }
19903 fn write_header<Prev: Pusher>(prev: &mut Prev) {
19904 let mut header = BuiltinNfgenmsg::new();
19905 header.cmd = 95u8;
19906 header.version = 1u8;
19907 prev.as_vec_mut().extend(header.as_slice());
19908 }
19909}
19910impl NetlinkRequest for OpGetProtocolFeaturesDo<'_> {
19911 fn protocol(&self) -> Protocol {
19912 Protocol::Generic("nl80211".as_bytes())
19913 }
19914 fn flags(&self) -> u16 {
19915 self.request.flags
19916 }
19917 fn payload(&self) -> &[u8] {
19918 self.request.buf()
19919 }
19920 type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19921 fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19922 Self::decode_request(buf)
19923 }
19924 fn lookup(
19925 buf: &[u8],
19926 offset: usize,
19927 missing_type: Option<u16>,
19928 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19929 Self::decode_request(buf).lookup_attr(offset, missing_type)
19930 }
19931}
19932#[doc = ""]
19933#[derive(Debug)]
19934pub struct OpDump<'r> {
19935 request: Request<'r>,
19936}
19937impl<'r> OpDump<'r> {
19938 pub fn new(mut request: Request<'r>, request_type: u8) -> Self {
19939 Self::write_header(request.buf_mut(), request_type);
19940 Self {
19941 request: request.set_dump(),
19942 }
19943 }
19944 pub fn encode_request<'buf>(
19945 buf: &'buf mut Vec<u8>,
19946 request_type: u8,
19947 ) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
19948 Self::write_header(buf, request_type);
19949 PushNl80211Attrs::new(buf)
19950 }
19951 pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
19952 PushNl80211Attrs::new(self.request.buf_mut())
19953 }
19954 pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
19955 PushNl80211Attrs::new(self.request.buf)
19956 }
19957 pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
19958 let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
19959 IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
19960 }
19961 fn write_header<Prev: Pusher>(prev: &mut Prev, request_type: u8) {
19962 let mut header = BuiltinNfgenmsg::new();
19963 header.cmd = request_type;
19964 header.version = 1u8;
19965 prev.as_vec_mut().extend(header.as_slice());
19966 }
19967}
19968impl NetlinkRequest for OpDump<'_> {
19969 fn protocol(&self) -> Protocol {
19970 Protocol::Generic("nl80211".as_bytes())
19971 }
19972 fn flags(&self) -> u16 {
19973 self.request.flags
19974 }
19975 fn payload(&self) -> &[u8] {
19976 self.request.buf()
19977 }
19978 type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
19979 fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
19980 Self::decode_request(buf)
19981 }
19982 fn lookup(
19983 buf: &[u8],
19984 offset: usize,
19985 missing_type: Option<u16>,
19986 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
19987 Self::decode_request(buf).lookup_attr(offset, missing_type)
19988 }
19989}
19990#[doc = ""]
19991#[derive(Debug)]
19992pub struct OpDo<'r> {
19993 request: Request<'r>,
19994}
19995impl<'r> OpDo<'r> {
19996 pub fn new(mut request: Request<'r>, request_type: u8) -> Self {
19997 Self::write_header(request.buf_mut(), request_type);
19998 Self { request: request }
19999 }
20000 pub fn encode_request<'buf>(
20001 buf: &'buf mut Vec<u8>,
20002 request_type: u8,
20003 ) -> PushNl80211Attrs<&'buf mut Vec<u8>> {
20004 Self::write_header(buf, request_type);
20005 PushNl80211Attrs::new(buf)
20006 }
20007 pub fn encode(&mut self) -> PushNl80211Attrs<&mut Vec<u8>> {
20008 PushNl80211Attrs::new(self.request.buf_mut())
20009 }
20010 pub fn into_encoder(self) -> PushNl80211Attrs<RequestBuf<'r>> {
20011 PushNl80211Attrs::new(self.request.buf)
20012 }
20013 pub fn decode_request<'a>(buf: &'a [u8]) -> IterableNl80211Attrs<'a> {
20014 let (_header, attrs) = buf.split_at(buf.len().min(BuiltinNfgenmsg::len()));
20015 IterableNl80211Attrs::with_loc(attrs, buf.as_ptr() as usize)
20016 }
20017 fn write_header<Prev: Pusher>(prev: &mut Prev, request_type: u8) {
20018 let mut header = BuiltinNfgenmsg::new();
20019 header.cmd = request_type;
20020 header.version = 1u8;
20021 prev.as_vec_mut().extend(header.as_slice());
20022 }
20023}
20024impl NetlinkRequest for OpDo<'_> {
20025 fn protocol(&self) -> Protocol {
20026 Protocol::Generic("nl80211".as_bytes())
20027 }
20028 fn flags(&self) -> u16 {
20029 self.request.flags
20030 }
20031 fn payload(&self) -> &[u8] {
20032 self.request.buf()
20033 }
20034 type ReplyType<'buf> = IterableNl80211Attrs<'buf>;
20035 fn decode_reply<'buf>(buf: &'buf [u8]) -> Self::ReplyType<'buf> {
20036 Self::decode_request(buf)
20037 }
20038 fn lookup(
20039 buf: &[u8],
20040 offset: usize,
20041 missing_type: Option<u16>,
20042 ) -> (Vec<(&'static str, usize)>, Option<&'static str>) {
20043 Self::decode_request(buf).lookup_attr(offset, missing_type)
20044 }
20045}
20046use crate::traits::LookupFn;
20047use crate::utils::RequestBuf;
20048#[derive(Debug)]
20049pub struct Request<'buf> {
20050 buf: RequestBuf<'buf>,
20051 flags: u16,
20052 writeback: Option<&'buf mut Option<RequestInfo>>,
20053}
20054#[allow(unused)]
20055#[derive(Debug, Clone)]
20056pub struct RequestInfo {
20057 protocol: Protocol,
20058 flags: u16,
20059 name: &'static str,
20060 lookup: LookupFn,
20061}
20062impl Request<'static> {
20063 pub fn new() -> Self {
20064 Self::new_from_buf(Vec::new())
20065 }
20066 pub fn new_from_buf(buf: Vec<u8>) -> Self {
20067 Self {
20068 flags: 0,
20069 buf: RequestBuf::Own(buf),
20070 writeback: None,
20071 }
20072 }
20073 pub fn into_buf(self) -> Vec<u8> {
20074 match self.buf {
20075 RequestBuf::Own(buf) => buf,
20076 _ => unreachable!(),
20077 }
20078 }
20079}
20080impl<'buf> Request<'buf> {
20081 pub fn new_with_buf(buf: &'buf mut Vec<u8>) -> Self {
20082 buf.clear();
20083 Self::new_extend(buf)
20084 }
20085 pub fn new_extend(buf: &'buf mut Vec<u8>) -> Self {
20086 Self {
20087 flags: 0,
20088 buf: RequestBuf::Ref(buf),
20089 writeback: None,
20090 }
20091 }
20092 fn do_writeback(&mut self, protocol: Protocol, name: &'static str, lookup: LookupFn) {
20093 let Some(writeback) = &mut self.writeback else {
20094 return;
20095 };
20096 **writeback = Some(RequestInfo {
20097 protocol,
20098 flags: self.flags,
20099 name,
20100 lookup,
20101 })
20102 }
20103 pub fn buf(&self) -> &Vec<u8> {
20104 self.buf.buf()
20105 }
20106 pub fn buf_mut(&mut self) -> &mut Vec<u8> {
20107 self.buf.buf_mut()
20108 }
20109 #[doc = "Set `NLM_F_CREATE` flag"]
20110 pub fn set_create(mut self) -> Self {
20111 self.flags |= consts::NLM_F_CREATE as u16;
20112 self
20113 }
20114 #[doc = "Set `NLM_F_EXCL` flag"]
20115 pub fn set_excl(mut self) -> Self {
20116 self.flags |= consts::NLM_F_EXCL as u16;
20117 self
20118 }
20119 #[doc = "Set `NLM_F_REPLACE` flag"]
20120 pub fn set_replace(mut self) -> Self {
20121 self.flags |= consts::NLM_F_REPLACE as u16;
20122 self
20123 }
20124 #[doc = "Set `NLM_F_CREATE` and `NLM_F_REPLACE` flag"]
20125 pub fn set_change(self) -> Self {
20126 self.set_create().set_replace()
20127 }
20128 #[doc = "Set `NLM_F_APPEND` flag"]
20129 pub fn set_append(mut self) -> Self {
20130 self.flags |= consts::NLM_F_APPEND as u16;
20131 self
20132 }
20133 #[doc = "Set `self.flags |= flags`"]
20134 pub fn set_flags(mut self, flags: u16) -> Self {
20135 self.flags |= flags;
20136 self
20137 }
20138 #[doc = "Set `self.flags ^= self.flags & flags`"]
20139 pub fn unset_flags(mut self, flags: u16) -> Self {
20140 self.flags ^= self.flags & flags;
20141 self
20142 }
20143 #[doc = "Set `NLM_F_DUMP` flag"]
20144 fn set_dump(mut self) -> Self {
20145 self.flags |= consts::NLM_F_DUMP as u16;
20146 self
20147 }
20148 #[doc = "Get information about a wiphy or dump a list of all wiphys. Requests to\ndump get-wiphy should unconditionally include the split-wiphy-dump flag\nin the request.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n- [.push_split_wiphy_dump()](PushNl80211Attrs::push_split_wiphy_dump)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n\n"]
20149 pub fn op_get_wiphy_dump(self) -> OpGetWiphyDump<'buf> {
20150 let mut res = OpGetWiphyDump::new(self);
20151 res.request
20152 .do_writeback(res.protocol(), "op-get-wiphy-dump", OpGetWiphyDump::lookup);
20153 res
20154 }
20155 #[doc = "Get information about a wiphy or dump a list of all wiphys. Requests to\ndump get-wiphy should unconditionally include the split-wiphy-dump flag\nin the request.\n\nRequest attributes:\n- [.push_wiphy()](PushNl80211Attrs::push_wiphy)\n- [.push_ifindex()](PushNl80211Attrs::push_ifindex)\n- [.push_wdev()](PushNl80211Attrs::push_wdev)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_wiphy_name()](IterableNl80211Attrs::get_wiphy_name)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_wiphy_bands()](IterableNl80211Attrs::get_wiphy_bands)\n- [.get_supported_iftypes()](IterableNl80211Attrs::get_supported_iftypes)\n- [.get_max_num_scan_ssids()](IterableNl80211Attrs::get_max_num_scan_ssids)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_supported_commands()](IterableNl80211Attrs::get_supported_commands)\n- [.get_max_scan_ie_len()](IterableNl80211Attrs::get_max_scan_ie_len)\n- [.get_cipher_suites()](IterableNl80211Attrs::get_cipher_suites)\n- [.get_wiphy_retry_short()](IterableNl80211Attrs::get_wiphy_retry_short)\n- [.get_wiphy_retry_long()](IterableNl80211Attrs::get_wiphy_retry_long)\n- [.get_wiphy_frag_threshold()](IterableNl80211Attrs::get_wiphy_frag_threshold)\n- [.get_wiphy_rts_threshold()](IterableNl80211Attrs::get_wiphy_rts_threshold)\n- [.get_max_num_pmkids()](IterableNl80211Attrs::get_max_num_pmkids)\n- [.get_wiphy_coverage_class()](IterableNl80211Attrs::get_wiphy_coverage_class)\n- [.get_tx_frame_types()](IterableNl80211Attrs::get_tx_frame_types)\n- [.get_rx_frame_types()](IterableNl80211Attrs::get_rx_frame_types)\n- [.get_control_port_ethertype()](IterableNl80211Attrs::get_control_port_ethertype)\n- [.get_wiphy_antenna_tx()](IterableNl80211Attrs::get_wiphy_antenna_tx)\n- [.get_wiphy_antenna_rx()](IterableNl80211Attrs::get_wiphy_antenna_rx)\n- [.get_offchannel_tx_ok()](IterableNl80211Attrs::get_offchannel_tx_ok)\n- [.get_max_remain_on_channel_duration()](IterableNl80211Attrs::get_max_remain_on_channel_duration)\n- [.get_wiphy_antenna_avail_tx()](IterableNl80211Attrs::get_wiphy_antenna_avail_tx)\n- [.get_wiphy_antenna_avail_rx()](IterableNl80211Attrs::get_wiphy_antenna_avail_rx)\n- [.get_wowlan_triggers_supported()](IterableNl80211Attrs::get_wowlan_triggers_supported)\n- [.get_interface_combinations()](IterableNl80211Attrs::get_interface_combinations)\n- [.get_software_iftypes()](IterableNl80211Attrs::get_software_iftypes)\n- [.get_max_num_sched_scan_ssids()](IterableNl80211Attrs::get_max_num_sched_scan_ssids)\n- [.get_max_sched_scan_ie_len()](IterableNl80211Attrs::get_max_sched_scan_ie_len)\n- [.get_support_ap_uapsd()](IterableNl80211Attrs::get_support_ap_uapsd)\n- [.get_max_match_sets()](IterableNl80211Attrs::get_max_match_sets)\n- [.get_tdls_support()](IterableNl80211Attrs::get_tdls_support)\n- [.get_tdls_external_setup()](IterableNl80211Attrs::get_tdls_external_setup)\n- [.get_feature_flags()](IterableNl80211Attrs::get_feature_flags)\n- [.get_ht_capability_mask()](IterableNl80211Attrs::get_ht_capability_mask)\n- [.get_ext_capa()](IterableNl80211Attrs::get_ext_capa)\n- [.get_ext_capa_mask()](IterableNl80211Attrs::get_ext_capa_mask)\n- [.get_vht_capability_mask()](IterableNl80211Attrs::get_vht_capability_mask)\n- [.get_max_csa_counters()](IterableNl80211Attrs::get_max_csa_counters)\n- [.get_ext_features()](IterableNl80211Attrs::get_ext_features)\n- [.get_max_num_sched_scan_plans()](IterableNl80211Attrs::get_max_num_sched_scan_plans)\n- [.get_max_scan_plan_interval()](IterableNl80211Attrs::get_max_scan_plan_interval)\n- [.get_max_scan_plan_iterations()](IterableNl80211Attrs::get_max_scan_plan_iterations)\n- [.get_bands()](IterableNl80211Attrs::get_bands)\n- [.get_sched_scan_max_reqs()](IterableNl80211Attrs::get_sched_scan_max_reqs)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n- [.get_txq_limit()](IterableNl80211Attrs::get_txq_limit)\n- [.get_txq_memory_limit()](IterableNl80211Attrs::get_txq_memory_limit)\n- [.get_txq_quantum()](IterableNl80211Attrs::get_txq_quantum)\n- [.get_sar_spec()](IterableNl80211Attrs::get_sar_spec)\n- [.get_max_num_akm_suites()](IterableNl80211Attrs::get_max_num_akm_suites)\n\n"]
20156 pub fn op_get_wiphy_do(self) -> OpGetWiphyDo<'buf> {
20157 let mut res = OpGetWiphyDo::new(self);
20158 res.request
20159 .do_writeback(res.protocol(), "op-get-wiphy-do", OpGetWiphyDo::lookup);
20160 res
20161 }
20162 #[doc = "Get information about an interface or dump a list of all interfaces\n\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n\n"]
20163 pub fn op_get_interface_dump(self) -> OpGetInterfaceDump<'buf> {
20164 let mut res = OpGetInterfaceDump::new(self);
20165 res.request.do_writeback(
20166 res.protocol(),
20167 "op-get-interface-dump",
20168 OpGetInterfaceDump::lookup,
20169 );
20170 res
20171 }
20172 #[doc = "Get information about an interface or dump a list of all interfaces\n\nRequest attributes:\n- [.push_ifname()](PushNl80211Attrs::push_ifname)\n\nReply attributes:\n- [.get_wiphy()](IterableNl80211Attrs::get_wiphy)\n- [.get_ifindex()](IterableNl80211Attrs::get_ifindex)\n- [.get_ifname()](IterableNl80211Attrs::get_ifname)\n- [.get_iftype()](IterableNl80211Attrs::get_iftype)\n- [.get_mac()](IterableNl80211Attrs::get_mac)\n- [.get_generation()](IterableNl80211Attrs::get_generation)\n- [.get_4addr()](IterableNl80211Attrs::get_4addr)\n- [.get_wdev()](IterableNl80211Attrs::get_wdev)\n- [.get_txq_stats()](IterableNl80211Attrs::get_txq_stats)\n\n"]
20173 pub fn op_get_interface_do(self) -> OpGetInterfaceDo<'buf> {
20174 let mut res = OpGetInterfaceDo::new(self);
20175 res.request.do_writeback(
20176 res.protocol(),
20177 "op-get-interface-do",
20178 OpGetInterfaceDo::lookup,
20179 );
20180 res
20181 }
20182 #[doc = "Get information about supported protocol features\n\nRequest attributes:\n- [.push_protocol_features()](PushNl80211Attrs::push_protocol_features)\n\nReply attributes:\n- [.get_protocol_features()](IterableNl80211Attrs::get_protocol_features)\n\n"]
20183 pub fn op_get_protocol_features_do(self) -> OpGetProtocolFeaturesDo<'buf> {
20184 let mut res = OpGetProtocolFeaturesDo::new(self);
20185 res.request.do_writeback(
20186 res.protocol(),
20187 "op-get-protocol-features-do",
20188 OpGetProtocolFeaturesDo::lookup,
20189 );
20190 res
20191 }
20192 #[doc = ""]
20193 pub fn op_dump(self, request_type: u8) -> OpDump<'buf> {
20194 let mut res = OpDump::new(self, request_type);
20195 res.request
20196 .do_writeback(res.protocol(), "op-dump", OpDump::lookup);
20197 res
20198 }
20199 #[doc = ""]
20200 pub fn op_do(self, request_type: u8) -> OpDo<'buf> {
20201 let mut res = OpDo::new(self, request_type);
20202 res.request
20203 .do_writeback(res.protocol(), "op-do", OpDo::lookup);
20204 res
20205 }
20206}
20207#[cfg(test)]
20208mod generated_tests {
20209 use super::*;
20210 #[test]
20211 fn tests() {
20212 let _ = IterableNl80211Attrs::get_4addr;
20213 let _ = IterableNl80211Attrs::get_bands;
20214 let _ = IterableNl80211Attrs::get_cipher_suites;
20215 let _ = IterableNl80211Attrs::get_control_port_ethertype;
20216 let _ = IterableNl80211Attrs::get_ext_capa;
20217 let _ = IterableNl80211Attrs::get_ext_capa_mask;
20218 let _ = IterableNl80211Attrs::get_ext_features;
20219 let _ = IterableNl80211Attrs::get_feature_flags;
20220 let _ = IterableNl80211Attrs::get_generation;
20221 let _ = IterableNl80211Attrs::get_ht_capability_mask;
20222 let _ = IterableNl80211Attrs::get_ifindex;
20223 let _ = IterableNl80211Attrs::get_ifname;
20224 let _ = IterableNl80211Attrs::get_iftype;
20225 let _ = IterableNl80211Attrs::get_interface_combinations;
20226 let _ = IterableNl80211Attrs::get_mac;
20227 let _ = IterableNl80211Attrs::get_max_csa_counters;
20228 let _ = IterableNl80211Attrs::get_max_match_sets;
20229 let _ = IterableNl80211Attrs::get_max_num_akm_suites;
20230 let _ = IterableNl80211Attrs::get_max_num_pmkids;
20231 let _ = IterableNl80211Attrs::get_max_num_scan_ssids;
20232 let _ = IterableNl80211Attrs::get_max_num_sched_scan_plans;
20233 let _ = IterableNl80211Attrs::get_max_num_sched_scan_ssids;
20234 let _ = IterableNl80211Attrs::get_max_remain_on_channel_duration;
20235 let _ = IterableNl80211Attrs::get_max_scan_ie_len;
20236 let _ = IterableNl80211Attrs::get_max_scan_plan_interval;
20237 let _ = IterableNl80211Attrs::get_max_scan_plan_iterations;
20238 let _ = IterableNl80211Attrs::get_max_sched_scan_ie_len;
20239 let _ = IterableNl80211Attrs::get_offchannel_tx_ok;
20240 let _ = IterableNl80211Attrs::get_protocol_features;
20241 let _ = IterableNl80211Attrs::get_rx_frame_types;
20242 let _ = IterableNl80211Attrs::get_sar_spec;
20243 let _ = IterableNl80211Attrs::get_sched_scan_max_reqs;
20244 let _ = IterableNl80211Attrs::get_software_iftypes;
20245 let _ = IterableNl80211Attrs::get_support_ap_uapsd;
20246 let _ = IterableNl80211Attrs::get_supported_commands;
20247 let _ = IterableNl80211Attrs::get_supported_iftypes;
20248 let _ = IterableNl80211Attrs::get_tdls_external_setup;
20249 let _ = IterableNl80211Attrs::get_tdls_support;
20250 let _ = IterableNl80211Attrs::get_tx_frame_types;
20251 let _ = IterableNl80211Attrs::get_txq_limit;
20252 let _ = IterableNl80211Attrs::get_txq_memory_limit;
20253 let _ = IterableNl80211Attrs::get_txq_quantum;
20254 let _ = IterableNl80211Attrs::get_txq_stats;
20255 let _ = IterableNl80211Attrs::get_vht_capability_mask;
20256 let _ = IterableNl80211Attrs::get_wdev;
20257 let _ = IterableNl80211Attrs::get_wiphy;
20258 let _ = IterableNl80211Attrs::get_wiphy_antenna_avail_rx;
20259 let _ = IterableNl80211Attrs::get_wiphy_antenna_avail_tx;
20260 let _ = IterableNl80211Attrs::get_wiphy_antenna_rx;
20261 let _ = IterableNl80211Attrs::get_wiphy_antenna_tx;
20262 let _ = IterableNl80211Attrs::get_wiphy_bands;
20263 let _ = IterableNl80211Attrs::get_wiphy_coverage_class;
20264 let _ = IterableNl80211Attrs::get_wiphy_frag_threshold;
20265 let _ = IterableNl80211Attrs::get_wiphy_name;
20266 let _ = IterableNl80211Attrs::get_wiphy_retry_long;
20267 let _ = IterableNl80211Attrs::get_wiphy_retry_short;
20268 let _ = IterableNl80211Attrs::get_wiphy_rts_threshold;
20269 let _ = IterableNl80211Attrs::get_wowlan_triggers_supported;
20270 let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_ifindex;
20271 let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_ifname;
20272 let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_protocol_features;
20273 let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_split_wiphy_dump;
20274 let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_wdev;
20275 let _ = PushNl80211Attrs::<&mut Vec<u8>>::push_wiphy;
20276 }
20277}