pub struct Dot11Builder {
pub proto: u8,
pub frame_type: u8,
pub subtype: u8,
pub flags: u8,
pub duration: u16,
pub addr1: MacAddress,
pub addr2: MacAddress,
pub addr3: MacAddress,
pub addr4: Option<MacAddress>,
pub seq_ctrl: u16,
pub body: Vec<u8>,
pub with_fcs: bool,
}Expand description
Fields§
§proto: u8Protocol version (default 0).
frame_type: u8Frame type (Management/Control/Data).
subtype: u8Frame subtype.
flags: u8Flags byte (to_DS, from_DS, retry, etc.).
duration: u16Duration/ID field.
addr1: MacAddressAddress 1 (receiver/destination).
addr2: MacAddressAddress 2 (transmitter/source).
addr3: MacAddressAddress 3 (BSSID or other).
addr4: Option<MacAddress>Address 4 (only in WDS mode).
seq_ctrl: u16Sequence Control field.
body: Vec<u8>Frame body payload (management body, data, etc.).
with_fcs: boolWhether to append FCS.
Implementations§
Source§impl Dot11Builder
impl Dot11Builder
Sourcepub fn frame_type(self, ft: u8) -> Self
pub fn frame_type(self, ft: u8) -> Self
Set the frame type.
Sourcepub fn addr1(self, mac: MacAddress) -> Self
pub fn addr1(self, mac: MacAddress) -> Self
Set Address 1 (receiver/destination).
Sourcepub fn addr2(self, mac: MacAddress) -> Self
pub fn addr2(self, mac: MacAddress) -> Self
Set Address 2 (transmitter/source).
Sourcepub fn addr3(self, mac: MacAddress) -> Self
pub fn addr3(self, mac: MacAddress) -> Self
Set Address 3 (BSSID or other).
Sourcepub fn addr4(self, mac: MacAddress) -> Self
pub fn addr4(self, mac: MacAddress) -> Self
Set Address 4 (WDS mode).
Sourcepub fn header_size(&self) -> usize
pub fn header_size(&self) -> usize
Calculate the header size based on frame type and addresses.
Sourcepub fn beacon(bssid: MacAddress) -> Self
pub fn beacon(bssid: MacAddress) -> Self
Create a Beacon frame builder.
Sourcepub fn probe_request(src: MacAddress) -> Self
pub fn probe_request(src: MacAddress) -> Self
Create a Probe Request frame builder.
Sourcepub fn probe_response(dst: MacAddress, bssid: MacAddress) -> Self
pub fn probe_response(dst: MacAddress, bssid: MacAddress) -> Self
Create a Probe Response frame builder.
Sourcepub fn authentication(
dst: MacAddress,
src: MacAddress,
bssid: MacAddress,
) -> Self
pub fn authentication( dst: MacAddress, src: MacAddress, bssid: MacAddress, ) -> Self
Create an Authentication frame builder.
Sourcepub fn deauthentication(
dst: MacAddress,
src: MacAddress,
bssid: MacAddress,
) -> Self
pub fn deauthentication( dst: MacAddress, src: MacAddress, bssid: MacAddress, ) -> Self
Create a Deauthentication frame builder.
Sourcepub fn assoc_request(dst: MacAddress, src: MacAddress) -> Self
pub fn assoc_request(dst: MacAddress, src: MacAddress) -> Self
Create an Association Request frame builder.
Sourcepub fn ack(dst: MacAddress) -> Self
pub fn ack(dst: MacAddress) -> Self
Create an ACK frame builder.
Sourcepub fn rts(dst: MacAddress, src: MacAddress) -> Self
pub fn rts(dst: MacAddress, src: MacAddress) -> Self
Create an RTS frame builder.
Sourcepub fn cts(dst: MacAddress) -> Self
pub fn cts(dst: MacAddress) -> Self
Create a CTS frame builder.
Sourcepub fn data_to_ap(bssid: MacAddress, src: MacAddress, dst: MacAddress) -> Self
pub fn data_to_ap(bssid: MacAddress, src: MacAddress, dst: MacAddress) -> Self
Create a Data frame builder (to AP: to_DS=1).
Sourcepub fn data_from_ap(dst: MacAddress, bssid: MacAddress, src: MacAddress) -> Self
pub fn data_from_ap(dst: MacAddress, bssid: MacAddress, src: MacAddress) -> Self
Create a Data frame builder (from AP: from_DS=1).
Sourcepub fn qos_data_to_ap(
bssid: MacAddress,
src: MacAddress,
dst: MacAddress,
) -> Self
pub fn qos_data_to_ap( bssid: MacAddress, src: MacAddress, dst: MacAddress, ) -> Self
Create a QoS Data frame builder (to AP: to_DS=1).
Sourcepub fn data_wds(
ra: MacAddress,
ta: MacAddress,
da: MacAddress,
sa: MacAddress,
) -> Self
pub fn data_wds( ra: MacAddress, ta: MacAddress, da: MacAddress, sa: MacAddress, ) -> Self
Create a WDS Data frame builder (to_DS=1, from_DS=1).
Sourcepub fn build_beacon(
bssid: MacAddress,
timestamp: u64,
beacon_interval: u16,
capability: u16,
ies: &[Dot11Elt],
) -> Vec<u8> ⓘ
pub fn build_beacon( bssid: MacAddress, timestamp: u64, beacon_interval: u16, capability: u16, ies: &[Dot11Elt], ) -> Vec<u8> ⓘ
Build a beacon frame with the given body parameters and IEs.
Sourcepub fn build_probe_request(src: MacAddress, ies: &[Dot11Elt]) -> Vec<u8> ⓘ
pub fn build_probe_request(src: MacAddress, ies: &[Dot11Elt]) -> Vec<u8> ⓘ
Build a probe request frame with the given IEs.
Sourcepub fn build_probe_response(
dst: MacAddress,
bssid: MacAddress,
timestamp: u64,
beacon_interval: u16,
capability: u16,
ies: &[Dot11Elt],
) -> Vec<u8> ⓘ
pub fn build_probe_response( dst: MacAddress, bssid: MacAddress, timestamp: u64, beacon_interval: u16, capability: u16, ies: &[Dot11Elt], ) -> Vec<u8> ⓘ
Build a probe response frame with the given body parameters and IEs.
Sourcepub fn build_auth(
dst: MacAddress,
src: MacAddress,
bssid: MacAddress,
algo: u16,
seqnum: u16,
status: u16,
) -> Vec<u8> ⓘ
pub fn build_auth( dst: MacAddress, src: MacAddress, bssid: MacAddress, algo: u16, seqnum: u16, status: u16, ) -> Vec<u8> ⓘ
Build an authentication frame.
Sourcepub fn build_deauth(
dst: MacAddress,
src: MacAddress,
bssid: MacAddress,
reason: u16,
) -> Vec<u8> ⓘ
pub fn build_deauth( dst: MacAddress, src: MacAddress, bssid: MacAddress, reason: u16, ) -> Vec<u8> ⓘ
Build a deauthentication frame.
Sourcepub fn build_assoc_request(
dst: MacAddress,
src: MacAddress,
capability: u16,
listen_interval: u16,
ies: &[Dot11Elt],
) -> Vec<u8> ⓘ
pub fn build_assoc_request( dst: MacAddress, src: MacAddress, capability: u16, listen_interval: u16, ies: &[Dot11Elt], ) -> Vec<u8> ⓘ
Build an association request frame.
Sourcepub fn build_assoc_response(
dst: MacAddress,
bssid: MacAddress,
capability: u16,
status: u16,
aid: u16,
ies: &[Dot11Elt],
) -> Vec<u8> ⓘ
pub fn build_assoc_response( dst: MacAddress, bssid: MacAddress, capability: u16, status: u16, aid: u16, ies: &[Dot11Elt], ) -> Vec<u8> ⓘ
Build an association response frame.
Sourcepub fn build_qos_data(
bssid: MacAddress,
src: MacAddress,
dst: MacAddress,
tid: u8,
payload: &[u8],
) -> Vec<u8> ⓘ
pub fn build_qos_data( bssid: MacAddress, src: MacAddress, dst: MacAddress, tid: u8, payload: &[u8], ) -> Vec<u8> ⓘ
Build a data frame with QoS header.
Trait Implementations§
Source§impl Clone for Dot11Builder
impl Clone for Dot11Builder
Source§fn clone(&self) -> Dot11Builder
fn clone(&self) -> Dot11Builder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Dot11Builder
impl Debug for Dot11Builder
Auto Trait Implementations§
impl Freeze for Dot11Builder
impl RefUnwindSafe for Dot11Builder
impl Send for Dot11Builder
impl Sync for Dot11Builder
impl Unpin for Dot11Builder
impl UnsafeUnpin for Dot11Builder
impl UnwindSafe for Dot11Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more