#[repr(C)]pub struct BaseCode { /* private fields */ }
Expand description
PXE Base Code protocol
Implementations§
source§impl BaseCode
impl BaseCode
sourcepub fn start(&mut self, use_ipv6: bool) -> Result
pub fn start(&mut self, use_ipv6: bool) -> Result
Enables the use of the PXE Base Code Protocol functions.
sourcepub fn dhcp(&mut self, sort_offers: bool) -> Result
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.
sourcepub fn discover(
&mut self,
ty: BootstrapType,
layer: &mut u16,
use_bis: bool,
info: Option<&DiscoverInfo>
) -> Result
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.
sourcepub fn tftp_get_file_size(
&mut self,
server_ip: &IpAddress,
filename: &CStr8
) -> Result<u64>
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.
sourcepub fn tftp_read_file(
&mut self,
server_ip: &IpAddress,
filename: &CStr8,
buffer: Option<&mut [u8]>
) -> Result<u64>
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.
sourcepub fn tftp_write_file(
&mut self,
server_ip: &IpAddress,
filename: &CStr8,
overwrite: bool,
buffer: &[u8]
) -> Result
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.
sourcepub 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>
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.
sourcepub fn mtftp_get_file_size(
&mut self,
server_ip: &IpAddress,
filename: &CStr8,
info: &MtftpInfo
) -> Result<u64>
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.
sourcepub fn mtftp_read_file(
&mut self,
server_ip: &IpAddress,
filename: &CStr8,
buffer: Option<&mut [u8]>,
info: &MtftpInfo
) -> Result<u64>
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.
sourcepub fn mtftp_read_dir<'a>(
&self,
server_ip: &IpAddress,
buffer: &'a mut [u8],
info: &MtftpInfo
) -> Result<impl Iterator<Item = Result<MtftpFileInfo<'a>, ReadDirParseError>> + 'a>
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.
sourcepub 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
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.
sourcepub 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>
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.
sourcepub fn set_ip_filter(&mut self, new_filter: &IpFilter) -> Result
pub fn set_ip_filter(&mut self, new_filter: &IpFilter) -> Result
Updates the IP receive filters of a network device and enables software filtering.
sourcepub fn arp(
&mut self,
ip_addr: &IpAddress,
mac_addr: Option<&mut MacAddress>
) -> Result
pub fn arp( &mut self, ip_addr: &IpAddress, mac_addr: Option<&mut MacAddress> ) -> Result
Uses the ARP protocol to resolve a MAC address.
sourcepub 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
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.
sourcepub fn set_station_ip(
&mut self,
new_station_ip: Option<&IpAddress>,
new_subnet_mask: Option<&IpAddress>
) -> Result
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.
sourcepub 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
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.