pub struct WifiStation { /* private fields */ }Expand description
WiFi station (client) state machine
Implementations§
Source§impl WifiStation
impl WifiStation
Sourcepub fn new(own_addr: MacAddress) -> Self
pub fn new(own_addr: MacAddress) -> Self
Create a new WiFi station
Sourcepub fn current_bss(&self) -> Option<&BssInfo>
pub fn current_bss(&self) -> Option<&BssInfo>
Get current BSS info
Sourcepub fn scan_results(&self) -> &[BssInfo]
pub fn scan_results(&self) -> &[BssInfo]
Get scan results
Sourcepub fn start_scan(&mut self) -> Vec<u8>
pub fn start_scan(&mut self) -> Vec<u8>
Start BSS scanning. Transitions to Scanning state. Returns a probe request frame to send on each channel.
Sourcepub fn process_beacon(&mut self, frame_data: &[u8]) -> Option<BssInfo>
pub fn process_beacon(&mut self, frame_data: &[u8]) -> Option<BssInfo>
Process a received beacon frame and extract BSS information. Returns the parsed BSS info if the frame is valid.
Sourcepub fn authenticate(&mut self, bss: &BssInfo) -> Option<Vec<u8>>
pub fn authenticate(&mut self, bss: &BssInfo) -> Option<Vec<u8>>
Begin 802.11 Open System authentication with the target BSS. Returns authentication frame bytes to send.
Sourcepub fn process_auth_response(&mut self, frame_data: &[u8]) -> bool
pub fn process_auth_response(&mut self, frame_data: &[u8]) -> bool
Process authentication response. On success, transition to Associating. Returns true if authentication succeeded.
Sourcepub fn associate(&mut self) -> Option<Vec<u8>>
pub fn associate(&mut self) -> Option<Vec<u8>>
Send association request to the current BSS. Returns association request frame bytes.
Sourcepub fn process_assoc_response(&mut self, frame_data: &[u8]) -> bool
pub fn process_assoc_response(&mut self, frame_data: &[u8]) -> bool
Process association response. On success, transition to Associated. Returns true if association succeeded.
Sourcepub fn deauthenticate(&mut self, reason: u16) -> Option<Vec<u8>>
pub fn deauthenticate(&mut self, reason: u16) -> Option<Vec<u8>>
Deauthenticate from the current BSS. Returns deauthentication frame bytes.
Sourcepub fn set_connected(&mut self)
pub fn set_connected(&mut self)
Mark station as fully connected (after WPA handshake completes)
Sourcepub fn parse_frame(data: &[u8]) -> Option<(Ieee80211Header, &[u8])>
pub fn parse_frame(data: &[u8]) -> Option<(Ieee80211Header, &[u8])>
Parse a raw 802.11 frame into header + body