Changeset 89983 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg
- Timestamp:
- Jul 1, 2021 8:17:41 AM (4 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 6 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-139864 /vendor/edk2/current 103735-103757,103769-103776,129194-145445
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/DnsDxe/DnsDhcp.c
r80721 r89983 132 132 } 133 133 134 for (Count=0; Count < ServerCount; Count++){134 for (Count=0; Count < ServerCount; Count++) { 135 135 CopyMem (ServerList + Count, &OptionList[Index]->Data[4 * Count], sizeof (EFI_IPv4_ADDRESS)); 136 136 } … … 226 226 } 227 227 228 for (Count=0; Count < ServerCount; Count++){228 for (Count=0; Count < ServerCount; Count++) { 229 229 CopyMem (ServerList + Count, &OptionList[Index]->Data[16 * Count], sizeof (EFI_IPv6_ADDRESS)); 230 230 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/DnsDxe/DnsDriver.c
r85718 r89983 198 198 UdpIoFreeIo (DnsSb->ConnectUdp); 199 199 200 if (DnsSb->TimerToGetMap != NULL) {200 if (DnsSb->TimerToGetMap != NULL) { 201 201 gBS->CloseEvent (DnsSb->TimerToGetMap); 202 202 } 203 203 204 if (DnsSb->Timer != NULL) {204 if (DnsSb->Timer != NULL) { 205 205 gBS->CloseEvent (DnsSb->Timer); 206 206 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/DnsDxe/DnsImpl.c
r85718 r89983 800 800 801 801 return EFI_SUCCESS; 802 } else {802 } else { 803 803 return EFI_ACCESS_DENIED; 804 804 } … … 898 898 899 899 return EFI_SUCCESS; 900 } else {900 } else { 901 901 return EFI_ACCESS_DENIED; 902 902 } … … 1081 1081 *Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link); 1082 1082 Packet = (NET_BUF *) ((*Item)->Value); 1083 if (Packet == NULL) {1083 if (Packet == NULL) { 1084 1084 1085 1085 continue; … … 2128 2128 } 2129 2129 } 2130 } else {2130 } else { 2131 2131 // 2132 2132 // Iterate through all the children of the DNS service instance. Time -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/DnsDxe/DnsImpl.h
r85718 r89983 126 126 } DNS6_TOKEN_ENTRY; 127 127 128 union _DNS_FLAGS {128 union _DNS_FLAGS { 129 129 struct { 130 130 UINT16 RCode:4; -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/DnsDxe/DnsProtocol.c
r85718 r89983 218 218 } 219 219 220 if (Instance->UdpIo != NULL) {220 if (Instance->UdpIo != NULL) { 221 221 UdpIoCleanIo (Instance->UdpIo); 222 222 } … … 1062 1062 } 1063 1063 1064 if (Instance->UdpIo != NULL) {1064 if (Instance->UdpIo != NULL) { 1065 1065 UdpIoCleanIo (Instance->UdpIo); 1066 1066 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/HttpBootDxe/HttpBootClient.c
r80721 r89983 978 978 // User-Agent 979 979 // 980 HttpIoHeader = Http BootCreateHeader (3);980 HttpIoHeader = HttpIoCreateHeader (3); 981 981 if (HttpIoHeader == NULL) { 982 982 Status = EFI_OUT_OF_RESOURCES; … … 996 996 goto ERROR_3; 997 997 } 998 Status = Http BootSetHeader (998 Status = HttpIoSetHeader ( 999 999 HttpIoHeader, 1000 1000 HTTP_HEADER_HOST, … … 1009 1009 // Add HTTP header field 2: Accept 1010 1010 // 1011 Status = Http BootSetHeader (1011 Status = HttpIoSetHeader ( 1012 1012 HttpIoHeader, 1013 1013 HTTP_HEADER_ACCEPT, … … 1021 1021 // Add HTTP header field 3: User-Agent 1022 1022 // 1023 Status = Http BootSetHeader (1023 Status = HttpIoSetHeader ( 1024 1024 HttpIoHeader, 1025 1025 HTTP_HEADER_USER_AGENT, … … 1292 1292 } 1293 1293 ERROR_3: 1294 Http BootFreeHeader (HttpIoHeader);1294 HttpIoFreeHeader (HttpIoHeader); 1295 1295 ERROR_2: 1296 1296 if (Cache != NULL) { -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/HttpBootDxe/HttpBootDxe.h
r85718 r89983 3 3 4 4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>5 (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 29 29 #include <Library/NetLib.h> 30 30 #include <Library/HttpLib.h> 31 #include <Library/HttpIoLib.h> 31 32 #include <Library/HiiLib.h> 32 33 #include <Library/PrintLib.h> -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/HttpBootDxe/HttpBootDxe.inf
r80721 r89983 3 3 # 4 4 # Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> 5 # (C) Copyright 2020 Hewlett-Packard Development Company, L.P.<BR> 5 6 # SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 # … … 53 54 NetLib 54 55 HttpLib 56 HttpIoLib 55 57 HiiLib 56 58 PrintLib -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/HttpBootDxe/HttpBootSupport.c
r85718 r89983 3 3 4 4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>5 (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 489 489 FreePool (DnsServerList); 490 490 } 491 492 return Status;493 }494 /**495 Create a HTTP_IO_HEADER to hold the HTTP header items.496 497 @param[in] MaxHeaderCount The maximum number of HTTP header in this holder.498 499 @return A pointer of the HTTP header holder or NULL if failed.500 501 **/502 HTTP_IO_HEADER *503 HttpBootCreateHeader (504 UINTN MaxHeaderCount505 )506 {507 HTTP_IO_HEADER *HttpIoHeader;508 509 if (MaxHeaderCount == 0) {510 return NULL;511 }512 513 HttpIoHeader = AllocateZeroPool (sizeof (HTTP_IO_HEADER) + MaxHeaderCount * sizeof (EFI_HTTP_HEADER));514 if (HttpIoHeader == NULL) {515 return NULL;516 }517 518 HttpIoHeader->MaxHeaderCount = MaxHeaderCount;519 HttpIoHeader->Headers = (EFI_HTTP_HEADER *) (HttpIoHeader + 1);520 521 return HttpIoHeader;522 }523 524 /**525 Destroy the HTTP_IO_HEADER and release the resources.526 527 @param[in] HttpIoHeader Point to the HTTP header holder to be destroyed.528 529 **/530 VOID531 HttpBootFreeHeader (532 IN HTTP_IO_HEADER *HttpIoHeader533 )534 {535 UINTN Index;536 537 if (HttpIoHeader != NULL) {538 if (HttpIoHeader->HeaderCount != 0) {539 for (Index = 0; Index < HttpIoHeader->HeaderCount; Index++) {540 FreePool (HttpIoHeader->Headers[Index].FieldName);541 FreePool (HttpIoHeader->Headers[Index].FieldValue);542 }543 }544 FreePool (HttpIoHeader);545 }546 }547 548 /**549 Set or update a HTTP header with the field name and corresponding value.550 551 @param[in] HttpIoHeader Point to the HTTP header holder.552 @param[in] FieldName Null terminated string which describes a field name.553 @param[in] FieldValue Null terminated string which describes the corresponding field value.554 555 @retval EFI_SUCCESS The HTTP header has been set or updated.556 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.557 @retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation.558 @retval Other Unexpected error happened.559 560 **/561 EFI_STATUS562 HttpBootSetHeader (563 IN HTTP_IO_HEADER *HttpIoHeader,564 IN CHAR8 *FieldName,565 IN CHAR8 *FieldValue566 )567 {568 EFI_HTTP_HEADER *Header;569 UINTN StrSize;570 CHAR8 *NewFieldValue;571 572 if (HttpIoHeader == NULL || FieldName == NULL || FieldValue == NULL) {573 return EFI_INVALID_PARAMETER;574 }575 576 Header = HttpFindHeader (HttpIoHeader->HeaderCount, HttpIoHeader->Headers, FieldName);577 if (Header == NULL) {578 //579 // Add a new header.580 //581 if (HttpIoHeader->HeaderCount >= HttpIoHeader->MaxHeaderCount) {582 return EFI_OUT_OF_RESOURCES;583 }584 Header = &HttpIoHeader->Headers[HttpIoHeader->HeaderCount];585 586 StrSize = AsciiStrSize (FieldName);587 Header->FieldName = AllocatePool (StrSize);588 if (Header->FieldName == NULL) {589 return EFI_OUT_OF_RESOURCES;590 }591 CopyMem (Header->FieldName, FieldName, StrSize);592 Header->FieldName[StrSize -1] = '\0';593 594 StrSize = AsciiStrSize (FieldValue);595 Header->FieldValue = AllocatePool (StrSize);596 if (Header->FieldValue == NULL) {597 FreePool (Header->FieldName);598 return EFI_OUT_OF_RESOURCES;599 }600 CopyMem (Header->FieldValue, FieldValue, StrSize);601 Header->FieldValue[StrSize -1] = '\0';602 603 HttpIoHeader->HeaderCount++;604 } else {605 //606 // Update an existing one.607 //608 StrSize = AsciiStrSize (FieldValue);609 NewFieldValue = AllocatePool (StrSize);610 if (NewFieldValue == NULL) {611 return EFI_OUT_OF_RESOURCES;612 }613 CopyMem (NewFieldValue, FieldValue, StrSize);614 NewFieldValue[StrSize -1] = '\0';615 616 if (Header->FieldValue != NULL) {617 FreePool (Header->FieldValue);618 }619 Header->FieldValue = NewFieldValue;620 }621 622 return EFI_SUCCESS;623 }624 625 /**626 Notify the callback function when an event is triggered.627 628 @param[in] Context The opaque parameter to the function.629 630 **/631 VOID632 EFIAPI633 HttpIoNotifyDpc (634 IN VOID *Context635 )636 {637 *((BOOLEAN *) Context) = TRUE;638 }639 640 /**641 Request HttpIoNotifyDpc as a DPC at TPL_CALLBACK.642 643 @param[in] Event The event signaled.644 @param[in] Context The opaque parameter to the function.645 646 **/647 VOID648 EFIAPI649 HttpIoNotify (650 IN EFI_EVENT Event,651 IN VOID *Context652 )653 {654 //655 // Request HttpIoNotifyDpc as a DPC at TPL_CALLBACK656 //657 QueueDpc (TPL_CALLBACK, HttpIoNotifyDpc, Context);658 }659 660 /**661 Create a HTTP_IO to access the HTTP service. It will create and configure662 a HTTP child handle.663 664 @param[in] Image The handle of the driver image.665 @param[in] Controller The handle of the controller.666 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.667 @param[in] ConfigData The HTTP_IO configuration data.668 @param[in] Callback Callback function which will be invoked when specified669 HTTP_IO_CALLBACK_EVENT happened.670 @param[in] Context The Context data which will be passed to the Callback function.671 @param[out] HttpIo The HTTP_IO.672 673 @retval EFI_SUCCESS The HTTP_IO is created and configured.674 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.675 @retval EFI_UNSUPPORTED One or more of the control options are not676 supported in the implementation.677 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.678 @retval Others Failed to create the HTTP_IO or configure it.679 680 **/681 EFI_STATUS682 HttpIoCreateIo (683 IN EFI_HANDLE Image,684 IN EFI_HANDLE Controller,685 IN UINT8 IpVersion,686 IN HTTP_IO_CONFIG_DATA *ConfigData,687 IN HTTP_IO_CALLBACK Callback,688 IN VOID *Context,689 OUT HTTP_IO *HttpIo690 )691 {692 EFI_STATUS Status;693 EFI_HTTP_CONFIG_DATA HttpConfigData;694 EFI_HTTPv4_ACCESS_POINT Http4AccessPoint;695 EFI_HTTPv6_ACCESS_POINT Http6AccessPoint;696 EFI_HTTP_PROTOCOL *Http;697 EFI_EVENT Event;698 699 if ((Image == NULL) || (Controller == NULL) || (ConfigData == NULL) || (HttpIo == NULL)) {700 return EFI_INVALID_PARAMETER;701 }702 703 if (IpVersion != IP_VERSION_4 && IpVersion != IP_VERSION_6) {704 return EFI_UNSUPPORTED;705 }706 707 ZeroMem (HttpIo, sizeof (HTTP_IO));708 709 //710 // Create the HTTP child instance and get the HTTP protocol.711 //712 Status = NetLibCreateServiceChild (713 Controller,714 Image,715 &gEfiHttpServiceBindingProtocolGuid,716 &HttpIo->Handle717 );718 if (EFI_ERROR (Status)) {719 return Status;720 }721 722 Status = gBS->OpenProtocol (723 HttpIo->Handle,724 &gEfiHttpProtocolGuid,725 (VOID **) &Http,726 Image,727 Controller,728 EFI_OPEN_PROTOCOL_BY_DRIVER729 );730 if (EFI_ERROR (Status) || (Http == NULL)) {731 goto ON_ERROR;732 }733 734 //735 // Init the configuration data and configure the HTTP child.736 //737 HttpIo->Image = Image;738 HttpIo->Controller = Controller;739 HttpIo->IpVersion = IpVersion;740 HttpIo->Http = Http;741 HttpIo->Callback = Callback;742 HttpIo->Context = Context;743 744 ZeroMem (&HttpConfigData, sizeof (EFI_HTTP_CONFIG_DATA));745 HttpConfigData.HttpVersion = HttpVersion11;746 HttpConfigData.TimeOutMillisec = ConfigData->Config4.RequestTimeOut;747 if (HttpIo->IpVersion == IP_VERSION_4) {748 HttpConfigData.LocalAddressIsIPv6 = FALSE;749 750 Http4AccessPoint.UseDefaultAddress = ConfigData->Config4.UseDefaultAddress;751 Http4AccessPoint.LocalPort = ConfigData->Config4.LocalPort;752 IP4_COPY_ADDRESS (&Http4AccessPoint.LocalAddress, &ConfigData->Config4.LocalIp);753 IP4_COPY_ADDRESS (&Http4AccessPoint.LocalSubnet, &ConfigData->Config4.SubnetMask);754 HttpConfigData.AccessPoint.IPv4Node = &Http4AccessPoint;755 } else {756 HttpConfigData.LocalAddressIsIPv6 = TRUE;757 Http6AccessPoint.LocalPort = ConfigData->Config6.LocalPort;758 IP6_COPY_ADDRESS (&Http6AccessPoint.LocalAddress, &ConfigData->Config6.LocalIp);759 HttpConfigData.AccessPoint.IPv6Node = &Http6AccessPoint;760 }761 762 Status = Http->Configure (Http, &HttpConfigData);763 if (EFI_ERROR (Status)) {764 goto ON_ERROR;765 }766 767 //768 // Create events for various asynchronous operations.769 //770 Status = gBS->CreateEvent (771 EVT_NOTIFY_SIGNAL,772 TPL_NOTIFY,773 HttpIoNotify,774 &HttpIo->IsTxDone,775 &Event776 );777 if (EFI_ERROR (Status)) {778 goto ON_ERROR;779 }780 HttpIo->ReqToken.Event = Event;781 HttpIo->ReqToken.Message = &HttpIo->ReqMessage;782 783 Status = gBS->CreateEvent (784 EVT_NOTIFY_SIGNAL,785 TPL_NOTIFY,786 HttpIoNotify,787 &HttpIo->IsRxDone,788 &Event789 );790 if (EFI_ERROR (Status)) {791 goto ON_ERROR;792 }793 HttpIo->RspToken.Event = Event;794 HttpIo->RspToken.Message = &HttpIo->RspMessage;795 796 //797 // Create TimeoutEvent for response798 //799 Status = gBS->CreateEvent (800 EVT_TIMER,801 TPL_CALLBACK,802 NULL,803 NULL,804 &Event805 );806 if (EFI_ERROR (Status)) {807 goto ON_ERROR;808 }809 HttpIo->TimeoutEvent = Event;810 811 return EFI_SUCCESS;812 813 ON_ERROR:814 HttpIoDestroyIo (HttpIo);815 816 return Status;817 }818 819 /**820 Destroy the HTTP_IO and release the resources.821 822 @param[in] HttpIo The HTTP_IO which wraps the HTTP service to be destroyed.823 824 **/825 VOID826 HttpIoDestroyIo (827 IN HTTP_IO *HttpIo828 )829 {830 EFI_HTTP_PROTOCOL *Http;831 EFI_EVENT Event;832 833 if (HttpIo == NULL) {834 return;835 }836 837 Event = HttpIo->ReqToken.Event;838 if (Event != NULL) {839 gBS->CloseEvent (Event);840 }841 842 Event = HttpIo->RspToken.Event;843 if (Event != NULL) {844 gBS->CloseEvent (Event);845 }846 847 Event = HttpIo->TimeoutEvent;848 if (Event != NULL) {849 gBS->CloseEvent (Event);850 }851 852 Http = HttpIo->Http;853 if (Http != NULL) {854 Http->Configure (Http, NULL);855 gBS->CloseProtocol (856 HttpIo->Handle,857 &gEfiHttpProtocolGuid,858 HttpIo->Image,859 HttpIo->Controller860 );861 }862 863 NetLibDestroyServiceChild (864 HttpIo->Controller,865 HttpIo->Image,866 &gEfiHttpServiceBindingProtocolGuid,867 HttpIo->Handle868 );869 }870 871 /**872 Synchronously send a HTTP REQUEST message to the server.873 874 @param[in] HttpIo The HttpIo wrapping the HTTP service.875 @param[in] Request A pointer to storage such data as URL and HTTP method.876 @param[in] HeaderCount Number of HTTP header structures in Headers list.877 @param[in] Headers Array containing list of HTTP headers.878 @param[in] BodyLength Length in bytes of the HTTP body.879 @param[in] Body Body associated with the HTTP request.880 881 @retval EFI_SUCCESS The HTTP request is transmitted.882 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.883 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.884 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.885 @retval Others Other errors as indicated.886 887 **/888 EFI_STATUS889 HttpIoSendRequest (890 IN HTTP_IO *HttpIo,891 IN EFI_HTTP_REQUEST_DATA *Request,892 IN UINTN HeaderCount,893 IN EFI_HTTP_HEADER *Headers,894 IN UINTN BodyLength,895 IN VOID *Body896 )897 {898 EFI_STATUS Status;899 EFI_HTTP_PROTOCOL *Http;900 901 if (HttpIo == NULL || HttpIo->Http == NULL) {902 return EFI_INVALID_PARAMETER;903 }904 905 HttpIo->ReqToken.Status = EFI_NOT_READY;906 HttpIo->ReqToken.Message->Data.Request = Request;907 HttpIo->ReqToken.Message->HeaderCount = HeaderCount;908 HttpIo->ReqToken.Message->Headers = Headers;909 HttpIo->ReqToken.Message->BodyLength = BodyLength;910 HttpIo->ReqToken.Message->Body = Body;911 912 if (HttpIo->Callback != NULL) {913 Status = HttpIo->Callback (914 HttpIoRequest,915 HttpIo->ReqToken.Message,916 HttpIo->Context917 );918 if (EFI_ERROR (Status)) {919 return Status;920 }921 }922 923 //924 // Queue the request token to HTTP instances.925 //926 Http = HttpIo->Http;927 HttpIo->IsTxDone = FALSE;928 Status = Http->Request (929 Http,930 &HttpIo->ReqToken931 );932 if (EFI_ERROR (Status)) {933 return Status;934 }935 936 //937 // Poll the network until transmit finish.938 //939 while (!HttpIo->IsTxDone) {940 Http->Poll (Http);941 }942 943 return HttpIo->ReqToken.Status;944 }945 946 /**947 Synchronously receive a HTTP RESPONSE message from the server.948 949 @param[in] HttpIo The HttpIo wrapping the HTTP service.950 @param[in] RecvMsgHeader TRUE to receive a new HTTP response (from message header).951 FALSE to continue receive the previous response message.952 @param[out] ResponseData Point to a wrapper of the received response data.953 954 @retval EFI_SUCCESS The HTTP response is received.955 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.956 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.957 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.958 @retval Others Other errors as indicated.959 960 **/961 EFI_STATUS962 HttpIoRecvResponse (963 IN HTTP_IO *HttpIo,964 IN BOOLEAN RecvMsgHeader,965 OUT HTTP_IO_RESPONSE_DATA *ResponseData966 )967 {968 EFI_STATUS Status;969 EFI_HTTP_PROTOCOL *Http;970 971 if (HttpIo == NULL || HttpIo->Http == NULL || ResponseData == NULL) {972 return EFI_INVALID_PARAMETER;973 }974 975 //976 // Start the timer, and wait Timeout seconds to receive the header packet.977 //978 Status = gBS->SetTimer (HttpIo->TimeoutEvent, TimerRelative, HTTP_BOOT_RESPONSE_TIMEOUT * TICKS_PER_MS);979 if (EFI_ERROR (Status)) {980 return Status;981 }982 983 //984 // Queue the response token to HTTP instances.985 //986 HttpIo->RspToken.Status = EFI_NOT_READY;987 if (RecvMsgHeader) {988 HttpIo->RspToken.Message->Data.Response = &ResponseData->Response;989 } else {990 HttpIo->RspToken.Message->Data.Response = NULL;991 }992 HttpIo->RspToken.Message->HeaderCount = 0;993 HttpIo->RspToken.Message->Headers = NULL;994 HttpIo->RspToken.Message->BodyLength = ResponseData->BodyLength;995 HttpIo->RspToken.Message->Body = ResponseData->Body;996 997 Http = HttpIo->Http;998 HttpIo->IsRxDone = FALSE;999 Status = Http->Response (1000 Http,1001 &HttpIo->RspToken1002 );1003 1004 if (EFI_ERROR (Status)) {1005 gBS->SetTimer (HttpIo->TimeoutEvent, TimerCancel, 0);1006 return Status;1007 }1008 1009 //1010 // Poll the network until receive finish.1011 //1012 while (!HttpIo->IsRxDone && ((HttpIo->TimeoutEvent == NULL) || EFI_ERROR (gBS->CheckEvent (HttpIo->TimeoutEvent)))) {1013 Http->Poll (Http);1014 }1015 1016 gBS->SetTimer (HttpIo->TimeoutEvent, TimerCancel, 0);1017 1018 if (!HttpIo->IsRxDone) {1019 //1020 // Timeout occurs, cancel the response token.1021 //1022 Http->Cancel (Http, &HttpIo->RspToken);1023 1024 Status = EFI_TIMEOUT;1025 1026 return Status;1027 } else {1028 HttpIo->IsRxDone = FALSE;1029 }1030 1031 if ((HttpIo->Callback != NULL) &&1032 (HttpIo->RspToken.Status == EFI_SUCCESS || HttpIo->RspToken.Status == EFI_HTTP_ERROR)) {1033 Status = HttpIo->Callback (1034 HttpIoResponse,1035 HttpIo->RspToken.Message,1036 HttpIo->Context1037 );1038 if (EFI_ERROR (Status)) {1039 return Status;1040 }1041 }1042 1043 //1044 // Store the received data into the wrapper.1045 //1046 ResponseData->Status = HttpIo->RspToken.Status;1047 ResponseData->HeaderCount = HttpIo->RspToken.Message->HeaderCount;1048 ResponseData->Headers = HttpIo->RspToken.Message->Headers;1049 ResponseData->BodyLength = HttpIo->RspToken.Message->BodyLength;1050 491 1051 492 return Status; -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/HttpBootDxe/HttpBootSupport.h
r85718 r89983 3 3 4 4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2020 Hewlett-Packard Development Company, L.P.<BR> 5 6 SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 … … 87 88 ); 88 89 89 //90 // A wrapper structure to hold the HTTP headers.91 //92 typedef struct {93 UINTN MaxHeaderCount;94 UINTN HeaderCount;95 EFI_HTTP_HEADER *Headers;96 } HTTP_IO_HEADER;97 98 /**99 Create a HTTP_IO_HEADER to hold the HTTP header items.100 101 @param[in] MaxHeaderCount The maximum number of HTTP header in this holder.102 103 @return A pointer of the HTTP header holder or NULL if failed.104 105 **/106 HTTP_IO_HEADER *107 HttpBootCreateHeader (108 IN UINTN MaxHeaderCount109 );110 111 /**112 Destroy the HTTP_IO_HEADER and release the resources.113 114 @param[in] HttpIoHeader Point to the HTTP header holder to be destroyed.115 116 **/117 VOID118 HttpBootFreeHeader (119 IN HTTP_IO_HEADER *HttpIoHeader120 );121 122 /**123 Set or update a HTTP header with the field name and corresponding value.124 125 @param[in] HttpIoHeader Point to the HTTP header holder.126 @param[in] FieldName Null terminated string which describes a field name.127 @param[in] FieldValue Null terminated string which describes the corresponding field value.128 129 @retval EFI_SUCCESS The HTTP header has been set or updated.130 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.131 @retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation.132 @retval Other Unexpected error happened.133 134 **/135 EFI_STATUS136 HttpBootSetHeader (137 IN HTTP_IO_HEADER *HttpIoHeader,138 IN CHAR8 *FieldName,139 IN CHAR8 *FieldValue140 );141 142 ///143 /// HTTP_IO_CALLBACK_EVENT144 ///145 typedef enum {146 HttpIoRequest,147 HttpIoResponse148 } HTTP_IO_CALLBACK_EVENT;149 150 /**151 HttpIo Callback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened.152 153 @param[in] EventType Indicate the Event type that occurs in the current callback.154 @param[in] Message HTTP message which will be send to, or just received from HTTP server.155 @param[in] Context The Callback Context pointer.156 157 @retval EFI_SUCCESS Tells the HttpIo to continue the HTTP process.158 @retval Others Tells the HttpIo to abort the current HTTP process.159 **/160 typedef161 EFI_STATUS162 (EFIAPI * HTTP_IO_CALLBACK) (163 IN HTTP_IO_CALLBACK_EVENT EventType,164 IN EFI_HTTP_MESSAGE *Message,165 IN VOID *Context166 );167 168 //169 // HTTP_IO configuration data for IPv4170 //171 typedef struct {172 EFI_HTTP_VERSION HttpVersion;173 UINT32 RequestTimeOut; // In milliseconds.174 UINT32 ResponseTimeOut; // In milliseconds.175 BOOLEAN UseDefaultAddress;176 EFI_IPv4_ADDRESS LocalIp;177 EFI_IPv4_ADDRESS SubnetMask;178 UINT16 LocalPort;179 } HTTP4_IO_CONFIG_DATA;180 181 //182 // HTTP_IO configuration data for IPv6183 //184 typedef struct {185 EFI_HTTP_VERSION HttpVersion;186 UINT32 RequestTimeOut; // In milliseconds.187 BOOLEAN UseDefaultAddress;188 EFI_IPv6_ADDRESS LocalIp;189 UINT16 LocalPort;190 } HTTP6_IO_CONFIG_DATA;191 192 193 //194 // HTTP_IO configuration195 //196 typedef union {197 HTTP4_IO_CONFIG_DATA Config4;198 HTTP6_IO_CONFIG_DATA Config6;199 } HTTP_IO_CONFIG_DATA;200 201 //202 // HTTP_IO wrapper of the EFI HTTP service.203 //204 typedef struct {205 UINT8 IpVersion;206 EFI_HANDLE Image;207 EFI_HANDLE Controller;208 EFI_HANDLE Handle;209 210 EFI_HTTP_PROTOCOL *Http;211 212 HTTP_IO_CALLBACK Callback;213 VOID *Context;214 215 EFI_HTTP_TOKEN ReqToken;216 EFI_HTTP_MESSAGE ReqMessage;217 EFI_HTTP_TOKEN RspToken;218 EFI_HTTP_MESSAGE RspMessage;219 220 BOOLEAN IsTxDone;221 BOOLEAN IsRxDone;222 223 EFI_EVENT TimeoutEvent;224 } HTTP_IO;225 226 //227 // A wrapper structure to hold the received HTTP response data.228 //229 typedef struct {230 EFI_HTTP_RESPONSE_DATA Response;231 UINTN HeaderCount;232 EFI_HTTP_HEADER *Headers;233 UINTN BodyLength;234 CHAR8 *Body;235 EFI_STATUS Status;236 } HTTP_IO_RESPONSE_DATA;237 238 90 /** 239 91 Retrieve the host address using the EFI_DNS6_PROTOCOL. … … 266 118 IN EFI_EVENT Event, 267 119 IN VOID *Context 268 );269 270 /**271 Create a HTTP_IO to access the HTTP service. It will create and configure272 a HTTP child handle.273 274 @param[in] Image The handle of the driver image.275 @param[in] Controller The handle of the controller.276 @param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.277 @param[in] ConfigData The HTTP_IO configuration data.278 @param[in] Callback Callback function which will be invoked when specified279 HTTP_IO_CALLBACK_EVENT happened.280 @param[in] Context The Context data which will be passed to the Callback function.281 @param[out] HttpIo The HTTP_IO.282 283 @retval EFI_SUCCESS The HTTP_IO is created and configured.284 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.285 @retval EFI_UNSUPPORTED One or more of the control options are not286 supported in the implementation.287 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.288 @retval Others Failed to create the HTTP_IO or configure it.289 290 **/291 EFI_STATUS292 HttpIoCreateIo (293 IN EFI_HANDLE Image,294 IN EFI_HANDLE Controller,295 IN UINT8 IpVersion,296 IN HTTP_IO_CONFIG_DATA *ConfigData,297 IN HTTP_IO_CALLBACK Callback,298 IN VOID *Context,299 OUT HTTP_IO *HttpIo300 );301 302 /**303 Destroy the HTTP_IO and release the resources.304 305 @param[in] HttpIo The HTTP_IO which wraps the HTTP service to be destroyed.306 307 **/308 VOID309 HttpIoDestroyIo (310 IN HTTP_IO *HttpIo311 );312 313 /**314 Synchronously send a HTTP REQUEST message to the server.315 316 @param[in] HttpIo The HttpIo wrapping the HTTP service.317 @param[in] Request A pointer to storage such data as URL and HTTP method.318 @param[in] HeaderCount Number of HTTP header structures in Headers list.319 @param[in] Headers Array containing list of HTTP headers.320 @param[in] BodyLength Length in bytes of the HTTP body.321 @param[in] Body Body associated with the HTTP request.322 323 @retval EFI_SUCCESS The HTTP request is transmitted.324 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.325 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.326 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.327 @retval Others Other errors as indicated.328 329 **/330 EFI_STATUS331 HttpIoSendRequest (332 IN HTTP_IO *HttpIo,333 IN EFI_HTTP_REQUEST_DATA *Request, OPTIONAL334 IN UINTN HeaderCount,335 IN EFI_HTTP_HEADER *Headers, OPTIONAL336 IN UINTN BodyLength,337 IN VOID *Body OPTIONAL338 );339 340 /**341 Synchronously receive a HTTP RESPONSE message from the server.342 343 @param[in] HttpIo The HttpIo wrapping the HTTP service.344 @param[in] RecvMsgHeader TRUE to receive a new HTTP response (from message header).345 FALSE to continue receive the previous response message.346 @param[out] ResponseData Point to a wrapper of the received response data.347 348 @retval EFI_SUCCESS The HTTP response is received.349 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.350 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.351 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.352 @retval Others Other errors as indicated.353 354 **/355 EFI_STATUS356 HttpIoRecvResponse (357 IN HTTP_IO *HttpIo,358 IN BOOLEAN RecvMsgHeader,359 OUT HTTP_IO_RESPONSE_DATA *ResponseData360 120 ); 361 121 -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/HttpDxe/HttpProto.c
r85718 r89983 874 874 // 875 875 HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle); 876 HttpInstance->TlsChildHandle = NULL; 876 877 } 877 878 -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Include/Library/HttpLib.h
r85718 r89983 477 477 ); 478 478 479 // 480 // A wrapper structure to hold the HTTP headers. 481 // 482 typedef struct { 483 UINTN MaxHeaderCount; 484 UINTN HeaderCount; 485 EFI_HTTP_HEADER *Headers; 486 } HTTP_IO_HEADER; 487 488 489 /** 490 Create a HTTP_IO_HEADER to hold the HTTP header items. 491 492 @param[in] MaxHeaderCount The maximun number of HTTP header in this holder. 493 494 @return A pointer of the HTTP header holder or NULL if failed. 495 496 **/ 497 HTTP_IO_HEADER * 498 HttpIoCreateHeader ( 499 UINTN MaxHeaderCount 500 ); 501 502 /** 503 Destroy the HTTP_IO_HEADER and release the resources. 504 505 @param[in] HttpIoHeader Point to the HTTP header holder to be destroyed. 506 507 **/ 508 VOID 509 HttpIoFreeHeader ( 510 IN HTTP_IO_HEADER *HttpIoHeader 511 ); 512 513 /** 514 Set or update a HTTP header with the field name and corresponding value. 515 516 @param[in] HttpIoHeader Point to the HTTP header holder. 517 @param[in] FieldName Null terminated string which describes a field name. 518 @param[in] FieldValue Null terminated string which describes the corresponding field value. 519 520 @retval EFI_SUCCESS The HTTP header has been set or updated. 521 @retval EFI_INVALID_PARAMETER Any input parameter is invalid. 522 @retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation. 523 @retval Other Unexpected error happened. 524 525 **/ 526 EFI_STATUS 527 HttpIoSetHeader ( 528 IN HTTP_IO_HEADER *HttpIoHeader, 529 IN CHAR8 *FieldName, 530 IN CHAR8 *FieldValue 531 ); 479 532 480 533 #endif -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c
r85718 r89983 4 4 5 5 Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR> 6 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>6 (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR> 7 7 SPDX-License-Identifier: BSD-2-Clause-Patent 8 8 … … 1123 1123 UINTN RemainderLengthInThis; 1124 1124 UINTN LengthForCallback; 1125 UINTN PortionLength; 1125 1126 EFI_STATUS Status; 1126 1127 HTTP_BODY_PARSER *Parser; … … 1174 1175 // Identity transfer-coding, just notify user to save the body data. 1175 1176 // 1177 PortionLength = MIN ( 1178 BodyLength, 1179 Parser->ContentLength - Parser->ParsedBodyLength 1180 ); 1181 if (PortionLength == 0) { 1182 // 1183 // Got BodyLength, but no ContentLength. Use BodyLength. 1184 // 1185 PortionLength = BodyLength; 1186 Parser->ContentLength = PortionLength; 1187 } 1188 1176 1189 if (Parser->Callback != NULL) { 1177 1190 Status = Parser->Callback ( 1178 1191 BodyParseEventOnData, 1179 1192 Char, 1180 MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength),1193 PortionLength, 1181 1194 Parser->Context 1182 1195 ); … … 1185 1198 } 1186 1199 } 1187 Char += MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength);1188 Parser->ParsedBodyLength += MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength);1200 Char += PortionLength; 1201 Parser->ParsedBodyLength += PortionLength; 1189 1202 if (Parser->ParsedBodyLength == Parser->ContentLength) { 1190 1203 Parser->State = BodyParserComplete; … … 2083 2096 } 2084 2097 2098 2099 /** 2100 Create a HTTP_IO_HEADER to hold the HTTP header items. 2101 2102 @param[in] MaxHeaderCount The maximun number of HTTP header in this holder. 2103 2104 @return A pointer of the HTTP header holder or NULL if failed. 2105 2106 **/ 2107 HTTP_IO_HEADER * 2108 HttpIoCreateHeader ( 2109 UINTN MaxHeaderCount 2110 ) 2111 { 2112 HTTP_IO_HEADER *HttpIoHeader; 2113 2114 if (MaxHeaderCount == 0) { 2115 return NULL; 2116 } 2117 2118 HttpIoHeader = AllocateZeroPool (sizeof (HTTP_IO_HEADER) + MaxHeaderCount * sizeof (EFI_HTTP_HEADER)); 2119 if (HttpIoHeader == NULL) { 2120 return NULL; 2121 } 2122 2123 HttpIoHeader->MaxHeaderCount = MaxHeaderCount; 2124 HttpIoHeader->Headers = (EFI_HTTP_HEADER *) (HttpIoHeader + 1); 2125 2126 return HttpIoHeader; 2127 } 2128 2129 /** 2130 Destroy the HTTP_IO_HEADER and release the resources. 2131 2132 @param[in] HttpIoHeader Point to the HTTP header holder to be destroyed. 2133 2134 **/ 2135 VOID 2136 HttpIoFreeHeader ( 2137 IN HTTP_IO_HEADER *HttpIoHeader 2138 ) 2139 { 2140 UINTN Index; 2141 2142 if (HttpIoHeader != NULL) { 2143 if (HttpIoHeader->HeaderCount != 0) { 2144 for (Index = 0; Index < HttpIoHeader->HeaderCount; Index++) { 2145 FreePool (HttpIoHeader->Headers[Index].FieldName); 2146 ZeroMem (HttpIoHeader->Headers[Index].FieldValue, AsciiStrSize (HttpIoHeader->Headers[Index].FieldValue)); 2147 FreePool (HttpIoHeader->Headers[Index].FieldValue); 2148 } 2149 } 2150 FreePool (HttpIoHeader); 2151 } 2152 } 2153 2154 /** 2155 Set or update a HTTP header with the field name and corresponding value. 2156 2157 @param[in] HttpIoHeader Point to the HTTP header holder. 2158 @param[in] FieldName Null terminated string which describes a field name. 2159 @param[in] FieldValue Null terminated string which describes the corresponding field value. 2160 2161 @retval EFI_SUCCESS The HTTP header has been set or updated. 2162 @retval EFI_INVALID_PARAMETER Any input parameter is invalid. 2163 @retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation. 2164 @retval Other Unexpected error happened. 2165 2166 **/ 2167 EFI_STATUS 2168 HttpIoSetHeader ( 2169 IN HTTP_IO_HEADER *HttpIoHeader, 2170 IN CHAR8 *FieldName, 2171 IN CHAR8 *FieldValue 2172 ) 2173 { 2174 EFI_HTTP_HEADER *Header; 2175 UINTN StrSize; 2176 CHAR8 *NewFieldValue; 2177 2178 if (HttpIoHeader == NULL || FieldName == NULL || FieldValue == NULL) { 2179 return EFI_INVALID_PARAMETER; 2180 } 2181 2182 Header = HttpFindHeader (HttpIoHeader->HeaderCount, HttpIoHeader->Headers, FieldName); 2183 if (Header == NULL) { 2184 // 2185 // Add a new header. 2186 // 2187 if (HttpIoHeader->HeaderCount >= HttpIoHeader->MaxHeaderCount) { 2188 return EFI_OUT_OF_RESOURCES; 2189 } 2190 Header = &HttpIoHeader->Headers[HttpIoHeader->HeaderCount]; 2191 2192 StrSize = AsciiStrSize (FieldName); 2193 Header->FieldName = AllocatePool (StrSize); 2194 if (Header->FieldName == NULL) { 2195 return EFI_OUT_OF_RESOURCES; 2196 } 2197 CopyMem (Header->FieldName, FieldName, StrSize); 2198 Header->FieldName[StrSize -1] = '\0'; 2199 2200 StrSize = AsciiStrSize (FieldValue); 2201 Header->FieldValue = AllocatePool (StrSize); 2202 if (Header->FieldValue == NULL) { 2203 FreePool (Header->FieldName); 2204 return EFI_OUT_OF_RESOURCES; 2205 } 2206 CopyMem (Header->FieldValue, FieldValue, StrSize); 2207 Header->FieldValue[StrSize -1] = '\0'; 2208 2209 HttpIoHeader->HeaderCount++; 2210 } else { 2211 // 2212 // Update an existing one. 2213 // 2214 StrSize = AsciiStrSize (FieldValue); 2215 NewFieldValue = AllocatePool (StrSize); 2216 if (NewFieldValue == NULL) { 2217 return EFI_OUT_OF_RESOURCES; 2218 } 2219 CopyMem (NewFieldValue, FieldValue, StrSize); 2220 NewFieldValue[StrSize -1] = '\0'; 2221 2222 if (Header->FieldValue != NULL) { 2223 FreePool (Header->FieldValue); 2224 } 2225 Header->FieldValue = NewFieldValue; 2226 } 2227 2228 return EFI_SUCCESS; 2229 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Network.dsc.inc
r85718 r89983 8 8 # IA32 PEI and X64 DXE platform. Its default value is FALSE. 9 9 # 10 # Copyright (c) 2019 , Intel Corporation. All rights reserved.<BR>10 # Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR> 11 11 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 12 12 # … … 31 31 !include NetworkPkg/NetworkLibs.dsc.inc 32 32 33 [BuildOptions] 34 !include NetworkPkg/NetworkBuildOptions.dsc.inc 35 33 36 !if $(PLATFORMX64_ENABLE) == TRUE 34 37 [Components.X64] -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Network.fdf.inc
r80721 r89983 47 47 !endif 48 48 49 !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE49 !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE) 50 50 INF NetworkPkg/DnsDxe/DnsDxe.inf 51 51 INF NetworkPkg/HttpDxe/HttpDxe.inf 52 52 INF NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf 53 !endif 54 55 !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE 53 56 INF NetworkPkg/HttpBootDxe/HttpBootDxe.inf 54 57 !endif -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/NetworkComponents.dsc.inc
r80721 r89983 49 49 !endif 50 50 51 !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE51 !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE) 52 52 NetworkPkg/DnsDxe/DnsDxe.inf 53 53 NetworkPkg/HttpDxe/HttpDxe.inf 54 54 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf 55 !endif 56 57 !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE 55 58 NetworkPkg/HttpBootDxe/HttpBootDxe.inf 56 59 !endif -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/NetworkDefines.dsc.inc
r80721 r89983 16 16 # DEFINE NETWORK_IP6_ENABLE = TRUE 17 17 # DEFINE NETWORK_TLS_ENABLE = TRUE 18 # DEFINE NETWORK_HTTP_ENABLE = FALSE 18 19 # DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE 19 20 # DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE 20 # DEFINE NETWORK_ISCSI_ENABLE = TRUE21 # DEFINE NETWORK_ISCSI_ENABLE = FALSE 21 22 # DEFINE NETWORK_VLAN_ENABLE = TRUE 22 23 # 23 24 # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> 25 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> 24 26 # 25 27 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 74 76 !endif 75 77 78 !ifndef NETWORK_HTTP_ENABLE 79 # 80 # This flag is to enable or disable HTTP(S) feature. 81 # The default is set to FALSE to not affecting the existing 82 # platforms. 83 # NETWORK_HTTP_ENABLE set to FALSE is not affecting NETWORK_HTTP_BOOT_ENABLE 84 # when NETWORK_HTTP_BOOT_ENABLE is TRUE. 85 DEFINE NETWORK_HTTP_ENABLE = FALSE 86 !endif 87 76 88 !ifndef NETWORK_HTTP_BOOT_ENABLE 77 89 # 78 90 # This flag is to enable or disable HTTP(S) boot feature. 91 # 79 92 # 80 93 DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE … … 102 115 # since libssl is not required for iSCSI. 103 116 # 104 DEFINE NETWORK_ISCSI_ENABLE = TRUE117 DEFINE NETWORK_ISCSI_ENABLE = FALSE 105 118 !endif 106 119 … … 113 126 !endif 114 127 115 !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) AND ($(NETWORK_TLS_ENABLE) == FALSE) AND ($(NETWORK_ALLOW_HTTP_CONNECTIONS) == FALSE) 116 !error "Must enable TLS to support HTTPS, or allow unsecured HTTP connection, if NETWORK_HTTP_BOOT_ENABLE is set to TRUE!" 128 !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE) 129 !if ($(NETWORK_TLS_ENABLE) == FALSE) AND ($(NETWORK_ALLOW_HTTP_CONNECTIONS) == FALSE) 130 !error "Must enable TLS to support HTTPS, or allow unsecured HTTP connection, if NETWORK_HTTP_BOOT_ENABLE or NETWORK_HTTP_ENABLE is set to TRUE!" 131 !endif 117 132 !endif 118 133 !endif -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/NetworkLibs.dsc.inc
r80721 r89983 7 7 # 8 8 # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> 9 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> 9 10 # 10 11 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 17 18 UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf 18 19 TcpIoLib|NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf 19 # HttpLib is used for Http Boot 20 # HttpLib and HttpIoLib are used for Http Boot and other 21 # HTTP applications. 20 22 HttpLib|NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf 23 HttpIoLib|NetworkPkg/Library/DxeHttpIoLib/DxeHttpIoLib.inf -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/NetworkPkg.ci.yaml
r85718 r89983 3 3 # 4 4 # Copyright (c) Microsoft Corporation 5 # Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> 6 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> 5 7 # SPDX-License-Identifier: BSD-2-Clause-Patent 6 8 ## 7 9 { 10 "LicenseCheck": { 11 "IgnoreFiles": [] 12 }, 13 "EccCheck": { 14 ## Exception sample looks like below: 15 ## "ExceptionList": [ 16 ## "<ErrorID>", "<KeyWord>" 17 ## ] 18 "ExceptionList": [ 19 ], 20 ## Both file path and directory path are accepted. 21 "IgnoreFiles": [ 22 ] 23 }, 8 24 "CompilerPlugin": { 9 25 "DscPath": "NetworkPkg.dsc" … … 57 73 "BLD_*_NETWORK_IP6_ENABLE": "TRUE", 58 74 "BLD_*_NETWORK_TLS_ENABLE": "TRUE", 75 "BLD_*_NETWORK_HTTP_ENABLE": "FALSE", 59 76 "BLD_*_NETWORK_HTTP_BOOT_ENABLE": "TRUE", 60 77 "BLD_*_NETWORK_ISCSI_ENABLE": "TRUE", -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/NetworkPkg.dec
r85718 r89983 4 4 # This package provides network modules that conform to UEFI 2.4 specification. 5 5 # 6 # Copyright (c) 2009 - 20 19, Intel Corporation. All rights reserved.<BR>7 # (C) Copyright 2015-20 17Hewlett Packard Enterprise Development LP<BR>6 # Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR> 7 # (C) Copyright 2015-2020 Hewlett Packard Enterprise Development LP<BR> 8 8 # 9 9 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 41 41 # This library is only intended to be used by UEFI network stack modules. 42 42 HttpLib|Include/Library/HttpLib.h 43 44 ## @libraryclass Http IO helper routines for HTTP transfer. 45 # This library is only intended to be used by UEFI network stack modules. 46 HttpIoLib|Include/Library/HttpIoLib.h 43 47 44 48 ## @libraryclass Library for Deferred Procedure Calls. … … 89 93 # @Prompt Max attempt number. 90 94 gEfiNetworkPkgTokenSpaceGuid.PcdMaxIScsiAttemptNumber|0x08|UINT8|0x0000000D 95 96 ## The maximum size of total HTTP chunk transfer. 97 # @Prompt Max size of total HTTP chunk transfer. the default value is 12MB. 98 gEfiNetworkPkgTokenSpaceGuid.PcdMaxHttpChunkTransfer|0x0C00000|UINT32|0x0000000E 99 100 ## The Timeout value of HTTP IO. 101 # @Prompt The Timeout value of HTTP Io. Default value is 5000. 102 gEfiNetworkPkgTokenSpaceGuid.PcdHttpIoTimeout|5000|UINT32|0x0000000F 91 103 92 104 [PcdsFixedAtBuild, PcdsPatchableInModule] -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/NetworkPkg.dsc
r85718 r89983 3 3 # 4 4 # (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> 5 # Copyright (c) 2009 - 20 18, Intel Corporation. All rights reserved.<BR>5 # Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR> 6 6 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 7 7 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 18 18 BUILD_TARGETS = DEBUG|RELEASE|NOOPT 19 19 SKUID_IDENTIFIER = DEFAULT 20 21 DEFINE NETWORK_ISCSI_ENABLE = TRUE 22 23 !include MdePkg/MdeLibs.dsc.inc 20 24 21 25 [LibraryClasses] … … 41 45 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf 42 46 SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf 47 RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf 43 48 44 49 !ifdef CONTINUOUS_INTEGRATION … … 107 112 NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf 108 113 NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf 114 NetworkPkg/Library/DxeHttpIoLib/DxeHttpIoLib.inf 109 115 NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf 110 116 NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
Note:
See TracChangeset
for help on using the changeset viewer.