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

Appearance settings

RFC: use core::net IP address types in uefi's public API #1575

Copy link
Copy link
@nicholasbishop

Description

@nicholasbishop
Issue body actions

Currently, we provide the following IP address types:

  • uefi-raw:

  • uefi:

    • struct IpAddress - 16 raw bytes. Compatible with the uefi_raw::IpAddress union, but implemented differently. No way to tell which type of address it is without out-of-band data
  • And these builtin types are in core::net:

The types in uefi-raw correctly match the spec, so there's nothing we need to change there.

In uefi however, I think it might make sense to switch to the core::net types in the public API, and drop our IpAddress. The core::net types are not ABI-compatible with the UEFI types, so internally we'll need to translate between them. This should be a very low-cost operation though.

Using the IpAddr enum provides a better experience than using an untagged enum that requires a separate flag to indicate which type of address it contains. We could define our own enum of course, but using core::net makes it easier to integrate with other Rust code by using a shared type.

This change would be an API break, but it only affects a fairly small part of the library (the SimpleNetwork and pxe::BaseCode protocols).

phip1611

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.