Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0a67eeb

Browse files
committed
uefi-raw: improve doc
1 parent d2d52fa commit 0a67eeb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

‎uefi-raw/src/net.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
//! UEFI network types.
4+
//!
5+
//! The main exports of this module are:
6+
//! - [`MacAddress`]
7+
//! - [`IpAddress`]
8+
//! - [`Ipv4Address`]
9+
//! - [`Ipv6Address`]
410
511
use core::fmt;
612
use core::fmt::{Debug, Formatter};
@@ -39,7 +45,7 @@ impl From<Ipv6Address> for core::net::Ipv6Addr {
3945
}
4046
}
4147

42-
/// An IPv4 or IPv6 internet protocol address.
48+
/// An IPv4 or IPv6 internet protocol address that is ABI compatible with EFI.
4349
///
4450
/// Corresponds to the `EFI_IP_ADDRESS` type in the UEFI specification. This
4551
/// type is defined in the same way as edk2 for compatibility with C code. Note
@@ -106,7 +112,15 @@ impl From<core::net::IpAddr> for IpAddress {
106112
}
107113
}
108114

109-
/// A Media Access Control (MAC) address.
115+
/// UEFI Media Access Control (MAC) address.
116+
///
117+
/// UEFI supports multiple network protocols and hardware types, not just
118+
/// Ethernet. Some of them may use MAC addresses longer than 6 bytes. To be
119+
/// protocol-agnostic and future-proof, the UEFI spec chooses a maximum size
120+
/// that can hold any supported media access control address.
121+
///
122+
/// In most cases, this is just a typical `[u8; 6]` Ethernet style MAC
123+
/// address with the rest of the bytes being zero.
110124
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
111125
#[repr(transparent)]
112126
pub struct MacAddress(pub [u8; 32]);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /