Skip to content

Commit b8ee512

Browse files
authored
Merge pull request #1019 from nicholasbishop/bishop-addr-types
uefi-raw: Add Ipv4Address, Ipv6Address, and MacAddress types
2 parents 6db6d99 + 0eba762 commit b8ee512

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Diff for: uefi-raw/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# uefi-raw - [Unreleased]
22

3+
## Added
4+
- Added `Ipv4Address`, `Ipv6Address`, and `MacAddress` types.
5+
36
# uefi-raw - 0.5.0 (2023-11-12)
47

58
## Added

Diff for: uefi-raw/src/lib.rs

+15
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,18 @@ pub type PhysicalAddress = u64;
5757
/// Virtual memory address. This is always a 64-bit value, regardless
5858
/// of target platform.
5959
pub type VirtualAddress = u64;
60+
61+
/// An IPv4 internet protocol address.
62+
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
63+
#[repr(transparent)]
64+
pub struct Ipv4Address(pub [u8; 4]);
65+
66+
/// An IPv6 internet protocol address.
67+
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
68+
#[repr(transparent)]
69+
pub struct Ipv6Address(pub [u8; 16]);
70+
71+
/// A Media Access Control (MAC) address.
72+
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
73+
#[repr(transparent)]
74+
pub struct MacAddress(pub [u8; 32]);

0 commit comments

Comments
 (0)