File tree 4 files changed +209
-45
lines changed
uefi-test-runner/src/proto/network
4 files changed +209
-45
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ pub fn test() {
24
24
. dhcp ( false )
25
25
. expect ( "failed to complete a dhcpv4 handshake" ) ;
26
26
27
- assert ! ( base_code. mode( ) . dhcp_ack_received) ;
28
- let dhcp_ack: & DhcpV4Packet = base_code. mode ( ) . dhcp_ack . as_ref ( ) ;
27
+ assert ! ( base_code. mode( ) . dhcp_ack_received( ) ) ;
28
+ let dhcp_ack: & DhcpV4Packet = base_code. mode ( ) . dhcp_ack ( ) . as_ref ( ) ;
29
29
let server_ip = dhcp_ack. bootp_si_addr ;
30
30
let server_ip = IpAddress :: new_v4 ( server_ip) ;
31
31
@@ -75,7 +75,7 @@ pub fn test() {
75
75
76
76
let mut src_ip = server_ip;
77
77
let mut src_port = EXAMPLE_SERVICE_PORT ;
78
- let mut dest_ip = base_code. mode ( ) . station_ip ;
78
+ let mut dest_ip = base_code. mode ( ) . station_ip ( ) ;
79
79
let mut dest_port = write_src_port;
80
80
let mut header = [ 0 ; 1 ] ;
81
81
let mut received = [ 0 ; 4 ] ;
Original file line number Diff line number Diff line change 12
12
- ** Breaking:** The ` pxe::BaseCode::tftp_read_dir ` and
13
13
` pxe::BaseCode::mtftp_read_dir ` methods now take ` &mut self ` instead of
14
14
` &self ` .
15
+ - ** Breaking:** The ` pxe::Mode ` struct is now opaque. Use method calls to access
16
+ mode data instead of direct field access.
15
17
- ` boot::memory_map() ` will never return ` Status::BUFFER_TOO_SMALL ` from now on,
16
18
as this is considered a hard internal error where users can't do anything
17
19
about it anyway. It will panic instead.
Original file line number Diff line number Diff line change @@ -34,6 +34,20 @@ impl IpAddress {
34
34
Self ( ip_addr)
35
35
}
36
36
37
+ /// Construct from a `uefi_raw::IpAddress` union.
38
+ ///
39
+ /// # Safety
40
+ ///
41
+ /// `is_ipv6` must accurately reflect how the union was initialized.
42
+ #[ must_use]
43
+ const unsafe fn from_raw ( ip_addr : uefi_raw:: IpAddress , is_ipv6 : bool ) -> Self {
44
+ if is_ipv6 {
45
+ Self :: new_v6 ( unsafe { ip_addr. v6 . 0 } )
46
+ } else {
47
+ Self :: new_v4 ( unsafe { ip_addr. v4 . 0 } )
48
+ }
49
+ }
50
+
37
51
#[ must_use]
38
52
const fn as_raw_ptr ( & self ) -> * const uefi_raw:: IpAddress {
39
53
// The uefi-raw type is defined differently, but the layout is
You can’t perform that action at this time.
0 commit comments