Struct uefi::proto::network::snp::SimpleNetwork

source ·
#[repr(C)]
pub struct SimpleNetwork { /* private fields */ }
Expand description

The Simple Network Protocol

Implementations§

source§

impl SimpleNetwork

source

pub fn start(&self) -> Result

Change the state of a network from “Stopped” to “Started”.

source

pub fn stop(&self) -> Result

Change the state of a network interface from “Started” to “Stopped”.

source

pub fn initialize( &self, extra_rx_buffer_size: usize, extra_tx_buffer_size: usize ) -> Result

Reset a network adapter and allocate the transmit and receive buffers required by the network interface; optionally, also request allocation of additional transmit and receive buffers.

source

pub fn reset(&self, extended_verification: bool) -> Result

Reset a network adapter and reinitialize it with the parameters that were provided in the previous call to initialize.

source

pub fn shutdown(&self) -> Result

Reset a network adapter, leaving it in a state that is safe for another driver to initialize

source

pub fn receive_filters( &self, enable: ReceiveFlags, disable: ReceiveFlags, reset_mcast_filter: bool, mcast_filter: Option<&[MacAddress]> ) -> Result

Manage the multicast receive filters of a network.

source

pub fn station_address(&self, reset: bool, new: Option<&MacAddress>) -> Result

Modify or reset the current station address, if supported.

source

pub fn reset_statistics(&self) -> Result

Reset statistics on a network interface.

source

pub fn collect_statistics(&self) -> Result<NetworkStats>

Collect statistics on a network interface.

source

pub fn mcast_ip_to_mac(&self, ipv6: bool, ip: IpAddress) -> Result<MacAddress>

Convert a multicast IP address to a multicast HW MAC Address.

source

pub fn read_nv_data(&self, offset: usize, buffer: &[u8]) -> Result

Perform read operations on the NVRAM device attached to a network interface.

source

pub fn write_nv_data(&self, offset: usize, buffer: &mut [u8]) -> Result

Perform write operations on the NVRAM device attached to a network interface.

source

pub fn get_interrupt_status(&self) -> Result<InterruptStatus>

Read the current interrupt status and recycled transmit buffer status from a network interface.

source

pub fn get_recycled_transmit_buffer_status(&self) -> Result<Option<NonNull<u8>>>

Read the current recycled transmit buffer status from a network interface.

source

pub fn transmit( &self, header_size: usize, buffer: &[u8], src_addr: Option<MacAddress>, dest_addr: Option<MacAddress>, protocol: Option<u16> ) -> Result

Place a packet in the transmit queue of a network interface.

source

pub fn receive( &self, buffer: &mut [u8], header_size: Option<&mut usize>, src_addr: Option<&mut MacAddress>, dest_addr: Option<&mut MacAddress>, protocol: Option<&mut u16> ) -> Result<usize>

Receive a packet from a network interface.

On success, returns the size of bytes of the received packet.

source

pub fn wait_for_packet(&self) -> &Event

Event that fires once a packet is available to be received.

On QEMU, this event seems to never fire; it is suggested to verify that your implementation of UEFI properly implements this event before using it.

source

pub fn mode(&self) -> &NetworkMode

Returns a reference to the Simple Network mode.

Trait Implementations§

source§

impl Debug for SimpleNetwork

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Identify for SimpleNetwork

source§

const GUID: Guid = _

Unique protocol identifier.
source§

impl Protocol for SimpleNetwork

Auto Trait Implementations§

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> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<P> ProtocolPointer for P
where P: Protocol,

source§

unsafe fn ptr_from_ffi(ptr: *const c_void) -> *const P

Create a const pointer to a Protocol from a c_void pointer. Read more
source§

unsafe fn mut_ptr_from_ffi(ptr: *mut c_void) -> *mut P

Create a mutable pointer to a Protocol from a c_void pointer. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.