#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum DSStatus {
NotLeavingDSOrADHOC,
FromDSToSTA,
FromSTAToDS,
WDSOrMesh,
}
impl DSStatus {
#[must_use]
pub fn from_bools(from_ds: bool, to_ds: bool) -> Self {
match (from_ds, to_ds) {
(false, false) => Self::NotLeavingDSOrADHOC,
(false, true) => Self::FromSTAToDS,
(true, false) => Self::FromDSToSTA,
(true, true) => Self::WDSOrMesh,
}
}
#[must_use]
pub fn to_bools(self) -> (bool, bool) {
match self {
Self::NotLeavingDSOrADHOC => (false, false),
Self::FromSTAToDS => (false, true),
Self::FromDSToSTA => (true, false),
Self::WDSOrMesh => (true, true),
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum DurationID {
Duration(u16),
AssociationID(u16),
Reserved(u16),
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum FrameVersion {
Standard, Reserved(u8),
}
impl FrameVersion {
#[must_use]
pub fn from_u8(n: u8) -> Self {
match n {
0 => Self::Standard,
other => Self::Reserved(other),
}
}
#[must_use]
pub fn into_u8(self) -> u8 {
match self {
Self::Standard => 0,
Self::Reserved(other) => other,
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum FrameType {
Management,
Control,
Data,
Reserved(u8),
}
impl FrameType {
#[must_use]
pub fn from_u8(n: u8) -> Self {
match n {
0 => Self::Management,
1 => Self::Control,
2 => Self::Data,
other => Self::Reserved(other),
}
}
#[must_use]
pub fn into_u8(self) -> u8 {
match self {
Self::Management => 0,
Self::Control => 1,
Self::Data => 2,
Self::Reserved(other) => other,
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum FrameSubtype {
Management(ManagementSubtype),
Control(ControlSubtype),
Data(DataSubtype),
Reserved(u8, u8),
}
impl FrameSubtype {
#[must_use]
pub fn from_u8(type_: FrameType, subtype: u8) -> Self {
match type_ {
FrameType::Management => Self::Management(ManagementSubtype::from_u8(subtype)),
FrameType::Control => Self::Control(ControlSubtype::from_u8(subtype)),
FrameType::Data => Self::Data(DataSubtype::from_u8(subtype)),
FrameType::Reserved(type_) => Self::Reserved(type_, subtype),
}
}
#[must_use]
pub fn into_u8(self) -> u8 {
match self {
Self::Management(subtype) => subtype.into_u8(),
Self::Control(subtype) => subtype.into_u8(),
Self::Data(subtype) => subtype.into_u8(),
Self::Reserved(_type, subtype) => subtype,
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ManagementSubtype {
AssociationRequest, AssociationResponse, ReassociationRequest, ReassociationResponse, ProbeRequest, ProbeResponse, Reserved(u8), Beacon, ATIM, Disassociate, Authentication, Deauthentication, Action, ActionNoAck, }
impl ManagementSubtype {
#[must_use]
pub fn from_u8(n: u8) -> Self {
match n {
0 => Self::AssociationRequest,
1 => Self::AssociationResponse,
2 => Self::ReassociationRequest,
3 => Self::ReassociationResponse,
4 => Self::ProbeRequest,
5 => Self::ProbeResponse,
8 => Self::Beacon,
9 => Self::ATIM,
10 => Self::Disassociate,
11 => Self::Authentication,
12 => Self::Deauthentication,
13 => Self::Action,
14 => Self::ActionNoAck,
other => Self::Reserved(other),
}
}
#[must_use]
pub fn into_u8(self) -> u8 {
match self {
Self::AssociationRequest => 0,
Self::AssociationResponse => 1,
Self::ReassociationRequest => 2,
Self::ReassociationResponse => 3,
Self::ProbeRequest => 4,
Self::ProbeResponse => 5,
Self::Beacon => 8,
Self::ATIM => 9,
Self::Disassociate => 10,
Self::Authentication => 11,
Self::Deauthentication => 12,
Self::Action => 13,
Self::ActionNoAck => 14,
Self::Reserved(other) => other,
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ControlSubtype {
Reserved(u8), ControlWrapper, BlockAckRequest, BlockAck, PSPoll, RTS, CTS, Ack, CFEnd, CFEndCFAck, }
impl ControlSubtype {
#[must_use]
pub fn from_u8(n: u8) -> Self {
match n {
7 => Self::ControlWrapper,
8 => Self::BlockAckRequest,
9 => Self::BlockAck,
10 => Self::PSPoll,
11 => Self::RTS,
12 => Self::CTS,
13 => Self::Ack,
14 => Self::CFEnd,
15 => Self::CFEndCFAck,
other => Self::Reserved(other),
}
}
#[must_use]
pub fn into_u8(self) -> u8 {
match self {
Self::ControlWrapper => 7,
Self::BlockAckRequest => 8,
Self::BlockAck => 9,
Self::PSPoll => 10,
Self::RTS => 11,
Self::CTS => 12,
Self::Ack => 13,
Self::CFEnd => 14,
Self::CFEndCFAck => 15,
Self::Reserved(other) => other,
}
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum DataSubtype {
Data, DataCFAck, DataCFPoll, DataCFAckCFPoll, Null, CFAck, CFPoll, CFAckCFPoll, QoSData, QoSDataCFAck, QoSDataCFPoll, QoSDataCFAckCFPoll, QoSNull, Reserved(u8), QoSCFPoll, QoSCFAck, }
impl DataSubtype {
#[must_use]
pub fn from_u8(n: u8) -> Self {
match n {
0 => Self::Data,
1 => Self::DataCFAck,
2 => Self::DataCFPoll,
3 => Self::DataCFAckCFPoll,
4 => Self::Null,
5 => Self::CFAck,
6 => Self::CFPoll,
7 => Self::CFAckCFPoll,
8 => Self::QoSData,
9 => Self::QoSDataCFAck,
10 => Self::QoSDataCFPoll,
11 => Self::QoSDataCFAckCFPoll,
12 => Self::QoSNull,
14 => Self::QoSCFPoll,
15 => Self::QoSCFAck,
other => Self::Reserved(other),
}
}
#[must_use]
pub fn into_u8(self) -> u8 {
match self {
Self::Data => 0,
Self::DataCFAck => 1,
Self::DataCFPoll => 2,
Self::DataCFAckCFPoll => 3,
Self::Null => 4,
Self::CFAck => 5,
Self::CFPoll => 6,
Self::CFAckCFPoll => 7,
Self::QoSData => 8,
Self::QoSDataCFAck => 9,
Self::QoSDataCFPoll => 10,
Self::QoSDataCFAckCFPoll => 11,
Self::QoSNull => 12,
Self::QoSCFPoll => 14,
Self::QoSCFAck => 15,
Self::Reserved(other) => other,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StatusCode {
Successful,
UnspecifiedFailure,
TDLSWakeupScheduleRejectedButAlternativeScheduleProvided,
TDLSWakeupScheduleRejected,
SecurityDisabled,
UnacceptableLifetime,
NotInSameBSS,
CannotSupportAllRequestedCapabilities,
ReassociationDenied,
AssociationDenied,
STADoesNotSupportTheSpecifiedAuthenticationAlgorithm,
ReceivedBadAuthenticationFrame,
AuthenticationRejectedBecauseOfChallengeFailure,
AuthenticationRejectedDueToTimeoutWaitingForNextFrameInSequence,
AssociationDeniedBecauseAPIsUnableToHandleAdditionalAssociatedSTAs,
AssociationDeniedDataRates,
AssociationDeniedShortPreamble,
AssociationDeniedPBCCModulation,
AssociationDeniedChannelAgility,
AssociationRequestRejectedSpectrumManagement,
AssociationRequestRejectedPowerCapability,
AssociationRequestRejectedSupportedChannels,
AssociationDeniedDueToRequestingSTANotSupportingTheShortSlotTimeOption,
AssociationDeniedDueToRequestingSTANotSupportingTheDSSSOFDMOption,
ReservedAssociationDeniedBecauseTheRequestingSTADoesNotSupportHTFeatures,
R0KHUnreachable,
AssociationDeniedPhasedCoexistence,
AssociationRequestRejectedTemporarily,
RobustManagementFramePolicyViolation,
UnspecifiedQoSRelatedFailure,
AssociationDeniedBecauseInsufficientBandwidth,
AssociationDeniedExcessiveFrameLoss,
AssociationWithQoSBSSDenied,
TheRequestHasBeenDeclined,
TheRequestHasNotBeenSuccessfulAsOneOrMoreParametersHaveInvalidValues,
TheAllocationOrTSHasNotBeenCreated,
InvalidInformationElement,
InvalidGroupCipher,
InvalidPairwiseCipher,
InvalidAKMP,
UnsupportedRSNInformationElementVersion,
InvalidRSNInformationElementCapabilities,
CipherSuiteRejectedBecauseOfSecurityPolicy,
TheTSPerAllocationHasNotBeenCreated,
DirectLinkIsNotAllowedInTheBSSByPolicy,
TheDestinationSTAIsNotPresentWithinThisBSS,
TheDestinationSTAIsNotAQoSSTA,
AssociationDeniedBecauseTheListenIntervalIsTooLarge,
InvalidFTActionFrameCount,
InvalidPairwiseMasterKeyIdentifier,
InvalidMDIE,
InvalidFTIE,
RequestedTCLASProcessingIsNotSupportedByThePCPOrAP,
ThePCPOrAPHasInsufficientTCLASProcessingResourcesToSatisfyTheRequest,
TheTSHasNotBeenCreatedBecauseTheRequestCannotBeHonored,
GASAdvertisementProtocolNotSupported,
NoOutstandingGASRequest,
GASResponseNotReceivedFromTheAdvertisementServer,
STATimedOutWaitingForGASQueryResponse,
GASResponseIsLargerThanQueryResponseLengthLimit,
RequestRefusedBecauseHomeNetworkDoesNotSupportRequest,
AdvertisementServerInTheNetworkIsNotCurrentlyReachable,
RequestRefusedDueToPermissionsReceivedViaSSPNInterface,
RequestRefusedBecausePCPOrAPDoesNotSupportUnauthenticatedAccess,
InvalidContentsOfRSNIE,
UAPSDCoexistenceIsNotSupported,
RequestedUAPSDCoexistenceModeIsNotSupported,
RequestedIntervalDurationValueCannotBeSupportedWithUAPSDCoexistence,
AuthenticationIsRejectedBecauseAnAntiCloggingTokenIsRequired,
AuthenticationIsRejectedBecauseTheOfferedFiniteCyclicGroupIsNotSupported,
TheTBTTAdjustmentRequestHasNotBeenSuccessful,
TransmissionFailure,
RequestedTCLASNotSupported,
TCLASResourcesExhausted,
RejectedWithSuggestedBSSTransition,
RejectWithRecommendedSchedule,
RejectBecauseNoWakeupScheduleSpecified,
SuccessTheDestinationSTAIsInPowerSaveMode,
FSTPendingInProcessOfAdmittingFSTSession,
PerformingFSTNow,
FSTPendingGapInBlockAckWindow,
RejectBecauseOfUPIDSetting,
AssociationRefusedForSomeExternalReason,
AssociationRefusedBecauseOfMemoryLimitsAtTheAP,
AssociationRefusedBecauseEmergencyServicesAreNotSupportedAtTheAP,
GASQueryResponseNotYetReceived,
RejectDSEProcedures,
TheAssociationHasBeenDenied,
TheRequestFailedDueToAReservationConflict,
TheRequestFailedDueToExceededMAFLimit,
TheRequestFailedDueToExceededMCCATrackLimit,
AssociationDeniedBecauseSpectrumManagement,
AssociationDeniedBecauseTheRequestingSTADoesNotSupportVHTFeatures,
EnablementDenied,
EnablementDeniedDueToRestrictionFromAnAuthorizedGDB,
AuthorizationDeenabled,
AuthenticationRejectedDueToFILSAuthenticationFailure,
AuthenticationRejectedDueToUnknownAuthenticationServer,
Reserved(u16),
}
impl StatusCode {
#[allow(clippy::too_many_lines)]
#[must_use]
pub fn from_u16(n: u16) -> Self {
match n {
0 => Self::Successful,
1 => Self::UnspecifiedFailure,
2 => Self::TDLSWakeupScheduleRejectedButAlternativeScheduleProvided,
3 => Self::TDLSWakeupScheduleRejected,
5 => Self::SecurityDisabled,
6 => Self::UnacceptableLifetime,
7 => Self::NotInSameBSS,
10 => Self::CannotSupportAllRequestedCapabilities,
11 => Self::ReassociationDenied,
12 => Self::AssociationDenied,
13 => Self::STADoesNotSupportTheSpecifiedAuthenticationAlgorithm,
14 => Self::ReceivedBadAuthenticationFrame,
15 => Self::AuthenticationRejectedBecauseOfChallengeFailure,
16 => Self::AuthenticationRejectedDueToTimeoutWaitingForNextFrameInSequence,
17 => Self::AssociationDeniedBecauseAPIsUnableToHandleAdditionalAssociatedSTAs,
18 => Self::AssociationDeniedDataRates,
19 => Self::AssociationDeniedShortPreamble,
20 => Self::AssociationDeniedPBCCModulation,
21 => Self::AssociationDeniedChannelAgility,
22 => Self::AssociationRequestRejectedSpectrumManagement,
23 => Self::AssociationRequestRejectedPowerCapability,
24 => Self::AssociationRequestRejectedSupportedChannels,
25 => Self::AssociationDeniedDueToRequestingSTANotSupportingTheShortSlotTimeOption,
26 => Self::AssociationDeniedDueToRequestingSTANotSupportingTheDSSSOFDMOption,
27 => Self::ReservedAssociationDeniedBecauseTheRequestingSTADoesNotSupportHTFeatures,
28 => Self::R0KHUnreachable,
29 => Self::AssociationDeniedPhasedCoexistence,
30 => Self::AssociationRequestRejectedTemporarily,
31 => Self::RobustManagementFramePolicyViolation,
32 => Self::UnspecifiedQoSRelatedFailure,
33 => Self::AssociationDeniedBecauseInsufficientBandwidth,
34 => Self::AssociationDeniedExcessiveFrameLoss,
35 => Self::AssociationWithQoSBSSDenied,
37 => Self::TheRequestHasBeenDeclined,
38 => Self::TheRequestHasNotBeenSuccessfulAsOneOrMoreParametersHaveInvalidValues,
39 => Self::TheAllocationOrTSHasNotBeenCreated,
40 => Self::InvalidInformationElement,
41 => Self::InvalidGroupCipher,
42 => Self::InvalidPairwiseCipher,
43 => Self::InvalidAKMP,
44 => Self::UnsupportedRSNInformationElementVersion,
45 => Self::InvalidRSNInformationElementCapabilities,
46 => Self::CipherSuiteRejectedBecauseOfSecurityPolicy,
47 => Self::TheTSPerAllocationHasNotBeenCreated,
48 => Self::DirectLinkIsNotAllowedInTheBSSByPolicy,
49 => Self::TheDestinationSTAIsNotPresentWithinThisBSS,
50 => Self::TheDestinationSTAIsNotAQoSSTA,
51 => Self::AssociationDeniedBecauseTheListenIntervalIsTooLarge,
52 => Self::InvalidFTActionFrameCount,
53 => Self::InvalidPairwiseMasterKeyIdentifier,
54 => Self::InvalidMDIE,
55 => Self::InvalidFTIE,
56 => Self::RequestedTCLASProcessingIsNotSupportedByThePCPOrAP,
57 => Self::ThePCPOrAPHasInsufficientTCLASProcessingResourcesToSatisfyTheRequest,
58 => Self::TheTSHasNotBeenCreatedBecauseTheRequestCannotBeHonored,
59 => Self::GASAdvertisementProtocolNotSupported,
60 => Self::NoOutstandingGASRequest,
61 => Self::GASResponseNotReceivedFromTheAdvertisementServer,
62 => Self::STATimedOutWaitingForGASQueryResponse,
63 => Self::GASResponseIsLargerThanQueryResponseLengthLimit,
64 => Self::RequestRefusedBecauseHomeNetworkDoesNotSupportRequest,
65 => Self::AdvertisementServerInTheNetworkIsNotCurrentlyReachable,
67 => Self::RequestRefusedDueToPermissionsReceivedViaSSPNInterface,
68 => Self::RequestRefusedBecausePCPOrAPDoesNotSupportUnauthenticatedAccess,
72 => Self::InvalidContentsOfRSNIE,
73 => Self::UAPSDCoexistenceIsNotSupported,
74 => Self::RequestedUAPSDCoexistenceModeIsNotSupported,
75 => Self::RequestedIntervalDurationValueCannotBeSupportedWithUAPSDCoexistence,
76 => Self::AuthenticationIsRejectedBecauseAnAntiCloggingTokenIsRequired,
77 => Self::AuthenticationIsRejectedBecauseTheOfferedFiniteCyclicGroupIsNotSupported,
78 => Self::TheTBTTAdjustmentRequestHasNotBeenSuccessful,
79 => Self::TransmissionFailure,
80 => Self::RequestedTCLASNotSupported,
81 => Self::TCLASResourcesExhausted,
82 => Self::RejectedWithSuggestedBSSTransition,
83 => Self::RejectWithRecommendedSchedule,
84 => Self::RejectBecauseNoWakeupScheduleSpecified,
85 => Self::SuccessTheDestinationSTAIsInPowerSaveMode,
86 => Self::FSTPendingInProcessOfAdmittingFSTSession,
87 => Self::PerformingFSTNow,
88 => Self::FSTPendingGapInBlockAckWindow,
89 => Self::RejectBecauseOfUPIDSetting,
92 => Self::AssociationRefusedForSomeExternalReason,
93 => Self::AssociationRefusedBecauseOfMemoryLimitsAtTheAP,
94 => Self::AssociationRefusedBecauseEmergencyServicesAreNotSupportedAtTheAP,
95 => Self::GASQueryResponseNotYetReceived,
96 => Self::RejectDSEProcedures,
99 => Self::TheAssociationHasBeenDenied,
100 => Self::TheRequestFailedDueToAReservationConflict,
101 => Self::TheRequestFailedDueToExceededMAFLimit,
102 => Self::TheRequestFailedDueToExceededMCCATrackLimit,
103 => Self::AssociationDeniedBecauseSpectrumManagement,
104 => Self::AssociationDeniedBecauseTheRequestingSTADoesNotSupportVHTFeatures,
105 => Self::EnablementDenied,
106 => Self::EnablementDeniedDueToRestrictionFromAnAuthorizedGDB,
107 => Self::AuthorizationDeenabled,
112 => Self::AuthenticationRejectedDueToFILSAuthenticationFailure,
113 => Self::AuthenticationRejectedDueToUnknownAuthenticationServer,
other => Self::Reserved(other),
}
}
#[allow(clippy::too_many_lines)]
#[must_use]
pub fn into_u16(self) -> u16 {
match self {
Self::Successful => 0,
Self::UnspecifiedFailure => 1,
Self::TDLSWakeupScheduleRejectedButAlternativeScheduleProvided => 2,
Self::TDLSWakeupScheduleRejected => 3,
Self::SecurityDisabled => 5,
Self::UnacceptableLifetime => 6,
Self::NotInSameBSS => 7,
Self::CannotSupportAllRequestedCapabilities => 10,
Self::ReassociationDenied => 11,
Self::AssociationDenied => 12,
Self::STADoesNotSupportTheSpecifiedAuthenticationAlgorithm => 13,
Self::ReceivedBadAuthenticationFrame => 14,
Self::AuthenticationRejectedBecauseOfChallengeFailure => 15,
Self::AuthenticationRejectedDueToTimeoutWaitingForNextFrameInSequence => 16,
Self::AssociationDeniedBecauseAPIsUnableToHandleAdditionalAssociatedSTAs => 17,
Self::AssociationDeniedDataRates => 18,
Self::AssociationDeniedShortPreamble => 19,
Self::AssociationDeniedPBCCModulation => 20,
Self::AssociationDeniedChannelAgility => 21,
Self::AssociationRequestRejectedSpectrumManagement => 22,
Self::AssociationRequestRejectedPowerCapability => 23,
Self::AssociationRequestRejectedSupportedChannels => 24,
Self::AssociationDeniedDueToRequestingSTANotSupportingTheShortSlotTimeOption => 25,
Self::AssociationDeniedDueToRequestingSTANotSupportingTheDSSSOFDMOption => 26,
Self::ReservedAssociationDeniedBecauseTheRequestingSTADoesNotSupportHTFeatures => 27,
Self::R0KHUnreachable => 28,
Self::AssociationDeniedPhasedCoexistence => 29,
Self::AssociationRequestRejectedTemporarily => 30,
Self::RobustManagementFramePolicyViolation => 31,
Self::UnspecifiedQoSRelatedFailure => 32,
Self::AssociationDeniedBecauseInsufficientBandwidth => 33,
Self::AssociationDeniedExcessiveFrameLoss => 34,
Self::AssociationWithQoSBSSDenied => 35,
Self::TheRequestHasBeenDeclined => 37,
Self::TheRequestHasNotBeenSuccessfulAsOneOrMoreParametersHaveInvalidValues => 38,
Self::TheAllocationOrTSHasNotBeenCreated => 39,
Self::InvalidInformationElement => 40,
Self::InvalidGroupCipher => 41,
Self::InvalidPairwiseCipher => 42,
Self::InvalidAKMP => 43,
Self::UnsupportedRSNInformationElementVersion => 44,
Self::InvalidRSNInformationElementCapabilities => 45,
Self::CipherSuiteRejectedBecauseOfSecurityPolicy => 46,
Self::TheTSPerAllocationHasNotBeenCreated => 47,
Self::DirectLinkIsNotAllowedInTheBSSByPolicy => 48,
Self::TheDestinationSTAIsNotPresentWithinThisBSS => 49,
Self::TheDestinationSTAIsNotAQoSSTA => 50,
Self::AssociationDeniedBecauseTheListenIntervalIsTooLarge => 51,
Self::InvalidFTActionFrameCount => 52,
Self::InvalidPairwiseMasterKeyIdentifier => 53,
Self::InvalidMDIE => 54,
Self::InvalidFTIE => 55,
Self::RequestedTCLASProcessingIsNotSupportedByThePCPOrAP => 56,
Self::ThePCPOrAPHasInsufficientTCLASProcessingResourcesToSatisfyTheRequest => 57,
Self::TheTSHasNotBeenCreatedBecauseTheRequestCannotBeHonored => 58,
Self::GASAdvertisementProtocolNotSupported => 59,
Self::NoOutstandingGASRequest => 60,
Self::GASResponseNotReceivedFromTheAdvertisementServer => 61,
Self::STATimedOutWaitingForGASQueryResponse => 62,
Self::GASResponseIsLargerThanQueryResponseLengthLimit => 63,
Self::RequestRefusedBecauseHomeNetworkDoesNotSupportRequest => 64,
Self::AdvertisementServerInTheNetworkIsNotCurrentlyReachable => 65,
Self::RequestRefusedDueToPermissionsReceivedViaSSPNInterface => 67,
Self::RequestRefusedBecausePCPOrAPDoesNotSupportUnauthenticatedAccess => 68,
Self::InvalidContentsOfRSNIE => 72,
Self::UAPSDCoexistenceIsNotSupported => 73,
Self::RequestedUAPSDCoexistenceModeIsNotSupported => 74,
Self::RequestedIntervalDurationValueCannotBeSupportedWithUAPSDCoexistence => 75,
Self::AuthenticationIsRejectedBecauseAnAntiCloggingTokenIsRequired => 76,
Self::AuthenticationIsRejectedBecauseTheOfferedFiniteCyclicGroupIsNotSupported => 77,
Self::TheTBTTAdjustmentRequestHasNotBeenSuccessful => 78,
Self::TransmissionFailure => 79,
Self::RequestedTCLASNotSupported => 80,
Self::TCLASResourcesExhausted => 81,
Self::RejectedWithSuggestedBSSTransition => 82,
Self::RejectWithRecommendedSchedule => 83,
Self::RejectBecauseNoWakeupScheduleSpecified => 84,
Self::SuccessTheDestinationSTAIsInPowerSaveMode => 85,
Self::FSTPendingInProcessOfAdmittingFSTSession => 86,
Self::PerformingFSTNow => 87,
Self::FSTPendingGapInBlockAckWindow => 88,
Self::RejectBecauseOfUPIDSetting => 89,
Self::AssociationRefusedForSomeExternalReason => 92,
Self::AssociationRefusedBecauseOfMemoryLimitsAtTheAP => 93,
Self::AssociationRefusedBecauseEmergencyServicesAreNotSupportedAtTheAP => 94,
Self::GASQueryResponseNotYetReceived => 95,
Self::RejectDSEProcedures => 96,
Self::TheAssociationHasBeenDenied => 99,
Self::TheRequestFailedDueToAReservationConflict => 100,
Self::TheRequestFailedDueToExceededMAFLimit => 101,
Self::TheRequestFailedDueToExceededMCCATrackLimit => 102,
Self::AssociationDeniedBecauseSpectrumManagement => 103,
Self::AssociationDeniedBecauseTheRequestingSTADoesNotSupportVHTFeatures => 104,
Self::EnablementDenied => 105,
Self::EnablementDeniedDueToRestrictionFromAnAuthorizedGDB => 106,
Self::AuthorizationDeenabled => 107,
Self::AuthenticationRejectedDueToFILSAuthenticationFailure => 112,
Self::AuthenticationRejectedDueToUnknownAuthenticationServer => 113,
Self::Reserved(other) => other,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ReasonCode {
UnspecifiedReason,
PreviousAuthenticationNoLongerValid,
STALeavingIBSSOrESS,
Inactivity,
APIsUnableToHandleAllCurrentlyAssociatedSTAs,
Class2FrameReceivedFromNonauthenticatedSTA,
Class3FrameReceivedFromNonassociatedSTA,
STALeavingBSS,
NotAuthenticated,
PowerCapabilityElementIsUnacceptable,
SupportedChannelsElementIsUnacceptable,
DisassociatedDueToBSSTransitionManagement,
InvalidInformationElement,
MessageIntegrityCodeFailure,
FourWayHandshakeTimeout,
GroupKeyHandshakeTimeout,
InformationDifferent,
InvalidGroupCipher,
InvalidPairwiseCipher,
InvalidAKMP,
UnsupportedRSNInformationElementVersion,
InvalidRSNInformationElementCapabilities,
IEEE8021XAuthenticationFailed,
CipherSuiteRejectedBecauseOfTheSecurityPolicy,
TDLSDirectLinkTeardownUnreachable,
TDLSDirectLinkTeardownUnspecifiedReason,
DisassociatedBecauseSessionTerminatedBySSPRequest,
DisassociatedBecauseOfLackOfSSPRoamingAgreement,
RequestedServiceRejected,
RequestedServiceNotAuthorizedInThisLocation,
TSDeleted,
DisassociatedForUnspecifiedQoSRelatedReason,
QoSAPLacksSufficientBandwidthForThisQoSSTA,
ExcessiveNumberOfFramesNotAcknowledged,
STAIsTransmittingOutsideTheLimitsOfItsTXOPs,
RequestedSTALeavingBSS,
RequestedSTADoesNotWantToUseTheMechanism,
RequestedSTAReceivedFrames,
RequestedSTATimeout,
PeerSTADoesNotSupportTheRequestedCipherSuite,
AuthorizedAccessLimitReached,
DisassociatedDueToExternalServiceRequirements,
InvalidFTActionFrameCount,
InvalidPairwiseMasterKeyIdentifier,
InvalidMDE,
InvalidFTE,
SMECancel,
MeshMaxSupportedMaximumNumberOfPeerMeshSTAs,
InformationViolatesMeshPolicy,
MeshSTAReceivedAMeshPeeringCloseMessage,
MeshSTAHasResentMaxRetriesWithoutConfirm,
TheConfirmTimerForTheMeshPeeringInstanceTimesOut,
MeshSTAFailsToUnwrapGTK,
MeshSTAReceivesInconsistentInformation,
MeshSTAFailsAuthenticatedMeshPeeringExchange,
MeshSTADoesNotHaveProxyInformation,
MeshSTADoesNotHaveForwardingInformation,
MeshSTALinkNoLongerUsable,
MacAddressAlreadyExists,
MeshSTAPerformsChannelSwitchToMeetRegulatoryRequirements,
MeshSTAPerformsChannelSwitchWithUnspecifiedReason,
Reserved(u16),
}
impl ReasonCode {
#[must_use]
pub fn from_u16(n: u16) -> Self {
match n {
1 => Self::UnspecifiedReason,
2 => Self::PreviousAuthenticationNoLongerValid,
3 => Self::STALeavingIBSSOrESS,
4 => Self::Inactivity,
5 => Self::APIsUnableToHandleAllCurrentlyAssociatedSTAs,
6 => Self::Class2FrameReceivedFromNonauthenticatedSTA,
7 => Self::Class3FrameReceivedFromNonassociatedSTA,
8 => Self::STALeavingBSS,
9 => Self::NotAuthenticated,
10 => Self::PowerCapabilityElementIsUnacceptable,
11 => Self::SupportedChannelsElementIsUnacceptable,
12 => Self::DisassociatedDueToBSSTransitionManagement,
13 => Self::InvalidInformationElement,
14 => Self::MessageIntegrityCodeFailure,
15 => Self::FourWayHandshakeTimeout,
16 => Self::GroupKeyHandshakeTimeout,
17 => Self::InformationDifferent,
18 => Self::InvalidGroupCipher,
19 => Self::InvalidPairwiseCipher,
20 => Self::InvalidAKMP,
21 => Self::UnsupportedRSNInformationElementVersion,
22 => Self::InvalidRSNInformationElementCapabilities,
23 => Self::IEEE8021XAuthenticationFailed,
24 => Self::CipherSuiteRejectedBecauseOfTheSecurityPolicy,
25 => Self::TDLSDirectLinkTeardownUnreachable,
26 => Self::TDLSDirectLinkTeardownUnspecifiedReason,
27 => Self::DisassociatedBecauseSessionTerminatedBySSPRequest,
28 => Self::DisassociatedBecauseOfLackOfSSPRoamingAgreement,
29 => Self::RequestedServiceRejected,
30 => Self::RequestedServiceNotAuthorizedInThisLocation,
31 => Self::TSDeleted,
32 => Self::DisassociatedForUnspecifiedQoSRelatedReason,
33 => Self::QoSAPLacksSufficientBandwidthForThisQoSSTA,
34 => Self::ExcessiveNumberOfFramesNotAcknowledged,
35 => Self::STAIsTransmittingOutsideTheLimitsOfItsTXOPs,
36 => Self::RequestedSTALeavingBSS,
37 => Self::RequestedSTADoesNotWantToUseTheMechanism,
38 => Self::RequestedSTAReceivedFrames,
39 => Self::RequestedSTATimeout,
45 => Self::PeerSTADoesNotSupportTheRequestedCipherSuite,
46 => Self::AuthorizedAccessLimitReached,
47 => Self::DisassociatedDueToExternalServiceRequirements,
48 => Self::InvalidFTActionFrameCount,
49 => Self::InvalidPairwiseMasterKeyIdentifier,
50 => Self::InvalidMDE,
51 => Self::InvalidFTE,
52 => Self::SMECancel,
53 => Self::MeshMaxSupportedMaximumNumberOfPeerMeshSTAs,
54 => Self::InformationViolatesMeshPolicy,
55 => Self::MeshSTAReceivedAMeshPeeringCloseMessage,
56 => Self::MeshSTAHasResentMaxRetriesWithoutConfirm,
57 => Self::TheConfirmTimerForTheMeshPeeringInstanceTimesOut,
58 => Self::MeshSTAFailsToUnwrapGTK,
59 => Self::MeshSTAReceivesInconsistentInformation,
60 => Self::MeshSTAFailsAuthenticatedMeshPeeringExchange,
61 => Self::MeshSTADoesNotHaveProxyInformation,
62 => Self::MeshSTADoesNotHaveForwardingInformation,
63 => Self::MeshSTALinkNoLongerUsable,
64 => Self::MacAddressAlreadyExists,
65 => Self::MeshSTAPerformsChannelSwitchToMeetRegulatoryRequirements,
66 => Self::MeshSTAPerformsChannelSwitchWithUnspecifiedReason,
other => Self::Reserved(other),
}
}
#[must_use]
pub fn into_u16(self) -> u16 {
match self {
Self::UnspecifiedReason => 1,
Self::PreviousAuthenticationNoLongerValid => 2,
Self::STALeavingIBSSOrESS => 3,
Self::Inactivity => 4,
Self::APIsUnableToHandleAllCurrentlyAssociatedSTAs => 5,
Self::Class2FrameReceivedFromNonauthenticatedSTA => 6,
Self::Class3FrameReceivedFromNonassociatedSTA => 7,
Self::STALeavingBSS => 8,
Self::NotAuthenticated => 9,
Self::PowerCapabilityElementIsUnacceptable => 10,
Self::SupportedChannelsElementIsUnacceptable => 11,
Self::DisassociatedDueToBSSTransitionManagement => 12,
Self::InvalidInformationElement => 13,
Self::MessageIntegrityCodeFailure => 14,
Self::FourWayHandshakeTimeout => 15,
Self::GroupKeyHandshakeTimeout => 16,
Self::InformationDifferent => 17,
Self::InvalidGroupCipher => 18,
Self::InvalidPairwiseCipher => 19,
Self::InvalidAKMP => 20,
Self::UnsupportedRSNInformationElementVersion => 21,
Self::InvalidRSNInformationElementCapabilities => 22,
Self::IEEE8021XAuthenticationFailed => 23,
Self::CipherSuiteRejectedBecauseOfTheSecurityPolicy => 24,
Self::TDLSDirectLinkTeardownUnreachable => 25,
Self::TDLSDirectLinkTeardownUnspecifiedReason => 26,
Self::DisassociatedBecauseSessionTerminatedBySSPRequest => 27,
Self::DisassociatedBecauseOfLackOfSSPRoamingAgreement => 28,
Self::RequestedServiceRejected => 29,
Self::RequestedServiceNotAuthorizedInThisLocation => 30,
Self::TSDeleted => 31,
Self::DisassociatedForUnspecifiedQoSRelatedReason => 32,
Self::QoSAPLacksSufficientBandwidthForThisQoSSTA => 33,
Self::ExcessiveNumberOfFramesNotAcknowledged => 34,
Self::STAIsTransmittingOutsideTheLimitsOfItsTXOPs => 35,
Self::RequestedSTALeavingBSS => 36,
Self::RequestedSTADoesNotWantToUseTheMechanism => 37,
Self::RequestedSTAReceivedFrames => 38,
Self::RequestedSTATimeout => 39,
Self::PeerSTADoesNotSupportTheRequestedCipherSuite => 45,
Self::AuthorizedAccessLimitReached => 46,
Self::DisassociatedDueToExternalServiceRequirements => 47,
Self::InvalidFTActionFrameCount => 48,
Self::InvalidPairwiseMasterKeyIdentifier => 49,
Self::InvalidMDE => 50,
Self::InvalidFTE => 51,
Self::SMECancel => 52,
Self::MeshMaxSupportedMaximumNumberOfPeerMeshSTAs => 53,
Self::InformationViolatesMeshPolicy => 54,
Self::MeshSTAReceivedAMeshPeeringCloseMessage => 55,
Self::MeshSTAHasResentMaxRetriesWithoutConfirm => 56,
Self::TheConfirmTimerForTheMeshPeeringInstanceTimesOut => 57,
Self::MeshSTAFailsToUnwrapGTK => 58,
Self::MeshSTAReceivesInconsistentInformation => 59,
Self::MeshSTAFailsAuthenticatedMeshPeeringExchange => 60,
Self::MeshSTADoesNotHaveProxyInformation => 61,
Self::MeshSTADoesNotHaveForwardingInformation => 62,
Self::MeshSTALinkNoLongerUsable => 63,
Self::MacAddressAlreadyExists => 64,
Self::MeshSTAPerformsChannelSwitchToMeetRegulatoryRequirements => 65,
Self::MeshSTAPerformsChannelSwitchWithUnspecifiedReason => 66,
Self::Reserved(other) => other,
}
}
}