diff --git a/uefi-raw/CHANGELOG.md b/uefi-raw/CHANGELOG.md index 77ac9a0da..b8ac8be73 100644 --- a/uefi-raw/CHANGELOG.md +++ b/uefi-raw/CHANGELOG.md @@ -1,5 +1,8 @@ # uefi-raw - [Unreleased] +## Added +- Added `Ipv4Address`, `Ipv6Address`, and `MacAddress` types. + # uefi-raw - 0.5.0 (2023-11-12) ## Added diff --git a/uefi-raw/src/lib.rs b/uefi-raw/src/lib.rs index 1c2f3a4bd..b464323a3 100644 --- a/uefi-raw/src/lib.rs +++ b/uefi-raw/src/lib.rs @@ -57,3 +57,18 @@ pub type PhysicalAddress = u64; /// Virtual memory address. This is always a 64-bit value, regardless /// of target platform. pub type VirtualAddress = u64; + +/// An IPv4 internet protocol address. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[repr(transparent)] +pub struct Ipv4Address(pub [u8; 4]); + +/// An IPv6 internet protocol address. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[repr(transparent)] +pub struct Ipv6Address(pub [u8; 16]); + +/// A Media Access Control (MAC) address. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[repr(transparent)] +pub struct MacAddress(pub [u8; 32]);