libwifi 0.5.0

A library for parsing IEEE 802.11 frames and handling wifi interfaces.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::frame::components::MacAddress;
use crate::frame::*;
use enum_dispatch::enum_dispatch;

/// Helper trait to easily access source, destination and bssid on frames.
#[enum_dispatch]
pub trait Addresses {
    /// Returns the sender of the Frame.
    /// This isn't always send in every frame (e.g. CTS).
    fn src(&self) -> Option<&MacAddress>;

    /// Returns the destination of the Frame.
    /// This should always be present.
    fn dest(&self) -> &MacAddress;

    /// This isn't always send in every frame (e.g. RTS).
    fn bssid(&self) -> Option<&MacAddress>;
}