|
1 | 1 | // SPDX-License-Identifier: MIT OR Apache-2.0
|
2 | 2 |
|
3 | 3 | //! UEFI network types.
|
| 4 | +//! |
| 5 | +//! The main exports of this module are: |
| 6 | +//! - [`MacAddress`] |
| 7 | +//! - [`IpAddress`] |
| 8 | +//! - [`Ipv4Address`] |
| 9 | +//! - [`Ipv6Address`] |
4 | 10 |
|
5 | 11 | use core::fmt;
|
6 | 12 | use core::fmt::{Debug, Formatter};
|
@@ -39,7 +45,7 @@ impl From<Ipv6Address> for core::net::Ipv6Addr {
|
39 | 45 | }
|
40 | 46 | }
|
41 | 47 |
|
42 | | -/// An IPv4 or IPv6 internet protocol address. |
| 48 | +/// An IPv4 or IPv6 internet protocol address that is ABI compatible with EFI. |
43 | 49 | ///
|
44 | 50 | /// Corresponds to the `EFI_IP_ADDRESS` type in the UEFI specification. This
|
45 | 51 | /// 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 {
|
106 | 112 | }
|
107 | 113 | }
|
108 | 114 |
|
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. |
110 | 124 | #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
111 | 125 | #[repr(transparent)]
|
112 | 126 | pub struct MacAddress(pub [u8; 32]);
|
|
0 commit comments