Struct uefi::proto::network::pxe::BaseCode

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

PXE Base Code protocol

Implementations§

source§

impl BaseCode

source

pub fn start(&mut self, use_ipv6: bool) -> Result

Enables the use of the PXE Base Code Protocol functions.

source

pub fn stop(&mut self) -> Result

Disables the use of the PXE Base Code Protocol functions.

source

pub fn dhcp(&mut self, sort_offers: bool) -> Result

Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6 S.A.R.R (solicit / advertise / request / reply) sequence.

source

pub fn discover( &mut self, ty: BootstrapType, layer: &mut u16, use_bis: bool, info: Option<&DiscoverInfo> ) -> Result

Attempts to complete the PXE Boot Server and/or boot image discovery sequence.

source

pub fn tftp_get_file_size( &mut self, server_ip: &IpAddress, filename: &CStr8 ) -> Result<u64>

Returns the size of a file located on a TFTP server.

source

pub fn tftp_read_file( &mut self, server_ip: &IpAddress, filename: &CStr8, buffer: Option<&mut [u8]> ) -> Result<u64>

Reads a file located on a TFTP server.

source

pub fn tftp_write_file( &mut self, server_ip: &IpAddress, filename: &CStr8, overwrite: bool, buffer: &[u8] ) -> Result

Writes to a file located on a TFTP server.

source

pub fn tftp_read_dir<'a>( &self, server_ip: &IpAddress, directory_name: &CStr8, buffer: &'a mut [u8] ) -> Result<impl Iterator<Item = Result<TftpFileInfo<'a>, ReadDirParseError>> + 'a>

Reads a directory listing of a directory on a TFTP server.

source

pub fn mtftp_get_file_size( &mut self, server_ip: &IpAddress, filename: &CStr8, info: &MtftpInfo ) -> Result<u64>

Returns the size of a file located on a MTFTP server.

source

pub fn mtftp_read_file( &mut self, server_ip: &IpAddress, filename: &CStr8, buffer: Option<&mut [u8]>, info: &MtftpInfo ) -> Result<u64>

Reads a file located on a MTFTP server.

source

pub fn mtftp_read_dir<'a>( &self, server_ip: &IpAddress, buffer: &'a mut [u8], info: &MtftpInfo ) -> Result<impl Iterator<Item = Result<MtftpFileInfo<'a>, ReadDirParseError>> + 'a>

Reads a directory listing of a directory on a MTFTP server.

source

pub fn udp_write( &mut self, op_flags: UdpOpFlags, dest_ip: &IpAddress, dest_port: u16, gateway_ip: Option<&IpAddress>, src_ip: Option<&IpAddress>, src_port: Option<&mut u16>, header: Option<&[u8]>, buffer: &[u8] ) -> Result

Writes a UDP packet to the network interface.

source

pub fn udp_read( &mut self, op_flags: UdpOpFlags, dest_ip: Option<&mut IpAddress>, dest_port: Option<&mut u16>, src_ip: Option<&mut IpAddress>, src_port: Option<&mut u16>, header: Option<&mut [u8]>, buffer: &mut [u8] ) -> Result<usize>

Reads a UDP packet from the network interface.

source

pub fn set_ip_filter(&mut self, new_filter: &IpFilter) -> Result

Updates the IP receive filters of a network device and enables software filtering.

source

pub fn arp( &mut self, ip_addr: &IpAddress, mac_addr: Option<&mut MacAddress> ) -> Result

Uses the ARP protocol to resolve a MAC address.

source

pub fn set_parameters( &mut self, new_auto_arp: Option<bool>, new_send_guid: Option<bool>, new_ttl: Option<u8>, new_tos: Option<u8>, new_make_callback: Option<bool> ) -> Result

Updates the parameters that affect the operation of the PXE Base Code Protocol.

source

pub fn set_station_ip( &mut self, new_station_ip: Option<&IpAddress>, new_subnet_mask: Option<&IpAddress> ) -> Result

Updates the station IP address and/or subnet mask values of a network device.

source

pub fn set_packets( &mut self, new_dhcp_discover_valid: Option<bool>, new_dhcp_ack_received: Option<bool>, new_proxy_offer_received: Option<bool>, new_pxe_discover_valid: Option<bool>, new_pxe_reply_received: Option<bool>, new_pxe_bis_reply_received: Option<bool>, new_dhcp_discover: Option<&Packet>, new_dhcp_ack: Option<&Packet>, new_proxy_offer: Option<&Packet>, new_pxe_discover: Option<&Packet>, new_pxe_reply: Option<&Packet>, new_pxe_bis_reply: Option<&Packet> ) -> Result

Updates the contents of the cached DHCP and Discover packets.

source

pub const fn mode(&self) -> &Mode

Returns a reference to the Mode struct.

Trait Implementations§

source§

impl Debug for BaseCode

source§

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

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

impl Identify for BaseCode

source§

const GUID: Guid = _

Unique protocol identifier.
source§

impl Protocol for BaseCode

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.