Skip to content

Commit f42dad3

Browse files
uefi-raw: Add Ipv4Address, Ipv6Address, and MacAddress types
These are defined in "Common UEFI Data Types" part of the spec, so put them in the root of the crate.
1 parent e25c4b8 commit f42dad3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

uefi-raw/src/lib.rs

Lines changed: 15 additions & 0 deletions
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)