Struct libwifi::frame::components::MacAddress
source · [−]Expand description
This is our representation of a MAC-address
use libwifi::frame::components::MacAddress;
let address = MacAddress([255, 255, 255, 255, 255, 255]);
println!("{}", address.is_broadcast());
// -> true
Tuple Fields
0: [u8; 6]
Implementations
sourceimpl MacAddress
impl MacAddress
sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Check whether this MAC addresses the whole network.
sourcepub fn is_groupcast(&self) -> bool
pub fn is_groupcast(&self) -> bool
Check whether this is a group address. Group addresses start with 01:80:C2::0/24.
sourcepub fn is_ipv4_multicast(&self) -> bool
pub fn is_ipv4_multicast(&self) -> bool
The 01:00:5e::0/18 space is reserved for ipv4 multicast
sourcepub fn is_ipv6_neighborhood_discovery(&self) -> bool
pub fn is_ipv6_neighborhood_discovery(&self) -> bool
33:33::0/24 is used for ipv6 neighborhood discovery.
sourcepub fn is_ipv6_multicast(&self) -> bool
pub fn is_ipv6_multicast(&self) -> bool
The 33:33::0/24 space is reserved for ipv6 multicast
sourcepub fn is_spanning_tree(&self) -> bool
pub fn is_spanning_tree(&self) -> bool
The 01:80:c2::0/18 space is reserved for spanning-tree requests.
sourcepub fn is_real_device(&self) -> bool
pub fn is_real_device(&self) -> bool
A helper function to check whether the mac address is an actual device or just some kind of “meta” mac address.
This function is most likely not complete, but it already covers a cases.
Trait Implementations
sourceimpl Clone for MacAddress
impl Clone for MacAddress
sourcefn clone(&self) -> MacAddress
fn clone(&self) -> MacAddress
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MacAddress
impl Debug for MacAddress
sourceimpl Display for MacAddress
impl Display for MacAddress
Auto Trait Implementations
impl RefUnwindSafe for MacAddress
impl Send for MacAddress
impl Sync for MacAddress
impl Unpin for MacAddress
impl UnwindSafe for MacAddress
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more