Skip to content

uefi-raw and uefi: use core::net types where possible, remove duplicated types #1645

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

phip1611
Copy link
Member

@phip1611 phip1611 commented Apr 21, 2025

This is an attempt to bring the discussion of #1575 one step further. It outlines my vision on how we could simplify the interface.

I removed all dedicated types except for uefi-raws IpAddress. This type is now tightly integrated with core::net::{IpAddr, Ipv4Addr, Ipv6Addr}. I think this is a major step forward in convenience and usability.

Please review this commit-by-commit.

Steps to Undraft

  • Ensure that always all bytes are initialized in the constructors
    -> then we can have a better debug impl

Checklist

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

@phip1611 phip1611 marked this pull request as draft April 21, 2025 08:44
@phip1611 phip1611 changed the title XXX WIP Core net uefi-raw and uefi: use core::net types where possible, remove duplicated types Apr 21, 2025
@phip1611 phip1611 marked this pull request as ready for review April 21, 2025 09:13
@phip1611 phip1611 force-pushed the core-net branch 2 times, most recently from 0b3a947 to 8543063 Compare April 21, 2025 10:53
This simplifies things as we have less types to work with. The overall
convenience is improved and people will be less confused with the
automated imports suggested by their IDE.

As the core::Net types are ABI compatible, and it is unlikely that they
will ever change in core, we should go for this simplification.
@phip1611 phip1611 force-pushed the core-net branch 2 times, most recently from 728dc3b to 6291e95 Compare April 21, 2025 10:57
@phip1611
Copy link
Member Author

phip1611 commented Apr 21, 2025

I personally see this as a major step forward. On the other hand, I'm biased 😁 I'm looking forward to the discussion and other's ideas!

This tightly integrates the type with the Rust standard IpAddr type.
It allows the convenient usage in `uefi` in a later commit.
This does not use core::net::IpAddr in all possible public interfaces.
Although there is opportunity for that, this commit only makes `uefi`
compatible with the new `uefi-raw` type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant