diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml new file mode 100644 index 0000000..31e9aed --- /dev/null +++ b/.github/workflows/spelling.yml @@ -0,0 +1,19 @@ +name: Spelling + +permissions: + contents: read + +on: [pull_request] + +env: + CLICOLOR: 1 + +jobs: + spelling: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Spell Check Repo + uses: crate-ci/typos@v1.32.0 diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..a09f59a --- /dev/null +++ b/.typos.toml @@ -0,0 +1,19 @@ +[default.extend-words] +FILS = "FILS" +UE = "UE" +ND = "ND" +BA = "BA" +SME = "SME" +OCE = "OCE" +Oce = "Oce" + +[type.rust.extend-identifiers] +# Ignore unfixable typo in a trait, which is defined outside this crate +Emitable = "Emitable" + +[type.changelod] +extend-glob = ["CHANGELOG"] +extend-ignore-re = [ + # ignore commit id in changelog file + '\([^\)]*\)', +] diff --git a/src/element.rs b/src/element.rs index 6dbada9..b109dc6 100644 --- a/src/element.rs +++ b/src/element.rs @@ -907,13 +907,13 @@ bitflags::bitflags! { /// with a pairwise key. const NoPairwise = RSN_CAP_NO_PAIRWISE; /// When Both PtksaReplayCount2 and PtksaReplayCount4 are set, - /// it means 16 replay conters per PTKSA. + /// it means 16 replay counters per PTKSA. /// When Neither PtksaReplayCount2 or PtksaReplayCount4 is set, /// it means 1 reply counter per PTKSA const PtksaReplayCount2 = RSN_CAP_PTKSA_REPLAY_COUNT_2; const PtksaReplayCount4 = RSN_CAP_PTKSA_REPLAY_COUNT_4; /// When Both GtksaReplayCount2 and GtksaReplayCount4 are set, - /// it means 16 replay conters per GTKSA. + /// it means 16 replay counters per GTKSA. /// When Neither GtksaReplayCount2 or GtksaReplayCount4 is set, /// it means 1 reply counter per GTKSA const GtksaReplayCount2 = RSN_CAP_GTKSA_REPLAY_COUNT_2; diff --git a/src/lib.rs b/src/lib.rs index 84148b0..9e23352 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -85,8 +85,8 @@ pub use self::wiphy::{ Nl80211Band, Nl80211BandInfo, Nl80211BandType, Nl80211BandTypes, Nl80211Channel, Nl80211ChannelSwitchRequest, Nl80211CipherSuit, Nl80211Frequency, Nl80211FrequencyInfo, Nl80211IfMode, - Nl80211WiphyGetRequest, Nl80211WiphyHandle, Nl80211WowlanTcpTrigerSupport, - Nl80211WowlanTrigerPatternSupport, Nl80211WowlanTriggersSupport, + Nl80211WiphyGetRequest, Nl80211WiphyHandle, Nl80211WowlanTcpTriggerSupport, + Nl80211WowlanTriggerPatternSupport, Nl80211WowlanTriggersSupport, }; pub(crate) use self::element::Nl80211Elements; diff --git a/src/wiphy/mod.rs b/src/wiphy/mod.rs index d9d107a..ee81eb5 100644 --- a/src/wiphy/mod.rs +++ b/src/wiphy/mod.rs @@ -19,7 +19,7 @@ pub use self::handle::{Nl80211Channel, Nl80211WiphyHandle}; pub use self::ifmode::Nl80211IfMode; pub use self::set::Nl80211ChannelSwitchRequest; pub use self::wowlan::{ - Nl80211WowlanTcpTrigerSupport, Nl80211WowlanTrigerPatternSupport, + Nl80211WowlanTcpTriggerSupport, Nl80211WowlanTriggerPatternSupport, Nl80211WowlanTriggersSupport, }; diff --git a/src/wiphy/wowlan.rs b/src/wiphy/wowlan.rs index 36f5967..011cf08 100644 --- a/src/wiphy/wowlan.rs +++ b/src/wiphy/wowlan.rs @@ -78,7 +78,7 @@ pub enum Nl80211WowlanTriggersSupport { /// The matching is done on the MSDU, i.e. as though the packet was an /// 802.3 packet, so the pattern matching is done after the packet is /// converted to the MSDU. - PktPattern(Nl80211WowlanTrigerPatternSupport), + PktPattern(Nl80211WowlanTriggerPatternSupport), /// Not a real trigger, and cannot be used when setting, used only to /// indicate that GTK rekeying is supported by the device. GtkRekeySupported, @@ -95,7 +95,7 @@ pub enum Nl80211WowlanTriggersSupport { /// configured network is detected. NetDetect(u32), /// TCP connection wake. - TcpConnection(Vec), + TcpConnection(Vec), Other(DefaultNla), } @@ -110,7 +110,7 @@ impl Nla for Nl80211WowlanTriggersSupport { | Self::EapIdentRequest | Self::FourWayHandshake | Self::RfkillRelease => 0, - Self::PktPattern(_) => Nl80211WowlanTrigerPatternSupport::LENGTH, + Self::PktPattern(_) => Nl80211WowlanTriggerPatternSupport::LENGTH, Self::NetDetect(_) => 4, Self::TcpConnection(s) => s.as_slice().buffer_len(), Self::Other(attr) => attr.value_len(), @@ -167,7 +167,7 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable> NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE => Self::FourWayHandshake, NL80211_WOWLAN_TRIG_RFKILL_RELEASE => Self::RfkillRelease, NL80211_WOWLAN_TRIG_PKT_PATTERN => Self::PktPattern( - Nl80211WowlanTrigerPatternSupport::parse(payload)?, + Nl80211WowlanTriggerPatternSupport::parse(payload)?, ), NL80211_WOWLAN_TRIG_NET_DETECT => { Self::NetDetect(parse_u32(payload).context(format!( @@ -182,7 +182,7 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable> "Invalid NL80211_WOWLAN_TRIG_TCP_CONNECTION value {nla:?}" ); let nla = &nla.context(err_msg.clone())?; - nlas.push(Nl80211WowlanTcpTrigerSupport::parse(nla)?); + nlas.push(Nl80211WowlanTcpTriggerSupport::parse(nla)?); } Self::TcpConnection(nlas) @@ -196,14 +196,14 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable> /// Support status of WoWLAN trigger pattern #[derive(Debug, PartialEq, Eq, Clone)] -pub struct Nl80211WowlanTrigerPatternSupport { +pub struct Nl80211WowlanTriggerPatternSupport { pub max_patterns: u32, pub min_pattern_len: u32, pub max_pattern_len: u32, pub max_pkt_offset: u32, } -impl Nl80211WowlanTrigerPatternSupport { +impl Nl80211WowlanTriggerPatternSupport { const LENGTH: usize = 16; pub fn parse(payload: &[u8]) -> Result { @@ -227,7 +227,7 @@ impl Nl80211WowlanTrigerPatternSupport { } } -impl Emitable for Nl80211WowlanTrigerPatternSupport { +impl Emitable for Nl80211WowlanTriggerPatternSupport { fn buffer_len(&self) -> usize { Self::LENGTH } @@ -254,7 +254,7 @@ const NL80211_WOWLAN_TCP_WAKE_MASK: u16 = 11; /// Supported WoWLAN TCP connection trigger #[derive(Debug, PartialEq, Eq, Clone)] -pub enum Nl80211WowlanTcpTrigerSupport { +pub enum Nl80211WowlanTcpTriggerSupport { SrcIpv4, DstIpv4, DstMac, @@ -269,7 +269,7 @@ pub enum Nl80211WowlanTcpTrigerSupport { Other(DefaultNla), } -impl Nla for Nl80211WowlanTcpTrigerSupport { +impl Nla for Nl80211WowlanTcpTriggerSupport { fn value_len(&self) -> usize { match self { Self::SrcIpv4 @@ -323,7 +323,7 @@ impl Nla for Nl80211WowlanTcpTrigerSupport { } impl<'a, T: AsRef<[u8]> + ?Sized> Parseable> - for Nl80211WowlanTcpTrigerSupport + for Nl80211WowlanTcpTriggerSupport { fn parse(buf: &NlaBuffer<&'a T>) -> Result { let payload = buf.value();