Skip to content

Add spelling CI job and fix further typos #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
19 changes: 19 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -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
'\([^\)]*\)',
]
4 changes: 2 additions & 2 deletions src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/wiphy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
22 changes: 11 additions & 11 deletions src/wiphy/wowlan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -95,7 +95,7 @@ pub enum Nl80211WowlanTriggersSupport {
/// configured network is detected.
NetDetect(u32),
/// TCP connection wake.
TcpConnection(Vec<Nl80211WowlanTcpTrigerSupport>),
TcpConnection(Vec<Nl80211WowlanTcpTriggerSupport>),
Other(DefaultNla),
}

Expand All @@ -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(),
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>>
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!(
Expand All @@ -182,7 +182,7 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>>
"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)
Expand All @@ -196,14 +196,14 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>>

/// 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<Self, DecodeError> {
Expand All @@ -227,7 +227,7 @@ impl Nl80211WowlanTrigerPatternSupport {
}
}

impl Emitable for Nl80211WowlanTrigerPatternSupport {
impl Emitable for Nl80211WowlanTriggerPatternSupport {
fn buffer_len(&self) -> usize {
Self::LENGTH
}
Expand All @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -323,7 +323,7 @@ impl Nla for Nl80211WowlanTcpTrigerSupport {
}

impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>>
for Nl80211WowlanTcpTrigerSupport
for Nl80211WowlanTcpTriggerSupport
{
fn parse(buf: &NlaBuffer<&'a T>) -> Result<Self, DecodeError> {
let payload = buf.value();
Expand Down