Conversation
|
Thanks for your contribution! I'll look hopefully next week into this, as I'm at the EuroRust conference. |
| pub mod ip4_config2; | ||
| pub mod pxe; | ||
| pub mod snp; | ||
| pub mod tcpv4; |
There was a problem hiding this comment.
Let's split the uefi-raw changes into a separate PR, we can review and merge that first. See https://github.com/rust-osdev/uefi-rs/blob/main/uefi-raw/api_guidelines.md for some general guidance on uefi-raw.
There was a problem hiding this comment.
Good call. I actually looked around for some guidelines and missed that document, thanks for pointing it out.
| #[derive(Debug)] | ||
| #[repr(C)] | ||
| pub struct Tcpv4AccessPoint { | ||
| pub use_default_address: bool, |
There was a problem hiding this comment.
| pub use_default_address: bool, | |
| pub use_default_address: Boolean, |
(from crate::Boolean)
| } | ||
|
|
||
| impl Tcpv4AccessPoint { | ||
| pub fn new(connection_mode: Tcpv4ConnectionMode) -> Tcpv4AccessPoint { |
There was a problem hiding this comment.
The uefi-raw API should stick closely to the spec; convenience methods like this should generally go in uefi instead.
| pub type_of_service: u8, | ||
| pub time_to_live: u8, | ||
| pub access_point: Tcpv4AccessPoint, | ||
| pub option: Option<&'a Tcpv4Option>, |
There was a problem hiding this comment.
Use raw pointers in uefi-raw
There was a problem hiding this comment.
Ok, I had a suspicion that was the case. I'll refactor the PR with your earlier comments.
There was a problem hiding this comment.
Several of these uefi-raw tcp structs will need to be built by the end user of the high-level uefi api. How should I make that fool proof?
- define equivalent high-level config structs that converted to raw structs?
- implement builder pattern on newtype that wraps the raw struct?
- other?
There was a problem hiding this comment.
define equivalent high-level config structs that converted to raw structs?
This is probably the most common choice. I think there are a few places we use the builder pattern, but wrapper struct is usually simpler.
This PR implements the UEFI TCPv4 protocol, building upon #1130. As-is, the code performs well in a custom bootloader.
Overview
This implementation adds support for the
EFI_TCP4_PROTOCOLandEFI_TCP4_SERVICE_BINDING_PROTOCOLas defined in the UEFI specification (Section 28.1). It enables UEFI applications to establish TCP connections, transmit and receive data over the network.Changes
uefi-rawClosed,Listen,SynSent,Established, etc.)uefiTcpv4ServiceBindingfor creating TCP protocol instancesTcpv4protocol wrapper with higher-level APIreceive_exact()for reading exact byte countsKey Features
Connection Modes: Support for both client and server TCP connections
Async Operations: All I/O operations wrap async operations in high-level sync interface
DHCP Integration: Automatic retry logic when DHCP is still configuring the network
NO_MAPPINGstatus during network initializationExample Usage
Current Limitations
UnmodelledPtr(implementation pending)UnmodelledPtr(implementation pending)Future Work
accept) implementation (low priority)Checklist
Closes #1130