Skip to content
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

Support for Wi-Fi/802.11 related radiotap fields: MCS, HE, VHT #207

Open
wants to merge 7 commits into
base: master
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
3,218 changes: 1,793 additions & 1,425 deletions PacketDotNet/Ieee80211/RadioTapFields.cs

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions PacketDotNet/Ieee80211/RadioTapHighEfficiencyData1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
This file is part of PacketDotNet.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

using System;

namespace PacketDotNet.Ieee80211;

/// <summary>
/// Flags that indicate the presence of fields in the HE radio tap field as well as the HE PPDU Format
/// </summary>
[Flags]
public enum RadioTapHighEfficiencyData1 : ushort
{
/// <summary>
/// HE PPDU Format:
/// 0=HE_SU
/// 1=HE_EXT_SU
/// 2=HE_MY
/// 3=HE_TRIG
/// </summary>
HePpduFormat = 0x0003,

/// <summary>
/// BSS Color Known
/// </summary>
BssColorKnown = 0x0004,

/// <summary>
/// Beam Change Known
/// </summary>
BeamChangeKnown = 0x0008,

/// <summary>
/// UL/DL Known
/// </summary>
UlDlDown = 0x0010,

/// <summary>
/// Data MCS Known
/// </summary>
DataMcsKnown = 0x0020,

/// <summary>
/// Data DCM Known
/// </summary>
DataDcmKnown = 0x0040,

/// <summary>
/// Coding Known
/// </summary>
CodingKnown = 0x0080,

/// <summary>
/// LDPC extra symbol segment known
/// </summary>
LdpcExtraSymbolSegmentKnown = 0x0100,

/// <summary>
/// STBC Known
/// </summary>
StbcKnown = 0x0200,

/// <summary>
/// Spatial Reuse known (Spatial Reuse 1 for HE_TRIG format)
/// </summary>
SpatialReuseKnownKnown = 0x0400,

/// <summary>
/// Spatial Reuse 2 known (HE_TRIG format), STA-ID known (HE_MU format)
/// </summary>
SpatialReuse2KnownKnown = 0x0800,

/// <summary>
/// Spatial Reuse 3 known (HE_TRIG format)
/// </summary>
SpatialReuse3KnownKnown = 0x1000,

/// <summary>
/// Spatial Reuse 4 known (HE_TRIG format)
/// </summary>
SpatialReuse4KnownKnown = 0x2000,

/// <summary>
/// Data BW/RU allocation known
/// </summary>
DataBwRuAllocationKnown = 0x4000,

/// <summary>
/// Doppler known
/// </summary>
DopplerKnown = 0x8000,
}
76 changes: 76 additions & 0 deletions PacketDotNet/Ieee80211/RadioTapHighEfficiencyData2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
This file is part of PacketDotNet.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

using System;

namespace PacketDotNet.Ieee80211;

/// <summary>
/// Flags that indicate the presence of fields in the HE radio tap field as well as the
/// RU Allocation Offset and
/// </summary>
[Flags]
public enum RadioTapHighEfficiencyData2 : ushort
{
/// <summary>
/// Pri/sec 80 MHz known
/// </summary>
PriSec80MHzKnown = 0x0001,

/// <summary>
/// GI Known
/// </summary>
GiKnown = 0x0002,

/// <summary>
/// Number of LTF symbols known
/// </summary>
NumberOfLtfSymbolsKnown = 0x0004,

/// <summary>
/// Pre-FEC Padding Factor known
/// </summary>
PreFecPaddingFactorKnown = 0x0008,

/// <summary>
/// TxBF known
/// </summary>
TxbfKnown = 0x0010,

/// <summary>
/// PE Disambiguity known
/// </summary>
PeDisambiguityKnown = 0x0020,

/// <summary>
/// TXOP known
/// </summary>
TxopKnown = 0x0040,

/// <summary>
/// Midamble periodicity known
/// </summary>
MidamblePeriodicityKnown = 0x0080,

/// <summary>
/// Bitmask for RU allocation offset
/// </summary>
RuAllocationOffset = 0x3f00,

/// <summary>
/// RU allocation offset known
/// </summary>
RuAllocationOffsetKnown = 0x4000,

/// <summary>
/// Pri/sec 80MHz.
/// 0 = primary
/// 1 = secondary
/// </summary>
PriSec80MHz = 0x8000,
}
57 changes: 57 additions & 0 deletions PacketDotNet/Ieee80211/RadioTapHighEfficiencyData3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
This file is part of PacketDotNet.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

using System;

namespace PacketDotNet.Ieee80211;

[Flags]
public enum RadioTapHighEfficiencyData3 : ushort
{
/// <summary>
/// BSS color bitmask
/// </summary>
BssColor = 0x003f,

/// <summary>
/// Beam change bitmask
/// </summary>
BeamChange = 0x0040,

/// <summary>
/// UL/DL bitmask
/// </summary>
UlDl = 0x0080,

/// <summary>
/// Data MCS (not SIG-B MCS from HE-SIG-A for HE_MU format bitmask
/// </summary>
DataMcs = 0x0f00,

/// <summary>
/// Data DCM (cf. data MCS) bitmask
/// </summary>
DataDcm = 0x1000,

/// <summary>
/// Coding bitmask
/// 0=BCC
/// 1=LDPC
/// </summary>
Coding = 0x2000,

/// <summary>
/// LDPC extra symbol segment
/// </summary>
LdpcExtraSymbolSegment = 0x4000,

/// <summary>
/// STBC
/// </summary>
Stbc = 0x800
}
75 changes: 75 additions & 0 deletions PacketDotNet/Ieee80211/RadioTapHighEfficiencyData5.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
This file is part of PacketDotNet.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

using System;

namespace PacketDotNet.Ieee80211;

[Flags]
public enum RadioTapHighEfficiencyData5 : ushort
{
/// <summary>
/// Data Bandwidth/RU allocation bitmask
/// 0=20
/// 1=40
/// 2=80
/// 3=160/80+80
/// 4=26-tone RU
/// 5=52-tone RU
/// 6=106-tone RU
/// 7=242-tone RU
/// 8=484-tone RU
/// 9=996-tone RU
/// 10=2x996-tone RU
/// </summary>
DataBandwidth = 0x000f,

/// <summary>
/// Guard Interval (GI)
/// 0=0.8us
/// 1=1.6us
/// 2=3.2us
/// 3=reserved
/// </summary>
Gi = 0x30,

/// <summary>
/// LTF symbol size bitmask
/// 0=unknown
/// 1=1x
/// 2=2x
/// 3=4x
/// </summary>
LtfSymbolSize = 0x00c0,

/// <summary>
/// Number of LTF symbols
/// 0=1x
/// 1=2x
/// 2=4x
/// 3=6x
/// 4=8x
/// 5-7=reserved
/// </summary>
NumberOfLtfSymbols = 0x0700,

/// <summary>
/// Pre-FEC Padding Factor bitmask
/// </summary>
PreFecPaddingFactor = 0x3000,

/// <summary>
/// TxBF bitmask
/// </summary>
Txbf = 0x4000,

/// <summary>
/// PE Disambiguity
/// </summary>
PeDisambiguity = 0x8000
}
42 changes: 42 additions & 0 deletions PacketDotNet/Ieee80211/RadioTapHighEfficiencyData6.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
This file is part of PacketDotNet.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

using System;

namespace PacketDotNet.Ieee80211;

[Flags]
public enum RadioTapHighEfficiencyData6 : ushort
{
/// <summary>
/// NSTS (actual number of space-time streams, 0=unknown, 1=1, etc.
/// </summary>
Nsts = 0x000f,

/// <summary>
/// Doppler value
/// </summary>
DopplerValue = 0x0010,

/// <summary>
/// Reserved.
/// </summary>
Reserved = 0x00e0,

/// <summary>
/// TXOP Value
/// </summary>
TxopValue = 0x7f00,

/// <summary>
/// Midamble periodicity
/// 0=10
/// 1=20
/// </summary>
MidamblePeriodicity = 0x8000,
}
36 changes: 36 additions & 0 deletions PacketDotNet/Ieee80211/RadioTapMcsFlags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
This file is part of PacketDotNet.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

using System;

namespace PacketDotNet.Ieee80211;

/// <summary>
/// Channel flags
/// </summary>
[Flags]
public enum RadioTapMcsFlags : byte
{
/// <summary>Channel Width: 20MHz=0, 40MHz=1, 20L=2, 20U=3</summary>
Bandwidth = 0x03,

/// <summary>Guard Interval (GI): Long GI=0, Short GI=1</summary>
GuardInterval = 0x04,

/// <summary>HT Format: 0=Mixed, 1=Greenfield</summary>
HtFormat = 0x08,

/// <summary>FEC Type: BCC=0, LDPC=1</summary>
FecType = 0x10,

/// <summary>Number of STBC Streams</summary>
NumberOfStbcStreams = 0x60,

/// <summary>Number of extension spacial streams</summary>
Ness = 0x80
}
Loading