Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions uefi/src/proto/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ impl IpAddress {
pub const fn new_v6(ip_addr: [u8; 16]) -> Self {
Self(ip_addr)
}

#[must_use]
const fn as_raw_ptr(&self) -> *const uefi_raw::IpAddress {
// The uefi-raw type is defined differently, but the layout is
// compatible.
self.0.as_ptr().cast()
}

#[must_use]
fn as_raw_ptr_mut(&mut self) -> *mut uefi_raw::IpAddress {
// The uefi-raw type is defined differently, but the layout is
// compatible.
self.0.as_mut_ptr().cast()
}
}

impl From<core::net::Ipv4Addr> for IpAddress {
Expand Down
Loading