@@ -14,7 +14,7 @@ use core::iter::from_fn;
14
14
use core:: mem:: MaybeUninit ;
15
15
use core:: ptr:: { self , null, null_mut} ;
16
16
use ptr_meta:: Pointee ;
17
- use uefi_raw:: protocol:: network:: pxe:: PxeBaseCodeTftpOpcode ;
17
+ use uefi_raw:: protocol:: network:: pxe:: { PxeBaseCodePacket , PxeBaseCodeTftpOpcode } ;
18
18
use uefi_raw:: { Boolean , Char8 } ;
19
19
20
20
pub use uefi_raw:: protocol:: network:: pxe:: {
@@ -103,12 +103,12 @@ pub struct BaseCode {
103
103
new_pxe_discover_valid : * const Boolean ,
104
104
new_pxe_reply_received : * const Boolean ,
105
105
new_pxe_bis_reply_received : * const Boolean ,
106
- new_dhcp_discover : Option < & Packet > ,
107
- new_dhcp_ack : Option < & Packet > ,
108
- new_proxy_offer : Option < & Packet > ,
109
- new_pxe_discover : Option < & Packet > ,
110
- new_pxe_reply : Option < & Packet > ,
111
- new_pxe_bis_reply : Option < & Packet > ,
106
+ new_dhcp_discover : * const PxeBaseCodePacket ,
107
+ new_dhcp_ack : * const PxeBaseCodePacket ,
108
+ new_proxy_offer : * const PxeBaseCodePacket ,
109
+ new_pxe_discover : * const PxeBaseCodePacket ,
110
+ new_pxe_reply : * const PxeBaseCodePacket ,
111
+ new_pxe_bis_reply : * const PxeBaseCodePacket ,
112
112
) -> Status ,
113
113
mode : * const Mode ,
114
114
}
@@ -609,12 +609,12 @@ impl BaseCode {
609
609
opt_bool_to_ptr ( & new_pxe_discover_valid) ,
610
610
opt_bool_to_ptr ( & new_pxe_reply_received) ,
611
611
opt_bool_to_ptr ( & new_pxe_bis_reply_received) ,
612
- new_dhcp_discover,
613
- new_dhcp_ack,
614
- new_proxy_offer,
615
- new_pxe_discover,
616
- new_pxe_reply,
617
- new_pxe_bis_reply,
612
+ opt_packet_to_ptr ( new_dhcp_discover) ,
613
+ opt_packet_to_ptr ( new_dhcp_ack) ,
614
+ opt_packet_to_ptr ( new_proxy_offer) ,
615
+ opt_packet_to_ptr ( new_pxe_discover) ,
616
+ opt_packet_to_ptr ( new_pxe_reply) ,
617
+ opt_packet_to_ptr ( new_pxe_bis_reply) ,
618
618
)
619
619
}
620
620
. to_result ( )
@@ -651,6 +651,11 @@ fn opt_ip_addr_to_ptr_mut(arg: Option<&mut IpAddress>) -> *mut uefi_raw::IpAddre
651
651
arg. map ( |arg| arg. as_raw_ptr_mut ( ) ) . unwrap_or_else ( null_mut)
652
652
}
653
653
654
+ /// Convert an `Option<&Packet>` to a `*const PxeBaseCodePacket`.
655
+ fn opt_packet_to_ptr ( arg : Option < & Packet > ) -> * const PxeBaseCodePacket {
656
+ arg. map ( |p| ptr:: from_ref ( p) . cast ( ) ) . unwrap_or_else ( null)
657
+ }
658
+
654
659
opaque_type ! {
655
660
/// Opaque type that should be used to represent a pointer to a [`DiscoverInfo`] in
656
661
/// foreign function interfaces. This type produces a thin pointer, unlike
0 commit comments