Movatterモバイル変換


[0]ホーム

URL:


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

[WIP] uefi-raw: move types to new net module, improve convenience#1699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
phip1611 wants to merge6 commits intomain
base:main
Choose a base branch
Loading
fromcore-net-v2

Conversation

phip1611
Copy link
Member

@phip1611phip1611 commentedJun 15, 2025
edited
Loading

This prepares my vision for#1575, a split-out from#1645, and a change to uefi-raw in the sense that some types now have slightly more higher-level logic. This "higher-level" logic is still low-level enough that I think it is perfectly fine to keep it. It will also not hinder Rust-based UEFI implementations.

TL;DR: My vision is that inuefi we only exposecore::net::{IpAddr, Ipv4Addr, Ipv6Addr} and protocol implementations can useFrom/Into to do all the necessary work under the hood.

Let me know what you think!

List of Changes

  • refactored theIpAddress type to be more convenient, more memory-safe, and pleasant to use
  • added lots of convenientFrom implementations
  • relaxed somecargo xtask check-raw requirements

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See theRewriting History guide for help.
  • Update the changelog (if necessary)

We have enough network-related types to justifya dedicated module:- IpAddress- Ipv4Address- Ipv6Address- MacAddressAnd lots of corresponding impl{} blocks, tests, etc.
The union makes some things hard to work with, and we cansimply remove it. We get multiple advantages from that:- no more chance to have uninitialized bytes- We can `Debug`-print the type- Some implementations become simpler
This helps to better understand why something fails.
check-raw is very strict. Relaxing it gives uefi-raw morefreedom, which is especially needed for the more high-levelIpAddress type changes.

## Changed
- Types `MacAddress`, `IpAddress`, `Ipv4Address`, and `Ipv6Address` were moved
from `uefi_raw::*` to `uefi_raw::net::*`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think moving the implementation to a new module makes sense, but I think for the public API it might make sense to let that be an internal detail, i.e. keep thenet module private and pub-export the types from the crate root. These types are listed in theCommon UEFI Data Types portion of the spec, which to mind means they fit best at the top level (and this would also avoid making the change API breaking).

phip1611 reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I agree, makes sense!

@phip1611phip1611 marked this pull request as draftJuly 9, 2025 10:53
@phip1611phip1611 changed the titleuefi-raw: move types to new net module, improve convenience[WIP] uefi-raw: move types to new net module, improve convenienceJul 9, 2025
@phip1611
Copy link
MemberAuthor

phip1611 commentedJul 9, 2025
edited
Loading

For the record. Starting Friday, I'll be on vacation until July 30th. My plan is to program-detox for the whole period 😀 Restarting the work afterwards

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicholasbishopnicholasbishopnicholasbishop left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@phip1611@nicholasbishop

[8]ページ先頭

©2009-2025 Movatter.jp