TianoCore EDK2 master
Loading...
Searching...
No Matches
HttpBootImpl.c
Go to the documentation of this file.
1
10#include "HttpBootDxe.h"
11
24 )
25{
26 EFI_STATUS Status;
27 EFI_HANDLE ControllerHandle;
28
29 if (!Private->UsingIpv6) {
30 ControllerHandle = Private->Ip4Nic->Controller;
31 } else {
32 ControllerHandle = Private->Ip6Nic->Controller;
33 }
34
35 //
36 // Check whether gEfiHttpBootCallbackProtocolGuid already installed.
37 //
38 Status = gBS->HandleProtocol (
39 ControllerHandle,
40 &gEfiHttpBootCallbackProtocolGuid,
41 (VOID **)&Private->HttpBootCallback
42 );
43 if (Status == EFI_UNSUPPORTED) {
44 CopyMem (
45 &Private->LoadFileCallback,
48 );
49
50 //
51 // Install a default callback if user didn't offer one.
52 //
53 Status = gBS->InstallProtocolInterface (
54 &ControllerHandle,
55 &gEfiHttpBootCallbackProtocolGuid,
57 &Private->LoadFileCallback
58 );
59 if (EFI_ERROR (Status)) {
60 return Status;
61 }
62
63 Private->HttpBootCallback = &Private->LoadFileCallback;
64 }
65
66 return EFI_SUCCESS;
67}
68
75VOID
78 )
79{
80 EFI_HANDLE ControllerHandle;
81
82 if (Private->HttpBootCallback == &Private->LoadFileCallback) {
83 if (!Private->UsingIpv6) {
84 ControllerHandle = Private->Ip4Nic->Controller;
85 } else {
86 ControllerHandle = Private->Ip6Nic->Controller;
87 }
88
89 gBS->UninstallProtocolInterface (
90 ControllerHandle,
91 &gEfiHttpBootCallbackProtocolGuid,
92 Private->HttpBootCallback
93 );
94 Private->HttpBootCallback = NULL;
95 }
96}
97
119 IN HTTP_BOOT_PRIVATE_DATA *Private,
120 IN BOOLEAN UsingIpv6,
122 )
123{
124 UINTN Index;
125 EFI_STATUS Status;
126 CHAR8 *Uri;
127
128 Uri = NULL;
129
130 if ((Private == NULL) || (FilePath == NULL)) {
131 return EFI_INVALID_PARAMETER;
132 }
133
134 //
135 // Check the URI in the input FilePath, in order to see whether it is
136 // required to boot from a new specified boot file.
137 //
138 Status = HttpBootParseFilePath (FilePath, &Uri);
139 if (EFI_ERROR (Status)) {
140 return EFI_INVALID_PARAMETER;
141 }
142
143 //
144 // Check whether we need to stop and restart the HTTP boot driver.
145 //
146 if (Private->Started) {
147 //
148 // Restart is needed in 2 cases:
149 // 1. Http boot driver has already been started but not on the required IP stack.
150 // 2. The specified boot file URI in FilePath is different with the one we have
151 // recorded before.
152 //
153 if ((UsingIpv6 != Private->UsingIpv6) ||
154 ((Uri != NULL) && (AsciiStrCmp (Private->BootFileUri, Uri) != 0)))
155 {
156 //
157 // Restart is required, first stop then continue this start function.
158 //
159 Status = HttpBootStop (Private);
160 if (EFI_ERROR (Status)) {
161 if (Uri != NULL) {
162 FreePool (Uri);
163 }
164
165 return Status;
166 }
167 } else {
168 //
169 // Restart is not required.
170 //
171 if (Uri != NULL) {
172 FreePool (Uri);
173 }
174
175 return EFI_ALREADY_STARTED;
176 }
177 }
178
179 //
180 // Detect whether using ipv6 or not, and set it to the private data.
181 //
182 if (UsingIpv6 && (Private->Ip6Nic != NULL)) {
183 Private->UsingIpv6 = TRUE;
184 } else if (!UsingIpv6 && (Private->Ip4Nic != NULL)) {
185 Private->UsingIpv6 = FALSE;
186 } else {
187 if (Uri != NULL) {
188 FreePool (Uri);
189 }
190
191 return EFI_UNSUPPORTED;
192 }
193
194 //
195 // Record the specified URI and prepare the URI parser if needed.
196 //
197 Private->FilePathUri = Uri;
198 if (Private->FilePathUri != NULL) {
199 Status = HttpParseUrl (
200 Private->FilePathUri,
201 (UINT32)AsciiStrLen (Private->FilePathUri),
202 FALSE,
203 &Private->FilePathUriParser
204 );
205 if (EFI_ERROR (Status)) {
206 FreePool (Private->FilePathUri);
207 return Status;
208 }
209 }
210
211 //
212 // Init the content of cached DHCP offer list.
213 //
214 ZeroMem (Private->OfferBuffer, sizeof (Private->OfferBuffer));
215 if (!Private->UsingIpv6) {
216 for (Index = 0; Index < HTTP_BOOT_OFFER_MAX_NUM; Index++) {
217 Private->OfferBuffer[Index].Dhcp4.Packet.Offer.Size = HTTP_CACHED_DHCP4_PACKET_MAX_SIZE;
218 }
219 } else {
220 for (Index = 0; Index < HTTP_BOOT_OFFER_MAX_NUM; Index++) {
221 Private->OfferBuffer[Index].Dhcp6.Packet.Offer.Size = HTTP_CACHED_DHCP6_PACKET_MAX_SIZE;
222 }
223 }
224
225 if (Private->UsingIpv6) {
226 //
227 // Set Ip6 policy to Automatic to start the Ip6 router discovery.
228 //
229 Status = HttpBootSetIp6Policy (Private);
230 if (EFI_ERROR (Status)) {
231 return Status;
232 }
233 }
234
235 Private->Started = TRUE;
236 Print (L"\n>>Start HTTP Boot over IPv%d", Private->UsingIpv6 ? 6 : 4);
237
238 return EFI_SUCCESS;
239}
240
256 )
257{
258 EFI_STATUS Status;
259
260 if (Private == NULL) {
261 return EFI_INVALID_PARAMETER;
262 }
263
264 if (!Private->Started) {
265 return EFI_NOT_STARTED;
266 }
267
268 Status = EFI_DEVICE_ERROR;
269
270 if (!Private->UsingIpv6) {
271 //
272 // Start D.O.R.A process to get a IPv4 address and other boot information.
273 //
274 Status = HttpBootDhcp4Dora (Private);
275 } else {
276 //
277 // Start S.A.R.R process to get a IPv6 address and other boot information.
278 //
279 Status = HttpBootDhcp6Sarr (Private);
280 }
281
282 return Status;
283}
284
307 IN HTTP_BOOT_PRIVATE_DATA *Private,
308 IN OUT UINTN *BufferSize,
309 IN VOID *Buffer OPTIONAL,
310 OUT HTTP_BOOT_IMAGE_TYPE *ImageType
311 )
312{
313 HTTP_GET_BOOT_FILE_STATE State;
314 EFI_STATUS Status;
315 UINT32 Retries;
316
317 if (Private->BootFileSize == 0) {
318 State = GetBootFileHead;
319 } else {
320 State = LoadBootFile;
321 }
322
323 for ( ; ;) {
324 switch (State) {
325 case GetBootFileHead:
326 //
327 // Try to use HTTP HEAD method.
328 //
329 Status = HttpBootGetBootFile (
330 Private,
331 TRUE,
332 &Private->BootFileSize,
333 NULL,
334 &Private->ImageType
335 );
336 if ((EFI_ERROR (Status)) && (Status != EFI_BUFFER_TOO_SMALL)) {
337 if ((Private->AuthData != NULL) && (Status == EFI_ACCESS_DENIED)) {
338 //
339 // Try to use HTTP HEAD method again since the Authentication information is provided.
340 //
341 State = GetBootFileHead;
342 } else {
343 State = GetBootFileGet;
344 }
345 } else {
346 State = LoadBootFile;
347 }
348
349 break;
350
351 case GetBootFileGet:
352 //
353 // Failed to get file size by HEAD method, may be trunked encoding, try HTTP GET method.
354 //
355 ASSERT (Private->BootFileSize == 0);
356 Status = HttpBootGetBootFile (
357 Private,
358 FALSE,
359 &Private->BootFileSize,
360 NULL,
361 &Private->ImageType
362 );
363 if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
364 State = GetBootFileError;
365 } else {
366 State = LoadBootFile;
367 }
368
369 break;
370
371 case LoadBootFile:
372 if (*BufferSize < Private->BootFileSize) {
373 *BufferSize = Private->BootFileSize;
374 *ImageType = Private->ImageType;
375 Status = EFI_BUFFER_TOO_SMALL;
376 return Status;
377 }
378
379 //
380 // Load the boot file into Buffer
381 //
382 for (Retries = 1; Retries <= PcdGet32 (PcdMaxHttpResumeRetries); Retries++) {
383 Status = HttpBootGetBootFile (
384 Private,
385 FALSE,
386 BufferSize,
387 Buffer,
388 ImageType
389 );
390 if (!EFI_ERROR (Status) ||
391 ((Status != EFI_TIMEOUT) && (Status != EFI_DEVICE_ERROR)) ||
392 (Retries >= PcdGet32 (PcdMaxHttpResumeRetries)))
393 {
394 break;
395 }
396
397 //
398 // HttpBootGetBootFile returned EFI_TIMEOUT or EFI_DEVICE_ERROR.
399 // We may attempt to resume the interrupted download.
400 //
401
402 Private->HttpCreated = FALSE;
403 HttpIoDestroyIo (&Private->HttpIo);
404 Status = HttpBootCreateHttpIo (Private);
405 if (EFI_ERROR (Status)) {
406 break;
407 }
408
409 DEBUG ((DEBUG_WARN | DEBUG_INFO, "HttpBootGetBootFileCaller: NBP file download interrupted, will try to resume the operation.\n"));
410 gBS->Stall (1000 * 1000 * PcdGet32 (PcdHttpDelayBetweenResumeRetries));
411 }
412
413 if (EFI_ERROR (Status) && (Retries >= PcdGet32 (PcdMaxHttpResumeRetries))) {
414 DEBUG ((DEBUG_ERROR, "HttpBootGetBootFileCaller: Error downloading NBP file, even after trying to resume %d times.\n", Retries));
415 }
416
417 return Status;
418
419 case GetBootFileError:
420 default:
421 AsciiPrint ("\n Error: Could not retrieve NBP file size from HTTP server.\n");
422 return Status;
423 }
424 }
425}
426
452 IN HTTP_BOOT_PRIVATE_DATA *Private,
453 IN OUT UINTN *BufferSize,
454 IN VOID *Buffer OPTIONAL,
455 OUT HTTP_BOOT_IMAGE_TYPE *ImageType
456 )
457{
458 EFI_STATUS Status;
459
460 if ((Private == NULL) || (ImageType == NULL) || (BufferSize == NULL)) {
461 return EFI_INVALID_PARAMETER;
462 }
463
464 if ((*BufferSize != 0) && (Buffer == NULL)) {
465 return EFI_INVALID_PARAMETER;
466 }
467
468 if (!Private->Started) {
469 return EFI_NOT_STARTED;
470 }
471
472 Status = HttpBootInstallCallback (Private);
473 if (EFI_ERROR (Status)) {
474 goto ON_EXIT;
475 }
476
477 if (Private->BootFileUri == NULL) {
478 //
479 // Parse the cached offer to get the boot file URL first.
480 //
481 Status = HttpBootDiscoverBootInfo (Private);
482 if (EFI_ERROR (Status)) {
483 AsciiPrint ("\n Error: Could not retrieve NBP file size from HTTP server.\n");
484 goto ON_EXIT;
485 }
486 }
487
488 if (!Private->HttpCreated) {
489 //
490 // Create HTTP child.
491 //
492 Status = HttpBootCreateHttpIo (Private);
493 if (EFI_ERROR (Status)) {
494 goto ON_EXIT;
495 }
496 }
497
498 //
499 // Load the boot file
500 //
501 Status = HttpBootGetBootFileCaller (Private, BufferSize, Buffer, ImageType);
502
503ON_EXIT:
505
506 if (EFI_ERROR (Status)) {
507 if (Status == EFI_ACCESS_DENIED) {
508 AsciiPrint ("\n Error: Could not establish connection with HTTP server.\n");
509 } else if ((Status == EFI_BUFFER_TOO_SMALL) && (Buffer != NULL)) {
510 AsciiPrint ("\n Error: Buffer size is smaller than the requested file.\n");
511 } else if (Status == EFI_OUT_OF_RESOURCES) {
512 AsciiPrint ("\n Error: Could not allocate I/O buffers.\n");
513 } else if (Status == EFI_DEVICE_ERROR) {
514 AsciiPrint ("\n Error: Network device error.\n");
515 } else if (Status == EFI_TIMEOUT) {
516 AsciiPrint ("\n Error: Server response timeout.\n");
517 } else if (Status == EFI_ABORTED) {
518 AsciiPrint ("\n Error: Remote boot cancelled.\n");
519 } else if (Status != EFI_BUFFER_TOO_SMALL) {
520 AsciiPrint ("\n Error: Unexpected network error.\n");
521 }
522 }
523
524 return Status;
525}
526
541 )
542{
543 UINTN Index;
544
545 if (Private == NULL) {
546 return EFI_INVALID_PARAMETER;
547 }
548
549 if (!Private->Started) {
550 return EFI_NOT_STARTED;
551 }
552
553 if (Private->HttpCreated) {
554 HttpIoDestroyIo (&Private->HttpIo);
555 Private->HttpCreated = FALSE;
556 }
557
558 Private->Started = FALSE;
559 ZeroMem (&Private->StationIp, sizeof (EFI_IP_ADDRESS));
560 ZeroMem (&Private->SubnetMask, sizeof (EFI_IP_ADDRESS));
561 ZeroMem (&Private->GatewayIp, sizeof (EFI_IP_ADDRESS));
562 Private->Port = 0;
563 Private->BootFileUri = NULL;
564 Private->BootFileUriParser = NULL;
565 Private->BootFileSize = 0;
566 Private->SelectIndex = 0;
567 Private->SelectProxyType = HttpOfferTypeMax;
568 Private->PartialTransferredSize = 0;
569
570 if (!Private->UsingIpv6) {
571 //
572 // Stop and release the DHCP4 child.
573 //
574 Private->Dhcp4->Stop (Private->Dhcp4);
575 Private->Dhcp4->Configure (Private->Dhcp4, NULL);
576
577 for (Index = 0; Index < HTTP_BOOT_OFFER_MAX_NUM; Index++) {
578 if (Private->OfferBuffer[Index].Dhcp4.UriParser) {
579 HttpUrlFreeParser (Private->OfferBuffer[Index].Dhcp4.UriParser);
580 }
581 }
582 } else {
583 //
584 // Stop and release the DHCP6 child.
585 //
586 Private->Dhcp6->Stop (Private->Dhcp6);
587 Private->Dhcp6->Configure (Private->Dhcp6, NULL);
588
589 for (Index = 0; Index < HTTP_BOOT_OFFER_MAX_NUM; Index++) {
590 if (Private->OfferBuffer[Index].Dhcp6.UriParser) {
591 HttpUrlFreeParser (Private->OfferBuffer[Index].Dhcp6.UriParser);
592 }
593 }
594 }
595
596 if (Private->AuthData != NULL) {
597 FreePool (Private->AuthData);
598 Private->AuthData = NULL;
599 }
600
601 if (Private->AuthScheme != NULL) {
602 FreePool (Private->AuthScheme);
603 Private->AuthScheme = NULL;
604 }
605
606 if (Private->DnsServerIp != NULL) {
607 FreePool (Private->DnsServerIp);
608 Private->DnsServerIp = NULL;
609 }
610
611 if (Private->FilePathUri != NULL) {
612 FreePool (Private->FilePathUri);
613 HttpUrlFreeParser (Private->FilePathUriParser);
614 Private->FilePathUri = NULL;
615 Private->FilePathUriParser = NULL;
616 }
617
618 if (Private->LastModifiedOrEtag != NULL) {
619 FreePool (Private->LastModifiedOrEtag);
620 Private->LastModifiedOrEtag = NULL;
621 }
622
623 ZeroMem (Private->OfferBuffer, sizeof (Private->OfferBuffer));
624 Private->OfferNum = 0;
625 ZeroMem (Private->OfferCount, sizeof (Private->OfferCount));
626 ZeroMem (Private->OfferIndex, sizeof (Private->OfferIndex));
627
628 HttpBootFreeCacheList (Private);
629
630 return EFI_SUCCESS;
631}
632
665EFIAPI
669 IN BOOLEAN BootPolicy,
670 IN OUT UINTN *BufferSize,
671 IN VOID *Buffer OPTIONAL
672 )
673{
674 HTTP_BOOT_PRIVATE_DATA *Private;
675 HTTP_BOOT_VIRTUAL_NIC *VirtualNic;
676 EFI_STATUS MediaStatus;
677 BOOLEAN UsingIpv6;
678 EFI_STATUS Status;
679 HTTP_BOOT_IMAGE_TYPE ImageType;
680
681 if ((This == NULL) || (BufferSize == NULL) || (FilePath == NULL)) {
682 return EFI_INVALID_PARAMETER;
683 }
684
685 //
686 // Only support BootPolicy
687 //
688 if (!BootPolicy) {
689 return EFI_UNSUPPORTED;
690 }
691
692 VirtualNic = HTTP_BOOT_VIRTUAL_NIC_FROM_LOADFILE (This);
693 Private = VirtualNic->Private;
694
695 //
696 // Check media status before HTTP boot start
697 //
698 MediaStatus = EFI_SUCCESS;
699 NetLibDetectMediaWaitTimeout (Private->Controller, HTTP_BOOT_CHECK_MEDIA_WAITING_TIME, &MediaStatus);
700 if (MediaStatus != EFI_SUCCESS) {
701 AsciiPrint ("\n Error: Could not detect network connection.\n");
702 return EFI_NO_MEDIA;
703 }
704
705 //
706 // Check whether the virtual nic is using IPv6 or not.
707 //
708 UsingIpv6 = FALSE;
709 if (VirtualNic == Private->Ip6Nic) {
710 UsingIpv6 = TRUE;
711 }
712
713 //
714 // Initialize HTTP boot.
715 //
716 Status = HttpBootStart (Private, UsingIpv6, FilePath);
717 if ((Status != EFI_SUCCESS) && (Status != EFI_ALREADY_STARTED)) {
718 return Status;
719 }
720
721 //
722 // Load the boot file.
723 //
724 ImageType = ImageTypeMax;
725 Status = HttpBootLoadFile (Private, BufferSize, Buffer, &ImageType);
726 if (EFI_ERROR (Status)) {
727 if ((Status == EFI_BUFFER_TOO_SMALL) && ((ImageType == ImageTypeVirtualCd) || (ImageType == ImageTypeVirtualDisk))) {
728 Status = EFI_WARN_FILE_SYSTEM;
729 } else if (Status != EFI_BUFFER_TOO_SMALL) {
730 HttpBootStop (Private);
731 }
732
733 return Status;
734 }
735
736 //
737 // Register the RAM Disk to the system if needed.
738 //
739 if ((ImageType == ImageTypeVirtualCd) || (ImageType == ImageTypeVirtualDisk)) {
740 Status = HttpBootRegisterRamDisk (Private, *BufferSize, Buffer, ImageType);
741 if (!EFI_ERROR (Status)) {
742 Status = EFI_WARN_FILE_SYSTEM;
743 } else {
744 AsciiPrint ("\n Error: Could not register RAM disk to the system.\n");
745 }
746 }
747
748 //
749 // Stop the HTTP Boot service after the boot image is downloaded.
750 //
751 HttpBootStop (Private);
752 return Status;
753}
754
761};
762
785EFIAPI
789 IN BOOLEAN Received,
790 IN UINT32 DataLength,
791 IN VOID *Data OPTIONAL
792 )
793{
794 EFI_HTTP_MESSAGE *HttpMessage;
795 EFI_HTTP_HEADER *HttpHeader;
796 HTTP_BOOT_PRIVATE_DATA *Private;
797 UINT32 Percentage;
798
799 Private = HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_PROTOCOL (This);
800
801 switch (DataType) {
802 case HttpBootDhcp4:
803 case HttpBootDhcp6:
804 Print (L".");
805 break;
806
808 if (Data != NULL) {
809 HttpMessage = (EFI_HTTP_MESSAGE *)Data;
810 if ((HttpMessage->Data.Request->Method == HttpMethodGet) &&
811 (HttpMessage->Data.Request->Url != NULL) &&
812 (Private->PartialTransferredSize == 0))
813 {
814 Print (L"\n URI: %s\n", HttpMessage->Data.Request->Url);
815 }
816 }
817
818 break;
819
821 if (Data != NULL) {
822 HttpMessage = (EFI_HTTP_MESSAGE *)Data;
823
824 if (HttpMessage->Data.Response != NULL) {
826 //
827 // Server indicates the resource has been redirected to a different URL
828 // according to the section 6.4 of RFC7231 and the RFC 7538.
829 // Display the redirect information on the screen.
830 //
831 HttpHeader = HttpFindHeader (
832 HttpMessage->HeaderCount,
833 HttpMessage->Headers,
835 );
836 if (HttpHeader != NULL) {
837 Print (L"\n HTTP ERROR: Resource Redirected.\n New Location: %a\n", HttpHeader->FieldValue);
838 }
839
840 break;
841 }
842 }
843
844 // If download was resumed, do not change progress variables
845 HttpHeader = HttpFindHeader (
846 HttpMessage->HeaderCount,
847 HttpMessage->Headers,
849 );
850 if (HttpHeader) {
851 break;
852 }
853
854 HttpHeader = HttpFindHeader (
855 HttpMessage->HeaderCount,
856 HttpMessage->Headers,
858 );
859 if (HttpHeader != NULL) {
860 Private->FileSize = AsciiStrDecimalToUintn (HttpHeader->FieldValue);
861 Private->ReceivedSize = 0;
862 Private->Percentage = 0;
863 }
864 }
865
866 break;
867
869 if (DataLength != 0) {
870 if (Private->FileSize != 0) {
871 //
872 // We already know the file size, print in percentage format.
873 //
874 if (Private->ReceivedSize == 0) {
875 Print (L" File Size: %lu Bytes\n", Private->FileSize);
876 }
877
878 Private->ReceivedSize += DataLength;
879 Percentage = (UINT32)DivU64x64Remainder (MultU64x32 (Private->ReceivedSize, 100), Private->FileSize, NULL);
880 if (Private->Percentage != Percentage) {
881 Private->Percentage = Percentage;
882 Print (L"\r Downloading...%d%%", Percentage);
883 }
884 } else {
885 //
886 // In some case we couldn't get the file size from the HTTP header, so we
887 // just print the downloaded file size.
888 //
889 Private->ReceivedSize += DataLength;
890 Print (L"\r Downloading...%lu Bytes", Private->ReceivedSize);
891 }
892 }
893
894 break;
895
896 default:
897 break;
898 }
899
900 return EFI_SUCCESS;
901}
902
909};
UINT64 UINTN
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:641
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
Definition: String.c:716
UINTN EFIAPI AsciiStrDecimalToUintn(IN CONST CHAR8 *String)
Definition: String.c:1006
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
Definition: MultU64x32.c:27
UINT64 EFIAPI DivU64x64Remainder(IN UINT64 Dividend, IN UINT64 Divisor, OUT UINT64 *Remainder OPTIONAL)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define HTTP_HEADER_CONTENT_LENGTH
Definition: Http11.h:135
#define HTTP_HEADER_CONTENT_RANGE
Definition: Http11.h:256
#define HTTP_HEADER_LOCATION
Definition: Http11.h:182
EFI_HTTP_BOOT_CALLBACK_DATA_TYPE
@ HttpBootDhcp6
@ HttpBootHttpRequest
@ HttpBootHttpResponse
@ HttpBootHttpEntityBody
@ HttpBootDhcp4
EFI_STATUS HttpBootCreateHttpIo(IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootDiscoverBootInfo(IN OUT HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootGetBootFile(IN HTTP_BOOT_PRIVATE_DATA *Private, IN BOOLEAN HeaderOnly, IN OUT UINTN *BufferSize, OUT UINT8 *Buffer, OUT HTTP_BOOT_IMAGE_TYPE *ImageType)
VOID HttpBootFreeCacheList(IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootDhcp4Dora(IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootSetIp6Policy(IN HTTP_BOOT_PRIVATE_DATA *Private)
EFI_STATUS HttpBootDhcp6Sarr(IN HTTP_BOOT_PRIVATE_DATA *Private)
VOID HttpBootUninstallCallback(IN HTTP_BOOT_PRIVATE_DATA *Private)
Definition: HttpBootImpl.c:76
EFI_STATUS HttpBootLoadFile(IN HTTP_BOOT_PRIVATE_DATA *Private, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL, OUT HTTP_BOOT_IMAGE_TYPE *ImageType)
Definition: HttpBootImpl.c:451
GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile
Definition: HttpBootImpl.c:759
EFI_STATUS HttpBootGetBootFileCaller(IN HTTP_BOOT_PRIVATE_DATA *Private, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL, OUT HTTP_BOOT_IMAGE_TYPE *ImageType)
Definition: HttpBootImpl.c:306
EFI_STATUS HttpBootStart(IN HTTP_BOOT_PRIVATE_DATA *Private, IN BOOLEAN UsingIpv6, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
Definition: HttpBootImpl.c:118
EFI_STATUS EFIAPI HttpBootCallback(IN EFI_HTTP_BOOT_CALLBACK_PROTOCOL *This, IN EFI_HTTP_BOOT_CALLBACK_DATA_TYPE DataType, IN BOOLEAN Received, IN UINT32 DataLength, IN VOID *Data OPTIONAL)
Definition: HttpBootImpl.c:786
EFI_STATUS HttpBootDhcp(IN HTTP_BOOT_PRIVATE_DATA *Private)
Definition: HttpBootImpl.c:254
GLOBAL_REMOVE_IF_UNREFERENCED EFI_HTTP_BOOT_CALLBACK_PROTOCOL gHttpBootDxeHttpBootCallback
Definition: HttpBootImpl.c:907
EFI_STATUS HttpBootInstallCallback(IN HTTP_BOOT_PRIVATE_DATA *Private)
Definition: HttpBootImpl.c:22
EFI_STATUS HttpBootStop(IN HTTP_BOOT_PRIVATE_DATA *Private)
Definition: HttpBootImpl.c:539
EFI_STATUS EFIAPI HttpBootDxeLoadFile(IN EFI_LOAD_FILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)
Definition: HttpBootImpl.c:666
EFI_STATUS HttpBootRegisterRamDisk(IN HTTP_BOOT_PRIVATE_DATA *Private, IN UINTN BufferSize, IN VOID *Buffer, IN HTTP_BOOT_IMAGE_TYPE ImageType)
BOOLEAN HttpBootIsHttpRedirectStatusCode(IN EFI_HTTP_STATUS_CODE StatusCode)
EFI_STATUS HttpBootParseFilePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath, OUT CHAR8 **UriAddress)
VOID HttpIoDestroyIo(IN HTTP_IO *HttpIo)
Definition: DxeHttpIoLib.c:62
EFI_HTTP_HEADER *EFIAPI HttpFindHeader(IN UINTN HeaderCount, IN EFI_HTTP_HEADER *Headers, IN CHAR8 *FieldName)
Definition: DxeHttpLib.c:855
VOID EFIAPI HttpUrlFreeParser(IN VOID *UrlParser)
Definition: DxeHttpLib.c:836
EFI_STATUS EFIAPI HttpParseUrl(IN CHAR8 *Url, IN UINT32 Length, IN BOOLEAN IsConnectMethod, OUT VOID **UrlParser)
Definition: DxeHttpLib.c:370
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define GLOBAL_REMOVE_IF_UNREFERENCED
Definition: Base.h:48
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI NetLibDetectMediaWaitTimeout(IN EFI_HANDLE ServiceHandle, IN UINT64 Timeout, OUT EFI_STATUS *MediaState)
Definition: DxeNetLib.c:2683
#define PcdGet32(TokenName)
Definition: PcdLib.h:362
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
UINTN EFIAPI AsciiPrint(IN CONST CHAR8 *Format,...)
Definition: UefiLibPrint.c:250
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
Definition: UefiLibPrint.c:113
@ EFI_NATIVE_INTERFACE
Definition: UefiSpec.h:1193
CHAR8 * FieldValue
Definition: Http.h:220
EFI_HTTP_HEADER * Headers
Definition: Http.h:253
union EFI_HTTP_MESSAGE::@577 Data
UINTN HeaderCount
Definition: Http.h:246
EFI_HTTP_RESPONSE_DATA * Response
Definition: Http.h:240
EFI_HTTP_REQUEST_DATA * Request
Definition: Http.h:235
CHAR16 * Url
Definition: Http.h:194
EFI_HTTP_METHOD Method
Definition: Http.h:187
EFI_HTTP_STATUS_CODE StatusCode
Definition: Http.h:204