@@ -13,13 +13,15 @@ use crate::proto::unsafe_protocol;
13
13
use crate :: util:: ptr_write_unaligned_and_add;
14
14
use bitflags:: bitflags;
15
15
use ptr_meta:: Pointee ;
16
+ use uefi_raw:: protocol:: network:: pxe:: PxeBaseCodeTftpOpcode ;
16
17
17
18
use crate :: { CStr8 , Char8 , Result , Status , StatusExt } ;
18
19
19
20
use super :: { IpAddress , MacAddress } ;
20
21
21
22
pub use uefi_raw:: protocol:: network:: pxe:: {
22
- PxeBaseCodeIpFilterFlags as IpFilters , PxeBaseCodeUdpOpFlags as UdpOpFlags ,
23
+ PxeBaseCodeBootType as BootstrapType , PxeBaseCodeIpFilterFlags as IpFilters ,
24
+ PxeBaseCodeUdpOpFlags as UdpOpFlags ,
23
25
} ;
24
26
25
27
/// PXE Base Code protocol
@@ -41,7 +43,7 @@ pub struct BaseCode {
41
43
) -> Status ,
42
44
mtftp : unsafe extern "efiapi" fn (
43
45
this : & Self ,
44
- operation : TftpOpcode ,
46
+ operation : PxeBaseCodeTftpOpcode ,
45
47
buffer : * mut c_void ,
46
48
overwrite : bool ,
47
49
buffer_size : & mut u64 ,
@@ -156,7 +158,7 @@ impl BaseCode {
156
158
let status = unsafe {
157
159
( self . mtftp ) (
158
160
self ,
159
- TftpOpcode :: TftpGetFileSize ,
161
+ PxeBaseCodeTftpOpcode :: TFTP_GET_FILE_SIZE ,
160
162
null_mut ( ) ,
161
163
false ,
162
164
& mut buffer_size,
@@ -187,7 +189,7 @@ impl BaseCode {
187
189
let status = unsafe {
188
190
( self . mtftp ) (
189
191
self ,
190
- TftpOpcode :: TftpReadFile ,
192
+ PxeBaseCodeTftpOpcode :: TFTP_READ_FILE ,
191
193
buffer_ptr,
192
194
false ,
193
195
& mut buffer_size,
@@ -215,7 +217,7 @@ impl BaseCode {
215
217
unsafe {
216
218
( self . mtftp ) (
217
219
self ,
218
- TftpOpcode :: TftpWriteFile ,
220
+ PxeBaseCodeTftpOpcode :: TFTP_WRITE_FILE ,
219
221
buffer_ptr,
220
222
overwrite,
221
223
& mut buffer_size,
@@ -243,7 +245,7 @@ impl BaseCode {
243
245
let status = unsafe {
244
246
( self . mtftp ) (
245
247
self ,
246
- TftpOpcode :: TftpReadDirectory ,
248
+ PxeBaseCodeTftpOpcode :: TFTP_READ_DIRECTORY ,
247
249
buffer_ptr,
248
250
false ,
249
251
& mut buffer_size,
@@ -316,7 +318,7 @@ impl BaseCode {
316
318
let status = unsafe {
317
319
( self . mtftp ) (
318
320
self ,
319
- TftpOpcode :: MtftpGetFileSize ,
321
+ PxeBaseCodeTftpOpcode :: MTFTP_GET_FILE_SIZE ,
320
322
null_mut ( ) ,
321
323
false ,
322
324
& mut buffer_size,
@@ -348,7 +350,7 @@ impl BaseCode {
348
350
let status = unsafe {
349
351
( self . mtftp ) (
350
352
self ,
351
- TftpOpcode :: MtftpReadFile ,
353
+ PxeBaseCodeTftpOpcode :: MTFTP_READ_FILE ,
352
354
buffer_ptr,
353
355
false ,
354
356
& mut buffer_size,
@@ -376,7 +378,7 @@ impl BaseCode {
376
378
let status = unsafe {
377
379
( self . mtftp ) (
378
380
self ,
379
- TftpOpcode :: MtftpReadDirectory ,
381
+ PxeBaseCodeTftpOpcode :: MTFTP_READ_DIRECTORY ,
380
382
buffer_ptr,
381
383
false ,
382
384
& mut buffer_size,
@@ -616,38 +618,6 @@ impl BaseCode {
616
618
}
617
619
}
618
620
619
- /// A type of bootstrap to perform in [`BaseCode::discover`].
620
- ///
621
- /// Corresponds to the `EFI_PXE_BASE_CODE_BOOT_` constants in the C API.
622
- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash ) ]
623
- #[ repr( u16 ) ]
624
- #[ allow( missing_docs) ]
625
- pub enum BootstrapType {
626
- Bootstrap = 0 ,
627
- MsWinntRis = 1 ,
628
- IntelLcm = 2 ,
629
- DosUndi = 3 ,
630
- NecEsmpro = 4 ,
631
- IbmWsoD = 5 ,
632
- IbmLccm = 6 ,
633
- CaUnicenterTng = 7 ,
634
- HpOpenview = 8 ,
635
- Altiris9 = 9 ,
636
- Altiris10 = 10 ,
637
- Altiris11 = 11 ,
638
- // NOT_USED_12 = 12,
639
- RedhatInstall = 13 ,
640
- RedhatBoot = 14 ,
641
- Rembo = 15 ,
642
- Beoboot = 16 ,
643
- //
644
- // Values 17 through 32767 are reserved.
645
- // Values 32768 through 65279 are for vendor use.
646
- // Values 65280 through 65534 are reserved.
647
- //
648
- PxeTest = 65535 ,
649
- }
650
-
651
621
opaque_type ! {
652
622
/// Opaque type that should be used to represent a pointer to a [`DiscoverInfo`] in
653
623
/// foreign function interfaces. This type produces a thin pointer, unlike
@@ -798,18 +768,6 @@ impl Server {
798
768
}
799
769
}
800
770
801
- /// Corresponds to the `EFI_PXE_BASE_CODE_TFTP_OPCODE` type in the C API.
802
- #[ repr( C ) ]
803
- enum TftpOpcode {
804
- TftpGetFileSize = 1 ,
805
- TftpReadFile ,
806
- TftpWriteFile ,
807
- TftpReadDirectory ,
808
- MtftpGetFileSize ,
809
- MtftpReadFile ,
810
- MtftpReadDirectory ,
811
- }
812
-
813
771
/// MTFTP connection parameters
814
772
///
815
773
/// Corresponds to the `EFI_PXE_BASE_CODE_MTFTP_INFO` type in the C API.
0 commit comments