Skip to main content

Radio

Struct Radio 

Source
pub struct Radio { /* private fields */ }
Expand description

An 802.11 interface’s Action frames, through nl80211.

Implementations§

Source§

impl Radio

Source

pub fn open(interface: &str) -> Result<Self>

Opens interface’s radio, listening for the transmit status of the frames it sends and for stations joining and leaving. Registering for frames and stamping them need CAP_NET_ADMIN.

Source

pub fn address(&self) -> MacAddress

The interface’s own address.

Source

pub fn access_point(&self) -> Result<bool>

Whether the interface is an access point, not a station.

Source

pub fn stations(&self) -> Result<Vec<MacAddress>>

The stations associated with the access point, or on a station the access point it is associated with.

Source

pub fn register_action(&self, prefix: &[u8]) -> Result<()>

Has Action frames starting with prefix (their Category, then action and more as needed) come to this radio as Event::Frame. Fails if another program already takes frames that overlap.

Source

pub fn set_hw_timestamp(&self, peer: MacAddress, enable: bool) -> Result<()>

Has the radio stamp the Timing Measurement and Fine Timing Measurement frames to and from peer, or stop.

Source

pub fn send_action( &self, destination: MacAddress, bssid: MacAddress, action: &[u8], ) -> Result<u64>

Sends an Action frame, action from its Category on, to destination in the BSS bssid (the access point’s address), returning the cookie its Event::TxStatus will carry.

Source

pub fn take(&self) -> Result<Option<Event>>

The next word from the radio, without blocking.

Trait Implementations§

Source§

impl AsFd for Radio

Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more

Auto Trait Implementations§

§

impl !Freeze for Radio

§

impl !RefUnwindSafe for Radio

§

impl !Sync for Radio

§

impl Forget for Radio

§

impl Move for Radio

§

impl Send for Radio

§

impl Unpin for Radio

§

impl UnsafeUnpin for Radio

§

impl UnwindSafe for Radio

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.