#[repr(C)]pub struct SimpleNetwork { /* private fields */ }
Expand description
The Simple Network Protocol
Implementations§
source§impl SimpleNetwork
impl SimpleNetwork
sourcepub fn stop(&self) -> Result
pub fn stop(&self) -> Result
Change the state of a network interface from “Started” to “Stopped”.
sourcepub fn initialize(
&self,
extra_rx_buffer_size: usize,
extra_tx_buffer_size: usize
) -> Result
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.
sourcepub fn reset(&self, extended_verification: bool) -> Result
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
.
sourcepub fn shutdown(&self) -> Result
pub fn shutdown(&self) -> Result
Reset a network adapter, leaving it in a state that is safe for another driver to initialize
sourcepub fn receive_filters(
&self,
enable: ReceiveFlags,
disable: ReceiveFlags,
reset_mcast_filter: bool,
mcast_filter: Option<&[MacAddress]>
) -> Result
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.
sourcepub fn station_address(&self, reset: bool, new: Option<&MacAddress>) -> Result
pub fn station_address(&self, reset: bool, new: Option<&MacAddress>) -> Result
Modify or reset the current station address, if supported.
sourcepub fn reset_statistics(&self) -> Result
pub fn reset_statistics(&self) -> Result
Reset statistics on a network interface.
sourcepub fn collect_statistics(&self) -> Result<NetworkStats>
pub fn collect_statistics(&self) -> Result<NetworkStats>
Collect statistics on a network interface.
sourcepub fn mcast_ip_to_mac(&self, ipv6: bool, ip: IpAddress) -> Result<MacAddress>
pub fn mcast_ip_to_mac(&self, ipv6: bool, ip: IpAddress) -> Result<MacAddress>
Convert a multicast IP address to a multicast HW MAC Address.
sourcepub fn read_nv_data(&self, offset: usize, buffer: &[u8]) -> Result
pub fn read_nv_data(&self, offset: usize, buffer: &[u8]) -> Result
Perform read operations on the NVRAM device attached to a network interface.
sourcepub fn write_nv_data(&self, offset: usize, buffer: &mut [u8]) -> Result
pub fn write_nv_data(&self, offset: usize, buffer: &mut [u8]) -> Result
Perform write operations on the NVRAM device attached to a network interface.
sourcepub fn get_interrupt_status(&self) -> Result<InterruptStatus>
pub fn get_interrupt_status(&self) -> Result<InterruptStatus>
Read the current interrupt status and recycled transmit buffer status from a network interface.
sourcepub fn get_recycled_transmit_buffer_status(&self) -> Result<Option<NonNull<u8>>>
pub fn get_recycled_transmit_buffer_status(&self) -> Result<Option<NonNull<u8>>>
Read the current recycled transmit buffer status from a network interface.
sourcepub fn transmit(
&self,
header_size: usize,
buffer: &[u8],
src_addr: Option<MacAddress>,
dest_addr: Option<MacAddress>,
protocol: Option<u16>
) -> Result
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.
sourcepub 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>
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.
sourcepub fn wait_for_packet(&self) -> &Event
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.
sourcepub fn mode(&self) -> &NetworkMode
pub fn mode(&self) -> &NetworkMode
Returns a reference to the Simple Network mode.